diff --git a/lib/integration-guides.tsx b/lib/integration-guides.tsx index 5cfaf17..dd175f7 100644 --- a/lib/integration-guides.tsx +++ b/lib/integration-guides.tsx @@ -2298,15 +2298,32 @@ export default defineConfig({

Follow these steps to add Pulse through GTM:

  1. Go to Tags → New → Custom HTML
  2. -
  3. Paste the Pulse script
  4. +
  5. Paste the snippet below (replace your-site.com with your domain)
  6. Set the trigger to All Pages
  7. Publish your container
- {` +`} + +

+ This uses a global config object so that GTM does not need to preserve{' '} + data-* attributes on the injected script element. You can + also pass api, storage, and other options via{' '} + pulseConfig. +

+ +
+ + Alternative: inline data attributes (may not work in all GTM setups) + + {``} +

For more details, see the{' '} diff --git a/public/script.js b/public/script.js index 34f078a..1a15f6d 100644 --- a/public/script.js +++ b/public/script.js @@ -19,18 +19,37 @@ } - // * Get domain from script tag - const script = document.currentScript || document.querySelector('script[data-domain]'); - if (!script || !script.getAttribute('data-domain')) { + // * Get config from script tag, or fall back to window.pulseConfig for GTM / tag managers + // * GTM Custom HTML tags may not preserve data-* attributes on the injected