Added analytics to the code