User talk:Dantman/Analytics integration

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)

All snippets go in LocalSettings.php?
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)

Prevent analytics for an IP address or range
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
Updating to the recent version of Google Analytics requires replacing the line

ga.src = ('https:' == document.location.protocol ? 'https:// ssl' : 'http:// www') + '.google-analytics.com/ga.js';

with the line

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

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)
 * Thanks for posting that update, the code didn't work for me until I changed this. Tenbergen (talk) 02:49, 1 October 2014 (UTC)