Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Google Universal Analytics

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Webbo Posted - 01 February 2014 : 18:19:51
Does anyone fancy rewriting the previous Google Analytics code mod to use the new Google Analytics code ?

The previous code was:


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...


<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
2   L A T E S T    R E P L I E S    (Newest First)
Webbo Posted - 03 February 2014 : 02:16:18
I never thought of that
Worked but didn't need the <% at the beginning
Carefree Posted - 01 February 2014 : 19:19:17
Not really, you can escape into HTML and leave it alone.

<%
' vbscript here
%>
<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>
<%
' back to vbscript here....

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000 Version 3.4.07