adds analytics to script