I am using the Google Analytics feature for the first time in J3 with the Metropolis template.
I have it working but I don't get any results for demographics (age and gender). I used the UA code/keyword that Google gave me but it appears that there is a different method that needs to be used if one wants to get this info. It involves making some edits.
Re: How to Enable Google Analytics Demographic Info
Posted 11 years 1 month ago
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 11 years 1 month ago
I'd appreciate some indication from RT whether you'll be updating the default GA code for this anytime soon, or whether I should go ahead with overrides on my sites.
With work going on for the new template as well, there is not too much time at the moment to sort out some of these items to previous templates right away.
Since this one is just one file and a simple override, I'd suggest going through with it for now and when then keep an eye on the updates later on. It would just be removing that file later to let the newer code take over.
Re: How to Enable Google Analytics Demographic Info
Posted 11 years 1 month ago
Fair enough. Thank you.
I did make the changes in an override, and it's all working well according to the page source, but Google refuses to validate for demographics. I scrutinized the syntax and see nothing wrong. I wonder if GA expects its stuff in a separate script tag? The site in question is at
humanistsofmn.org
. Any ideas appreciated.
Re: How to Enable Google Analytics Demographic Info
Posted 11 years 1 month ago
I checked the source code your site is showing and it appears to be correct from what I can tell as well.
It is between script tags, so it should be working fine.
Sometimes Google takes quite a while to recognize a change in your site's code. I'd give it a good 48 hours as Google goes off cached pages a lot of the time. I'm talking about cached on their servers, not your site's cache.
Re: How to Enable Google Analytics Demographic Info
Posted 11 years 4 weeks ago
Thank you for the reply and your effort, Ben. As of this morning GA still won't validate. We continue to get standard tracking data. I'll report back if this changes.
Update: I've decided to use the Skip Validation option. We have some data for gender, etc., which would seem to indicate that it's working.
Re: How to Enable Google Analytics Demographic Info
Posted 11 years 4 weeks ago
I may try it on one of my sites in the next month, so I'm not sure what to tell you from here. I think this is still in Beta for Google though. That may make it tougher to diagnose, but really not sure.