Title: AnonimizeIP
Last modified: October 9, 2020

---

# AnonimizeIP

 *  [lofesa](https://wordpress.org/support/users/lofesa/)
 * (@lofesa)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/anonimizeip/)
 * Hi.
    I´m using this plugin to get g analitycs data at a minumum payload, so I
   use it with Minimals Analitycs. I have configured to NO anonimize ip´s because
   I need it to exclude internal ip from analitycs. Minimal Analitics is suposed
   to set aip:=0 in the collect payload as far as the anonymizeIP is set to false,
   but don´t do it, so have collected data from ip that must no be here. The script
   in the page is: `<script>(function(a,b,c){var d=a.history,e=document,f=navigator
   ||{},g=localStorage,h=encodeURIComponent,i=d.pushState,k=function(){return Math.
   random().toString(36)},l=function(){return g.cid||(g.cid=k()),g.cid},m=function(
   r){var s=[];for(var t in r)r.hasOwnProperty(t)&&void 0!==r[t]&&s.push(h(t)+"="
   +h(r[t]));return s.join("&")},n=function(r,s,t,u,v,w,x){var z="https://mysite.
   com/wp-json/caos/v1/proxy/collect",A=m({v:"1",ds:"web",aip:c.anonymizeIp?1:void
   0,tid:b,cid:l(),t:r||"pageview",sd:c.colorDepth&&screen.colorDepth?screen.colorDepth
   +"-bits":void 0,dr:e.referrer||void 0,dt:e.title,dl:e.location.origin+e.location.
   pathname+e.location.search,ul:c.language?(f.language||"").toLowerCase():void 
   0,de:c.characterSet?e.characterSet:void 0,sr:c.screenSize?(a.screen||{}).width
   +"x"+(a.screen||{}).height:void 0,vp:c.screenSize&&a.visualViewport?(a.visualViewport
   ||{}).width+"x"+(a.visualViewport||{}).height:void 0,ec:s||void 0,ea:t||void 
   0,el:u||void 0,ev:v||void 0,exd:w||void 0,exf:"undefined"!=typeof x&&!1==!!x?
   0:void 0});if(f.sendBeacon)f.sendBeacon(z,A);else{var y=new XMLHttpRequest;y.
   open("POST",z,!0),y.send(A)}};d.pushState=function(r){return"function"==typeof
   d.onpushstate&&d.onpushstate({state:r}),setTimeout(n,c.delay||10),i.apply(d,arguments)},
   n(),a.ma={trackEvent:function o(r,s,t,u){return n("event",r,s,t,u)},trackException:
   function q(r,s){return n("exception",null,null,null,null,r,s)}}})(window,"UA-
   XXXX-1",{anonymizeIp:false,colorDepth:true,characterSet:true,screenSize:true,
   language:true});setTimeout("ma.trackEvent('adjusted bounce rate', '10 seconds')",
   1000);</script>` I have tried to set anonymizeIp to true to see if aip:1 is in
   the payload bu with no look the aip is not here. Any clue about that? Thx in 
   advance
    -  This topic was modified 5 years, 8 months ago by [lofesa](https://wordpress.org/support/users/lofesa/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [lofesa](https://wordpress.org/support/users/lofesa/)
 * (@lofesa)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/anonimizeip/#post-13513190)
 * Hi
    Maybe is rigth. In G docs i see this:
 * > For example, the IP will be anonymized if any of the following parameters are
   > present in the payload: &aip=, &aip=0, or &aip=1
 * here: [https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters)
 * But anyway, when anonimizeIp is set to true, aip: is not in the payloads.
    And
   ip can´t be filtered in G Analytics
    -  This reply was modified 5 years, 8 months ago by [lofesa](https://wordpress.org/support/users/lofesa/).
    -  This reply was modified 5 years, 8 months ago by [lofesa](https://wordpress.org/support/users/lofesa/).
 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/anonimizeip/#post-13513204)
 * Thanks for notifying me, lofesa. I’ll have to do some testing to see if this 
   is a bug.
 *  Thread Starter [lofesa](https://wordpress.org/support/users/lofesa/)
 * (@lofesa)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/anonimizeip/#post-13571280)
 * Hi
    I have made some tries: 1.- Snipet set as minimal, no matter what you select
   in config about anonimizaIP, in the payload the aip: is not set, but when you
   untick the config (No anonimize) in the html script the anonimizeIP is set to
   false, if you tick it, to true. 2.- When snipet is set to analitycs async, then
   no matter what you select in config, the aip: is in the payload allways set to
   1. In the html script code the aip: is set to 1 if you have selected it, and 
   is not present if you have not.
 * P.S: Umm looking in the code, I see that you use php for get the visitor ip, 
   so… whats happens when the html is cached and no php is executed?
    In the same
   funcion you extract the ip from request headers like X-Forwared-For, but for 
   example in Cloudfare this headers can have a list of ip, not only one, so what
   ip to choose? maybe add the cloudflare header CF-Connecting-Ip, this headers 
   have only the visitor IP.
    -  This reply was modified 5 years, 7 months ago by [lofesa](https://wordpress.org/support/users/lofesa/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘AnonimizeIP’ is closed to new replies.

 * ![](https://ps.w.org/host-analyticsjs-local/assets/icon-256x256.png?rev=3307068)
 * [CAOS | Host Google Analytics Locally](https://wordpress.org/plugins/host-analyticsjs-local/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/host-analyticsjs-local/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/host-analyticsjs-local/)
 * [Active Topics](https://wordpress.org/support/plugin/host-analyticsjs-local/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/host-analyticsjs-local/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/host-analyticsjs-local/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [lofesa](https://wordpress.org/support/users/lofesa/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/anonimizeip/#post-13571280)
 * Status: not resolved