Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Conversation

@Rowno
Copy link
Contributor

@Rowno Rowno commented May 9, 2018

The tracking plan All: false is being stripped when All: false is passed in the load options, which makes the tracking plan mostly inert.

@f2prateek
Copy link
Contributor

So the bug here was when analytics.js would be initialized like this (as the consent manager would do):

analytics.load("mA3XTMcavCUOQo5DL56VIHWcJMsyhAI7", {
  integrations: {
    All: false,
    'Segment.io': true,
    Amplitude: true,
  }
});

And when the plan had disabled an event, say "Completed Order". Here planIntegrations = { All: false, 'Segment.io', true }.

In this case, when this LOC (before this change) is executed:

  if (planIntegrations.All === false) {
    integrations = {};
  }

This would cause the All: false to be removed in the final integrations object, and would have sent the event to all integrations that didn't explicitly have a value set.

Copy link
Contributor

@f2prateek f2prateek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, LGTM!

@Rowno Rowno merged commit e1185ce into master May 9, 2018
@Rowno Rowno deleted the fix-schema-with-load-options branch May 9, 2018 22:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants