This is an auto-generated topic for
Google Analytics 1.6-ga by ncrossland.
Brief Description:
Adds a Google Analytics tag to every HTML page of your website. Provides customisation of the analytics code.
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
Can I ask for a small addition to the code to support cookieless subdomains?
In order to set up a cookieless subdomain I want to make sure that my server or application only sets cookies for www.example.com and not the top-level example.com. (Cookies set at the top-level domain apply to all subdomains as well.) One known cookie-setters is Google Analytics, therefore my question to make the following change to your great plugin.
For Google Analytics, you have to set the “_setDomainName” value to your www domain. Like this:
_gaq.push(
[’_setAccount’, ’UA-xxxxxxx-1’],
[’_setDomainName’, ’www.example.com’],
[’_trackPageview’]
);
Thanks
Oliver
I made the changes myself, please find attached version 1.7
The cookies from google analytics are now contained to just www.yourdomain.com
This is handy for the sake of working with cookieless subdomains.
Don’t know how to upload to repository, but here it is.
Oliver
Found the issue needed a \ before any " that fixed it.
Quote from: derelict at Dec 21, 2010, 04:10 AM
Thank you for your plugin, but you have a small error in it:
_gaq.push(['_trackPageview'] $trackingName_value);
should be replaced with
_gaq.push(['_trackPageview'$trackingName_value]);
Hi Derelict
Thanks - I’ve corrected this and uploaded the new version (1.7) to the repository
http://modxcms.com/extras/package/?package=178
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
Quote from: OlivierF at Nov 09, 2010, 10:02 AM
Can I ask for a small addition to the code to support cookieless subdomains?
In order to set up a cookieless subdomain I want to make sure that my server or application only sets cookies for www.example.com and not the top-level example.com. (Cookies set at the top-level domain apply to all subdomains as well.) One known cookie-setters is Google Analytics, therefore my question to make the following change to your great plugin.
For Google Analytics, you have to set the “_setDomainName” value to your www domain. Like this:
_gaq.push(
[’_setAccount’, ’UA-xxxxxxx-1’],
[’_setDomainName’, ’www.example.com’],
[’_trackPageview’]
);
Thanks
Oliver
Hi Oliver
I’d suggest adding this via the extraJs parameter, which allows you to insert extra JS at that point in the script, rather than modifying the script directly, as not everyone will require this.
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK