I’m including the Google Analytics Script divided into 2 pierces of Javascript code:
google-analytics.js: (above)
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "
page-tracker.js
try {
var pageTracker = _gat._getTracker("U*-********-*");
pageTracker._trackPageview();
} catch(err) {}
(I hided the “U*-********-*” because I think it’s an important serial number, not sure)
I tried placing them in the same Javascript file and I waited for 1 day and Google didn’t start tracking my page. Am I doing something wrong?
Should I just place them in a same file. How?
(I checked the URL and its right and i set the default page to be index.php)
You have to place both pieces of GA code on the same page you want tracked, that is the only way it should work.
Google’s Analytics setup page says:
Or as written on the “Learn More” link:
…and the link: Learn More