Quantcast
Channel: Squarespace Answers - latest questions
Viewing all articles
Browse latest Browse all 21023

What code do I need to add to anonymise IP addresses (for Google Analytics)?

$
0
0

Hi guys,

I'm aware that analytics are already a feature of Squarespace. However, I need to use a Google Analytics snippet since it is required to anonymise IP addresses of page visitors in order to meet data protection laws here in Germany. I found several code snippets here: Google Developers: Tracking Code

I also came across this snippet for the classic version of Google Analytics:

<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_gat._anonymizeIp']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

I don't really know much about writing and inserting code, but I think that code would go into the "code injection" blocks with 'UA-XXXXXXX-X' being the account number, of course. Does all this suffice to anonymise IP addresses? If not, how do I do it?

Thanks for any help in advance!

Florian


Viewing all articles
Browse latest Browse all 21023

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>