Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l4ci/b8294674f9f8b487facad694b3a53423 to your computer and use it in GitHub Desktop.
Save l4ci/b8294674f9f8b487facad694b3a53423 to your computer and use it in GitHub Desktop.
<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
<script>
var gaProperty = 'UA-XXXXX-Y';
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
ga('create', gaProperty,'auto');
ga('set','anonymizeIp',true);
ga('send','pageview');
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
window[disableStr] = true;
}
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStr] = true;
alert('Google Analytics wurde für diese Seite deaktiviert!');
}
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment