From 975ea1af579a62897f2959d184ccc39c8543e980 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 26 Sep 2023 13:12:44 +0200 Subject: [PATCH] feat(doc): add google analytics --- docs/astro.config.mjs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index aba98f2..5be045c 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -34,6 +34,25 @@ export default defineConfig({ autogenerate: { directory: 'challenges' }, }, ], + head: [ + { + tag: 'script', + attrs: { + src: 'https://www.googletagmanager.com/gtag/js?id=G-6BXJ62W6G5', + async: true, + }, + }, + { + tag: 'script', + content: ` + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + + gtag('config', 'G-6BXJ62W6G5'); + `, + }, + ], }), ], });