0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Edit in Analytics file not working?

    • KO's Avatar
    • KO
    • Elite Rocketeer
    • Posts: 681
    • Thanks: 3

    Edit in Analytics file not working?

    Posted 11 years 1 month ago
    • Hello Rocketeers!!!

      Has anyone been able to gather demographic information from Google analytics?

      I go here to edit my analytics file
      JOOMLA_ROOT/libraries/gantry/features/analytics.php" file


      I changed:


      (function(i,s,o,g,r,a,m){i=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 this:


      (function(i,s,o,g,r,a,m){i=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 for some reason, my Google Analytics ceases to function anymore. I wonder if there is something wrong here.
      If anyone had any successes with this, I'm all ears!!!

      Thank you for reading.
    • Joe Halleck's Avatar
    • Joe Halleck
    • Preeminent Rocketeer
    • Posts: 5481
    • Thanks: 70
    • Never give up!

    Re: Edit in Analytics file not working?

    Posted 11 years 1 month ago
    • You can't mix __gaTracker and GA in this reference.
      Try using this in the edit to see if it makes any difference.
      __gaTracker('require', 'displayfeatures');
    • Last Edit: 11 years 1 month ago by Joe Halleck. Reason: Grammer
    • Magento - phpBB3 - Kunena - RokBridge Specialist
      No Secure Tab posts unless requested.
      Use the Thank You and Life Preserver Buttons!
      Your signature is also great place for setup details...help us help you!
    • Joe Halleck's Avatar
    • Joe Halleck
    • Preeminent Rocketeer
    • Posts: 5481
    • Thanks: 70
    • Never give up!

    Re: Edit in Analytics file not working?

    Posted 11 years 3 weeks ago
    • ko, did you get this working?
    • Magento - phpBB3 - Kunena - RokBridge Specialist
      No Secure Tab posts unless requested.
      Use the Thank You and Life Preserver Buttons!
      Your signature is also great place for setup details...help us help you!
    • KO's Avatar
    • KO
    • Elite Rocketeer
    • Posts: 681
    • Thanks: 3

    Re: Edit in Analytics file not working?

    Posted 11 years 3 weeks ago
    • Been busy. Will implement the code and see if its working. Thanks for the reply!
    • KO's Avatar
    • KO
    • Elite Rocketeer
    • Posts: 681
    • Thanks: 3

    Re: Edit in Analytics file not working?

    Posted 11 years 3 weeks ago
    • It won't validate.

      I add like this


      // start of Google Analytics javascript
      		?>
      		(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'); __gaTracker('require', 'displayfeatures'); 
      	<?php
      		// end of Google Analytics javascript


      Google suggests add this?
      ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

      Maybe I'll just skip the validation process. Will wait 24 hours for confirmation for demographics.
    • Last Edit: 11 years 3 weeks ago by KO.

Time to create page: 0.071 seconds