Add analytics to template