adding analytics to template