Solved

How can I create an Opt In/Out process independent from browser DoNotTrack settings

  • 24 November 2019
  • 4 replies
  • 310 views

Userlevel 4
Badge +2

It appears that the Mixpanel client-side javascript library utilizes the user's browser 'Do Not Track' settings to determine when to opt users out of tracking. https://help.mixpanel.com/hc/en-us/articles/360001113426-Opt-Out-of-Tracking#do-not-track-settings

Is there any way to create a separate OptIn process that does not utilize these settings? It seems that `mixpanel.opt_in_tracking()` has no effect when the browser 'Do Not Track' setting is enabled.

Would it be possible to re-evaluate the library's use of Do Not Track settings now that browsers have begun opting users out of tracking by default?


icon

Best answer by raja 31 January 2020, 01:48

A new update to the JS SDK was released earlier this week which allows to you ignore/disregard the browser DNT setting in the opted-in/opted-out checks:

https://github.com/mixpanel/mixpanel-js/releases/tag/v2.34.0

mixpanel.init('my token', {ignore_dnt: true});
View original

4 replies

Userlevel 3
Badge

Hey @scottk,

It sounds like you want to work over the default settings of "do not track" on browsers?

What I understand is that Mixpanel's JS client side library will prioritize the "Do Not Track" settings in web browser, regardless if the mixpanel.opt_in_tracking is being set - as it looks like you have experienced. After reading these two articles(1, 2), the vide is that Mixpanel wants to support individuals right to control their personal information. which can be a pain if the browsers are being set default to "do not track", but also good for users to have control and decide if they want to opt-in to tracking(yay privacy rights!).

My over all assumption is that there is no way around it unless the user themselves turns off their "Do Not Track" settings and decides they want to be tracked.


Userlevel 4
Badge +2

Ultimately, I do believe you are correct, there isn’t a way around this. I find it odd that this isn’t something in our control. An application can respect user’s privacy through anonymity. I would have hoped that we would at least have the ability to allow user’s to opt-into tracking for a specific application without asking users to disable their global donottrack settings. With this approach users can’t opt into specific sites without being subject to tracking by all sites.


Userlevel 1
Badge +2

Did some digging around and this might be a work around to this

mixpanel.init("you-project-token", { window: {navigator: {doNotTrack: '0'}}, //forces DNT off (from mixpanel's perspective) });
Userlevel 1
Badge

A new update to the JS SDK was released earlier this week which allows to you ignore/disregard the browser DNT setting in the opted-in/opted-out checks:

https://github.com/mixpanel/mixpanel-js/releases/tag/v2.34.0

mixpanel.init('my token', {ignore_dnt: true});

Reply