Load script on demand #330
-
Since the loadScript boolean is available to be set to false I think its a good idea to expose the loadScript() function call as well or rather have it invokable on demand. A use case for this would be the case that we do not want to load the script unless the correct cookie consent was given. Currently the only alternative I see is setting loadScript to false and then manually adding the GTM script when we decide to but this step is redundant when using You library and I think adding support for it would be a nice thing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From the README:
This is exactly your use-case So later when reading the cookie and it is accepted, then you can call |
Beta Was this translation helpful? Give feedback.
From the README:
This is exactly your use-case
So later when reading the cookie and it is accepted, then you can call
gtm.enable()
and you have exactly what you request