We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    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
      • 22164
      • 50 Posts
      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
        Happy to have left Back Pain | Sciatica behind.
        • 22164
        • 50 Posts
        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
          Happy to have left Back Pain | Sciatica behind.
          • 364
          • 32 Posts
          how do i add in foxy cart GA stuff. to this. my attempts have failed and this code does not get added after the GA script

          <script type="text/javascript" charset="utf-8">
          	fcc.events.cart.preprocess.add(function(e, arr) {
          		if (arr['cart'] == 'checkout' || arr['cart'] == 'updateinfo' || arr['output'] == 'json') {
          			return true;
          		}
          		if (arr['cart'] == 'checkout_paypal_express') {
          			_gaq.push(['_trackPageview', '/paypal_checkout']);
          			return true;
          		}
          		_gaq.push(['_trackPageview', '/cart']);
          		return true;
          	});
          	fcc.events.cart.process.add_pre(function(e, arr) {
          		var pageTracker = _gat._getTrackerByName();
          		jQuery.getJSON('https://' + storedomain + '/cart?' + fcc.session_get() + '&h:ga=' + escape(pageTracker._getLinkerUrl('', true)) + '&output=json&callback=?', function(data){});
          		return true;
          	});
          </script>
            • 364
            • 32 Posts
            Found the issue needed a \ before any " that fixed it.
              • 7112
              • 2 Posts
              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]);
                • 21056
                • 327 Posts
                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
                  • 21056
                  • 327 Posts
                  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