The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Does anyone fancy rewriting the previous Google Analytics code mod to use the new Google Analytics code ?
The previous code was:
The new tracking code for Google Universal Analytics is...
It needs writing into vbscript
The previous code was:
Code:
Response.write "<script type=""text/javascript"">" & vbNewLine & _
"var gaJsHost = ((""https:"" == document.location.protocol) ? ""https://ssl."" : ""http://www."");" & vbNewLine & _
"document.write(unescape(""%3Cscript src='"" + gaJsHost + ""google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E""));" & vbNewLine & _
"</script>" & vbNewLine & _
"<script type=""text/javascript"">" & vbNewLine & _
"var pageTracker = _gat._getTracker(""UA-usernumber"");" & vbNewLine & _
"pageTracker._initData();" & vbNewLine & _
"pageTracker._trackPageview();" & vbNewLine & _
"</script>" & vbNewLine
The new tracking code for Google Universal Analytics is...
Code:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-usenumber', 'site name');
ga('send', 'pageview');
</script>
It needs writing into vbscript