Skip to content

Load script only with consent and unload script #458

Open
@ThiloHettmer

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

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