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:
your-site.com with your domain)
+ 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.
+
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