Skip to content

Instantly share code, notes, and snippets.

@yankiara
Last active May 28, 2018 11:51
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 yankiara/47e4af068759f1ead18b920b792aa1c2 to your computer and use it in GitHub Desktop.
Save yankiara/47e4af068759f1ead18b920b792aa1c2 to your computer and use it in GitHub Desktop.
Anonymise IP address and force SSL in Google Analytics with tarteaucitron (RGPD, GDPR)
<!-- Add before closing <body> tag -->
<script>
tarteaucitron.user.analyticsUa = 'UA-XXXXXXXX-XX';
tarteaucitron.user.analyticsMore = function () { ga('set', 'anonymizeIp', true); ga('set', 'forceSSL', true); };
(tarteaucitron.job = tarteaucitron.job || []).push('analytics');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment