Quick Spark Tip:  One factor you might consider towards reaching GDPR compliance is anonymizing your Google Analytics, so your visitor’s IP address is obfuscated.  The change is easy – simply add a value of “anonymize_ip” and “true” to your tracking code.  The example below shows the latest global site tag “gtag.js” version of Google Analytics code, with the additional anonymize instruction highlighted in yellow:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXX-X', { 'anonymize_ip': true });
</script>

If you are using the older “analytics.js” version of Google Analytics code, you add a line to your code as shown and highlighted in yellow:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('set', 'anonymizeIp', true);
ga('create', 'UA-XXXXXXX-X', 'auto');
ga('send', 'pageview');
</script>

Replace “UA-XXXXXXX-X” with your actual tracking ID number.

Reference:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.