Depending on which version of tracking code you are using on your site, you have to do this in different ways. If your tracking code has the line
var pageTracker = _gat._getTracker('UA-xxxxxxx-x');
then you can follow the instructions provided in Google Analytics Help Center and everything should work fine. However, if your tracking code has the linevar _gaq = _gaq || [];
then change your HTML file to contain this code instead:<body onLoad="javascript:_gaq.push(['_setVar', 'test_value']);">
Pro Tip: You don't really have to create new HTML file on your site for setting the cookie. You can just open your site on the browser and type the value of onLoad
attribute in the address bar. For example, in my case, I opened blog.manki.in on my browser; typed javascript:_gaq.push(['_setVar', 'test_value']);
on the address bar and pressed Enter.
No comments:
Post a Comment