0
Welcome Guest! Login
0 items Join Now

How to Enable Google Analytics Demographic Info

    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: How to Enable Google Analytics Demographic Info

    Posted 10 years 9 months ago
    • Still just the way I posted in this topic:
      I haven't tested this yet, but I believe this is the right way to override and edit this code:

      You'll want to override the "JOOMLA_ROOT/libraries/gantry/features/analytics.php" file. So copy this file over to your template's "/features/" directory.

      Then you can find the line of code to edit in that file.

      You'll want to clear all cache and reload the page to see if it worked properly.
  • Re: How to Enable Google Analytics Demographic Info

    Posted 10 years 7 months ago
    • Is there any further progress on this topic, or a related post that someone can point me towards? I also have updated my code in Leviathin and am not getting a validation from Google...
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: How to Enable Google Analytics Demographic Info

    Posted 10 years 7 months ago
    • Our developers are looking into it as we are trying to get it into Gantry. The issues have been that it is technically beta for Google so just going to that code isn't going to work for everyone.

      Might just have to stay tuned on the new code stuff.
    • KO's Avatar
    • KO
    • Elite Rocketeer
    • Posts: 681
    • Thanks: 3

    Re: How to Enable Google Analytics Demographic Info

    Posted 10 years 6 months ago
    • Quite curious but I wonder has this issue been resolved?

      I to would also like to change:


      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      		(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      		m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      		})(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
      		__gaTracker('create', '<?php echo $this->get('code'); ?>', 'auto');
      		__gaTracker('send', 'pageview');

      to


      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      		(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      		m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      		})(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
      		__gaTracker('create', '<?php echo $this->get('code'); ?>', 'auto');
      		ga('require', 'displayfeatures');
      		__gaTracker('send', 'pageview');

      But when I do this, Google Analytics ceases to function. It could be an error from my side but I just want to know the right way to implement demographics.

      The is seen here: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad

      Please advise. Thank you.
    • Last Edit: 10 years 6 months ago by KO.
  • Re: How to Enable Google Analytics Demographic Info

    Posted 10 years 5 months ago
    • I think your code is wrong. It should look like this. But I haven't tried it myself yet, so it is just a guess.


          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker');
          __gaTracker('create', '<?php echo $this->get('code'); ?>', 'auto');
          __gaTracker('require', 'displayfeatures');
          __gaTracker('send', 'pageview');

Time to create page: 0.058 seconds