From ec7736bb09ead2803ce0588f4854a8f09b2ca292 Mon Sep 17 00:00:00 2001 From: Xander Grzywinski Date: Tue, 21 May 2024 10:34:07 -0700 Subject: [PATCH 1/2] add google analytics for docs pages --- site/astro.config.ts | 9 +++++++++ site/src/components/SkipLink.astro | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 site/src/components/SkipLink.astro diff --git a/site/astro.config.ts b/site/astro.config.ts index 6e54f621a0..18fe366d9a 100644 --- a/site/astro.config.ts +++ b/site/astro.config.ts @@ -25,6 +25,15 @@ export default defineConfig({ integrations: [ starlight({ title: "Zarf", + head: [ + { + tag: "script", + content: "(function(w,d,s,l,i){ ... })(window,document,'script','dataLayer','G-N1XZ8ZXCWL');", + }, + ], + components: { + SkipLink: "./src/components/SkipLink.astro", + }, social: { github: "https://github.com/defenseunicorns/zarf", slack: "https://kubernetes.slack.com/archives/C03B6BJAUJ3", diff --git a/site/src/components/SkipLink.astro b/site/src/components/SkipLink.astro new file mode 100644 index 0000000000..7d863429e4 --- /dev/null +++ b/site/src/components/SkipLink.astro @@ -0,0 +1,18 @@ +--- +import type { Props } from '@astrojs/starlight/props' +import Default from '@astrojs/starlight/components/SkipLink.astro' +--- + + + + + + \ No newline at end of file From 75dc869d4b69ebfcd5d8adb86ef8a5e98f4d78a3 Mon Sep 17 00:00:00 2001 From: Xander Grzywinski Date: Tue, 21 May 2024 11:48:48 -0700 Subject: [PATCH 2/2] actually add the thing for really real Signed-off-by: Xander Grzywinski --- site/astro.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/astro.config.ts b/site/astro.config.ts index 18fe366d9a..ac3b8dec24 100644 --- a/site/astro.config.ts +++ b/site/astro.config.ts @@ -28,7 +28,11 @@ export default defineConfig({ head: [ { tag: "script", - content: "(function(w,d,s,l,i){ ... })(window,document,'script','dataLayer','G-N1XZ8ZXCWL');", + content: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); + })(window,document,'script','dataLayer','G-N1XZ8ZXCWL');`, }, ], components: {