How to add a filter to Mixpanel (e.g. in Google Analytics)

I want to filter my home ip from mixpanel. In Google Analytics, I can do this by adding a filter to my profile. Is there something similar in mixpanel or work to achieve the same result? My application is built in Rails 3, hosted on a hero. Thanks.

+4
source share
3 answers

They talked about support, and they suggested that I block api.mixpanel.com in my host file, which works.

+6
source

Blocking the Mixpanel API by running sudo bash -c 'echo "127.0.0.1 api.mixpanel.com" >> /etc/hosts' worked for me on OS X. It also works with Segment.io.

+1
source

One of the problems with the solution above is that it is difficult to edit the hosts file on mobile devices.

Here is another workaround:

  • Create a β€œsecret” HTML file called x.html (or something else) that sets up a special cookie and uploads it to your website.

     <html> <head> <title>mixpanel cookie</title> <script type="text/javascript"> document.cookie = "analytics-ignore=true; max-age=31536000; path=/"; </script> </head> <body> setting cookie. </body> 

  • in your website / application, check this cookie before starting the mixpanel script initiation.

    if (document.cookie.indexOf ('analytics-ignore') === -1) {//...mixpanel code ...}

  • Note that you can check for the presence of the mixpanel variable before calling your methods ( mixpanel.track ).

Just go to the x.html page once (well, once a year, for the browser and after clearing your cookies, etc.)

0
source

All Articles