Closed seanlail closed 2 years ago
@edsonjab Here's a repo to show the issue: https://github.com/seanlail/segment-cm-issue-259
Create .env.local
and set the NEXT_PUBLIC_SEGMENT_APIKEY=<a valid key>
to run it.
@edsonjab I think this is where the bug is: https://github.com/segmentio/consent-manager/blob/a4633dfe3d9f6e6fb64816245b3e768e56b6d9bb/src/consent-manager/container.tsx#L96 This assumes that the initial preferences are all "enabled" / "true".
My workaround is to call preferences.savePreferences
manually and then reload the page.
I don't know all the destinations dynamically though.
@seanlail I will make some test for initialPreferences, like you say maybe there is the bug
I set the CM to not track by default, but create a custom "Allow" button that calls the internal "acceptAll" function.
Expected outcome: Cookie to be set with all keys accepted
Actual outcome: All declined.