segmentio / consent-manager

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

"initialPreference" is not working on standalone script #249

Closed arijit-tweb closed 2 years ago

arijit-tweb commented 2 years ago

I added this on my standalone script initialPreferences: { Functional: true, Marketing_and_Analytics: true, },

But still "Functional" and "Marketing and Analyics" is not selected "yes" by default.

Also after added "initialPreferences" , I'm unable to close the banner any more

Screenshot (142)

edsonjab commented 2 years ago

Hi @arijit-tweb , could you help me to share us how do you implement your code? you can paste that part of the configuration without your key please

arijit-tweb commented 2 years ago

Now I found some other solution to this, thanks

Munter commented 11 months ago

I'm running into the same issue. @arijit-tweb Would you mind telling what this other solution is?

@edsonjab I'm using the example copy/pasted from the README with the write key updated and initialPreferences: { Functional: true, Marketing_and_Analytics: true, } added. None of the radio's are pre-filled

Munter commented 11 months ago

After stabbing around a bit it looks like these are the correct keys to use when setting initialPreference:

      initialPreferences: {
        marketingAndAnalytics: true,
        advertising: true,
        functional: true,
        essential: true,
      },

I recommend not using the invalid {‘Functional’:true} example in the docs, and possibly show this full config example instead