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

Dynamic integrations list #225

Closed trefasp closed 2 years ago

trefasp commented 2 years ago

I am using the Consent Manager component where I need to pass custom categories as a prop. Is it a way to avoid writing that integrations of strings list in as a free text and to pass there directly what I receive as a response from getting integrations list request? const customCategories = { 'Performance and Analytics': { integrations: ['Google Analytics','Amplitude''], }, };

On each modification that is made on segment integrations list I have to rewrite again that custom categories

edsonjab commented 2 years ago

Hi @trefasp I suggest that you use a Global variable with that values, because that value is optional for Consent Manager and Consent Manager only handle the values when you specify that property

trefasp commented 2 years ago

Sorry, but is not clear for me. I need to define a custom category and there to pass via integrations list props the response that comes from fetch destination list. It's true that I can let by default marketingAndAnalytics category, but there I need a custom description and a custom name

trefasp commented 2 years ago

Or maybe is it a way to use just a part of by default categories, for example to use just essential and marketing, not advertising and not functional

edsonjab commented 2 years ago

Hi @trefasp I'm sorry, now I understand, the only way to define your own categories is using the property customCategories, if you will use the integrations list like categories, I suggest that you get that list before that you will render the ConsentManager component to build the customCategories property and to pass that property in the component.

nd4p90x commented 2 years ago

@trefasp Feel free to re-open if necessary. Thank you