gtm-module
gtm-module copied to clipboard
Environment support
Hey,
is there any way to support
https://support.google.com/tagmanager/answer/6311518?hl=fr
With this plugin? it changes a bit the import script
Thanks
Hi @Jymiz-Tech. I think you may use variables
option but usually, it is with an iframe by google. Would you please explain more about "it changes a bit the import script"?
@pi0 I guess it's because it appends some additional params to the query when loading the script (something along gtm_preview=environment_name
)
This is something that I too would need, together with the environment name, there are two more params that are sent to enable environments, specifically gtm_cookies
and gtm_auth
, at least from what I can see on the generated code by GTM after enabling environments support
@ThePeach please try variables
. It is exactly to send params with script URL :)
The variables
property worked for me, btw:
gtm: {
id: 'GTM-xxxx',
variables: {
gtm_auth: 'xxxx',
gtm_preview: 'xxxx',
gtm_cookies_win: 'xxxx',
}
}