nuxt-segment
nuxt-segment copied to clipboard
Initiating segment on disabled change
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!
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.