For 1.2.x insert code from jscript_google_analytics.php to html_header.php
For 1.2.x insert code from jscript_google_analytics.php to html_header.php
For zen-cart 1.2 you may use this jscript_google_analytics.js:
Code:/** * jscript_google_analytics.js * * @package zen-cart statistic * @copyright Copyright 2005-2006 Andrew Berezin * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: jscript_google_analytics.js,v 1.0.1 29.08.2006 19:24 Andrew Berezin [email protected] $ */ GOOGLE_ANALYTICS_UACCT = 'UA-XXXXXX-X'; google_analytics_url = "http://www.google-analytics.com/urchin.js"; if (p = window.location.protocol) { if (p == 'https:') google_analytics_url = "https://ssl.google-analytics.com/urchin.js"; } var oTheHead = document.getElementsByTagName("head").item(0); var scrUTM = document.createElement("script"); scrUTM.type = "text/javascript"; scrUTM.src = google_analytics_url; oTheHead.appendChild(scrUTM); scrHTML = ''; scrHTML += "\n_uacct = '"+GOOGLE_ANALYTICS_UACCT+"';\n"; scrHTML += "urchinTracker();\n"; var scrUTM = document.createElement("script"); scrUTM.type = "text/javascript"; scrUTM.innerHTML = scrHTML; oTheHead.appendChild(scrUTM);
Thanks Andrew. I do have other tracking scripts inserted like this but your stuff is always so slick I overlooked the obvious.
Thanks, our posts crossed.![]()
Will try the new code and report back.
Google Analytics Integration installed and working fine! Thank you!
Now for the details of site tracking.
Do you add the google generated script to every product and page that you want to track, as google suggests? Or is there another way to add their js?
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-64XXXX-1";
urchinTracker();
</script>
Andrew's great mod does it for you.![]()
If you're still using 1.2.x you'll need to use the modified jscript_google_analytics.js code he posted above.
I am using 1.302, and I think Google is tracking without installing any other code, though I guess that statistics are compiled daily, so I'll have to wait a bit to see results show up on Google.
Thanks for the tip.
Note:
Google has changed the Analytics account to allow for monitoring of multiple sites, from one account.
So now your account number has an extra digit appended, e.g.
UA-64XXXX-1 for site one.
UA-64XXXX-2 for site two.
Make sure to use this complete number in your Zencart admin. settings for the Analytics mod. The default account ID shown in the mod is UA-64XXXX.
Does anyone know if this mod works with the 1.3.5d release announced this morning?
Kelvyn, perhaps you should test some of the mods with 1.3.5 and report back if it works or not instead of post all over the forum about compatibility issues. 1.3.5 has just been released and people installing and testing it, give it some time for people to start reporting back.Originally Posted by kelvyn