segmentio / consent-manager

Drop-in consent management plugin for analytics.js
https://segmentio.github.io/consent-manager/
MIT License
341 stars 144 forks source link

window.analytics.user().traits() vs tracking-preferences document.cookie #311

Closed j-quelly closed 1 year ago

j-quelly commented 1 year ago

When I explicitly set my tracking preferences in the EU window.analytics.user().traits() returns my preferences as expected.

However, when I implicitly consent to all tracking, my preferences are not saved to window.analytics.user().traits() instead they're saved to a tracking-preferences cookie. I'm curious why the consent manager does not mutate the object returned from window.analytics.user().traits()?

Does segment analytics v2 parse the tracking-preferences cookie in addition to the window.analytics.user().traits()?

edsonjab commented 1 year ago

Hi @j-quelly thank you for your report, we start looking into this.

edsonjab commented 1 year ago

HI @j-quelly sorry for the delay, the information will be saved on two places like the next image: image

for you second question, no, analytics v2 read all the cookies set on the page and search the preferences with a different name. You can check this file to see that