Closed olarcher closed 1 year ago
I'd recommend you set up dev/staging/prod GTM environments, it's worth it
Hi @olarcher,
as @doodlemoonch suggested, I think you could achieve your goal with GTM environments.
Just disable in some environments the tags where you want data to not be collected 😄
Thanks for the suggestion! Any ideas how this could be solved technically without the need to set up separate GTM envs?
Thanks for the suggestion! Any ideas how this could be solved technically without the need to set up separate GTM envs?
I think the only way you have at the moment, is wrapping into ifs the dispatcher based on your environments.
But I can think to add a variable to enable/disable dispatching in the future.
Hi @olarcher ,
could you try 2.2.0?
Closing due inactivity
I would like to use this library in a larger project. On certain (dev) environments data should not be sent to GTM. Is it possible to disable GTM integration completely, e.g. by checking the value of an environment variable (if GTM_CONTAINER_ID is set then activate, else don't)? To my understanding, since
useGTMDispatch
is a hook it cannot be called conditionally. Is there any way to deactivate the dispatch anyway?