How to add Script tag through GTM (Google tag mana...
# experimentation
c
How to add Script tag through GTM (Google tag manager) for experimentation? Whenever we add through GTM, it shows disconnected ( When we place the code directly on website, it shows connected)
Can you please help with this @flaky-noon-11399 and @Growthbook team
r
Hi Harshit, what SDK are you using and are you using multiple SDKs? Please, can you send a screenshot of the script you added to GTM?
Have you added ​`data-­*`​ attributes (e.g. in Google Tag Manager)? Alternatively, you can use this version:
Copy code
<script>
(function(s) {
  s=document.createElement('script'); s.async=true;
  s.dataset.clientKey="YOUR­_CLIENT­_KEY­_HERE";
  s.src="­<https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js%22;|https://cdn.jsdelivr.net/npm/@growthbook/growthbook/dist/bundles/auto.min.js";>
  document.head.appendChild(s);
})();
</script>
Is this the affected website? If so we can see that you are missing the key:
To resolve, make sure you're correctly adding the clientKey to the SDK from the GTM integration
c
@flaky-noon-11399: The script solution you provided helped. Thanks.
r
Ah perfect, super glad that worked 🙏