From 1e2c0675c828457e591811e438cdc554dba02386 Mon Sep 17 00:00:00 2001 From: Stamen Stoychev Date: Tue, 18 Aug 2026 18:24:03 +0300 Subject: [PATCH] fix(gtm): improving gtm integration --- src/components/GtmNoscript.astro | 9 ---- src/integration.ts | 76 ++++++++++++++++++++++++++++++-- src/pages/[...slug].astro | 2 - src/pages/index.astro | 2 - src/routes/[...slug].astro | 2 - 5 files changed, 72 insertions(+), 19 deletions(-) delete mode 100644 src/components/GtmNoscript.astro diff --git a/src/components/GtmNoscript.astro b/src/components/GtmNoscript.astro deleted file mode 100644 index 37acb09c4a..0000000000 --- a/src/components/GtmNoscript.astro +++ /dev/null @@ -1,9 +0,0 @@ ---- -import { getGtmContainerId } from '../lib/platform-context.js'; - -const containerId = getGtmContainerId(); ---- - - - - diff --git a/src/integration.ts b/src/integration.ts index 4feb91f694..2ecfe44609 100644 --- a/src/integration.ts +++ b/src/integration.ts @@ -516,6 +516,46 @@ function copyDirSync(src: string, dest: string): void { } +/** + * Astro integration that injects the GTM `