nuxt-segment icon indicating copy to clipboard operation
nuxt-segment copied to clipboard

Initiating segment on disabled change

Open MarineLB opened this issue 3 years ago • 1 comments

Hi ! To comply with GDPR measures, I need to set segment disabled to true initially but then init it when the user clicks accepts in the cookie banner. Is there a way to load the script in this way? setting this.$segment.disabled = false like this does not seem to work.

Thanks!

MarineLB avatar Jul 22 '21 11:07 MarineLB

I think that the best way is to retrieve the destinations by using https://cdn.segment.com/v1/projects/${segment_key}/integrations and display them to the user. When the user has allowed these destinations, send them through segment's window.analytics.load function. Window.analytics will be automatically available via the nuxt-segment plugin.

attac-t avatar Jul 23 '21 19:07 attac-t