Analytics
2.1K members online now
2.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Visitor IP not anonymized

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

 

  I was on OnPage.org to see how I can help better my website and I noticed that it said: "Visitor IP is not anonymized for Google Analytics". 

 

This is the code I have:

<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','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');

</script>

 

I have seen on other boards to change ga('set', 'anonymizeIP', true); , but I don't have that in my code. 

 

How can I go about fixing this?

1 Expert replyverified_user

Re: Visitor IP not anonymized

Top Contributor
# 2
Top Contributor

Hi :-)

Editing your tracking code snippet to include the anonymizeIP line of code will enable that functionality

 

<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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>

 

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Visitor IP not anonymized

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I know just enough to be dangerous but not enough to be smart.  So I received this "Visitor IP is not anonymized for Google Analytics" from Ryte.com.  I assume this is important not that I fully understand why.  My question:  can I copy the code you wrote in March (above) and use it to address the issue and if yes, where do I put the code? 
Thank you, 
Mark.