Ad Blockers Affect Mixpanel

Depending on your website and the type of ad blocker, some users who have ad blockers enabled can prevent Mixpanel from loading on your page.

As a result, Mixpanel will not be able to collect data from those users.

Consider the following for users that Mixpanel does not track because of ad blockers:

  1. Generally, only a small percent of users have ad blockers enabled that prevent Mixpanel from tracking actions. Depending on the nature of your site, decide if not tracking users who have ad blockers enabled is acceptable.
  2. If you have some critical events (e.g., account creation, successful purchase, and so on) that you need tracked, you can track those critical events server-side. That way, you can capture those actions even for users with ad blockers. If you chose this route, make sure you’re properly handling identity management for a hybrid implementation.
  3. If your particular site a larger percentage of users have ad blockers enabled, or if all events are critical, you may consider an entirely server-side implementation (PythonJavaPHPRuby).
  4. You can use the JavaScript client-side SDK to proxy the calls to your own server first. Ad blockers block all outgoing calls made to a different domain than the current one, so your api_host will need to be on the same domain as your site.
    You can set the api_host config option to your own server when initializing Mixpanel, not necessarily within each track call:
mixpanel.init("YOUR TOKEN", { api_host: "api.mydomain.com" });

The data is sent to your proxy first and then you can relay to Mixpanel. Since Mixpanel by default grabs the IP of the proxy server, you'll need to take the IP of the request, include it as a property in the event, and set ip=0 at the header of the request itself.

Is this article helpful?
11 out of 22 found this helpful

Comments

0 comments

Article is closed for comments.