Last active
December 17, 2015 14:52
-
-
Save rmpel/ff00be616387288048e3 to your computer and use it in GitHub Desktop.
This snippet will anonymize IP addresses for Google Analytics (Universal, analytics.js) unless a cookie eucookieconsent is set with value 1.You wil need to put this in the top of the head of your website, or at leaset BEFORE analytics is loaded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(t,r,a,c,k,i,n,g) { | |
if (c === n.test(g)) return; | |
t[r]=t[r]||function(){(t[r].q=t[r].q||[]).push(arguments); if (arguments[0] == i) { t[r]("set", k, c); }}; | |
t[a]=t[a]||t[r]; | |
})( window, 'ga', '__gaTracker', !0, 'anonymizeIp', 'create', /eucookieconsent=1/, document.cookie ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment