Move analytics to external script