Google Analytics Code (newest)


/ Published in: JavaScript
Save to your folder(s)

Make sure you change the variable v_ga_track near the end of the script.


Copy this code and paste it in your HTML
  1. <!-- Google Analytics -->
  2. <script type="text/javascript" language="Javascript1.2">
  3. var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
  4. document.write("<" + "script type='text/javascript' src='" + gaJsHost + "google-analytics.com/ga.js'><" + "/script>");
  5. </script>
  6. <script type="text/javascript" language="Javascript" name="Google Analytics">
  7. function v_ga_track(ga_account, trackDomainName, theDomainName){
  8. var domainNameTracking = trackDomainName ? true : false;
  9. var pageTracker = _gat._getTracker(ga_account);
  10. pageTracker._initData();
  11.  
  12. if (domainNameTracking) {
  13. if (!theDomainName) {
  14. theDomainName = "Config_FullStoreURL".replace("https:", "").replace("http:", "");
  15. theDomainName = theDomainName.substring(2, theDomainName.length - 1);
  16. }
  17. pageTracker._setDomainName(theDomainName);
  18. }
  19. pageTracker._trackPageview();
  20. try {
  21. pageTracker._addTrans(Order[0], "", Order[2], Order[4], Order[5], Order[6], Order[7], Order[8]);
  22. for (var i = 0; i < OrderDetails.length; i++)
  23. pageTracker._addItem(OrderDetails[i][0], OrderDetails[i][2], OrderDetails[i][3], OrderDetails[i][4], OrderDetails[i][5], OrderDetails[i][6]);
  24. pageTracker._trackTrans();
  25. }
  26. catch (e) {
  27. }
  28. }
  29.  
  30. v_ga_track("***CHANGE ME****");
  31. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.