Skip to content

Load script only with consent and unload script #458

Description

@ThiloHettmer

Hello 👋

we are trying to switch from our own google tag manager implementation to nuxt/script, but we are facing some issues:

  1. We only want to load the script if consent is given, and we have a ref/computed with this information. Afaik useScriptTriggerConsent can only be used with useScript() and not with the useScriptGoogleAnalytics composable. It's not alot of code to write it ourselves, but we wondered if it's possible to just pass in a ref which loads and unloads the script.

  2. Which brings me to my next question: How do we unload the script when using useScriptGoogleAnalytics?

BR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions