User talk:Dantman/Analytics integration

Latest comment: 8 years ago by Tenbergen in topic Custom Variables

can you post how your GA code for localsettings looks like as a whole with your security code ideas implemented? I am unsure where and how to arrange the code in that regard. thanks!

The whole point of this is that everyone has different needs. I can't just post a full thing like that. Daniel Friesen (Dantman) (talk) 01:54, 16 February 2012 (UTC)Reply[reply]

All snippets go in LocalSettings.php?[edit]

Thanks for this. Just to clarify: do all those snippets go in LocalSettings.php?

Yes Daniel Friesen (Dantman) (talk) 15:31, 2 December 2013 (UTC)Reply[reply]

Prevent analytics for an IP address or range[edit]

Your analytics integration page is extremely useful. Thank you

Could you explain how to prevent the Google Analytics code by IP address or range? I know that getRequest() and getIP() are involved, but that's about it. (I'm aware that you can filter GA reports by IP address, but that's not optimal.)

Update for new Google Analytics[edit]

Updating to the recent version of Google Analytics requires replacing the line

ga.src = ('https:' == document.location.protocol ? 'https:// ssl' : 'http:// www') + '';

with the line

ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + '';

More information is available here.

This allows for more detailed tracking of categories such as age, gender, and interests. Creepy - perhaps. Also note that Google requires you to update your privacy policy if you are using analytics. More information about the privacy policy is available here. --Friendsofmath (talk) 00:40, 6 July 2014 (UTC)Reply[reply]

  • Thanks for posting that update, the code didn't work for me until I changed this. Tenbergen (talk) 02:49, 1 October 2014 (UTC)Reply[reply]

Custom Variables[edit]

The way I understood the code for the custom variables I assumed it would actually list the users logged in. It doesn't seem to do that, but maybe I misunderstood or maybe I set it up wrong or maybe I am not looking in the right place in analytics. The custom variables don't seem to be reporting right for me. Google analytics receives a custom variable LoggedIn, but it doesn't list any user logins any data while the rest of the site reports in correctly. Same for Skins. Could this be because I had to make the code change mentioned above, does it maybe not work with the new code? Tenbergen (talk) 03:45, 1 October 2014 (UTC)Reply[reply]