From 4a84e75935b7fff2e78eedff189897ddafc6c9bd Mon Sep 17 00:00:00 2001 From: Thomas Tendyck Date: Fri, 22 Nov 2024 16:14:57 +0100 Subject: [PATCH] docs: refactor gtag --- docs/docusaurus.config.js | 11 +++++------ docs/package.json | 1 - docs/static/gtagman.js | 5 +++++ 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 docs/static/gtagman.js diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 42213b0393..553666c860 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -24,8 +24,11 @@ async function createConfig() { // scripts scripts: [ - { id: "Cookiebot", src: "https://consent.cookiebot.com/uc.js", "data-cbid": "a0cc864f-0b67-49be-8d65-9ed354de2ee6", "data-blockingmode": "auto" }, - { id: "CookieDeclaration", src: "https://consent.cookiebot.com/a0cc864f-0b67-49be-8d65-9ed354de2ee6/cd.js" } + { + src: '/contrast/gtagman.js', + async: true, + "data-cookieconsent": "ignore", + }, ], // Even if you don't use internalization, you can use this field to set useful @@ -56,10 +59,6 @@ async function createConfig() { theme: { customCss: require.resolve('./src/css/custom.css'), }, - gtag: { - trackingID: 'G-3DVYB2CHLG', - anonymizeIP: true, - } }), ], ], diff --git a/docs/package.json b/docs/package.json index 546c8b0499..f408e04cff 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,6 @@ "dependencies": { "@cmfcmf/docusaurus-search-local": "1.2.0", "@docusaurus/core": "3.6.1", - "@docusaurus/plugin-google-gtag": "3.6.1", "@docusaurus/preset-classic": "3.6.1", "@docusaurus/theme-mermaid": "3.6.1", "@mdx-js/react": "3.0.1", diff --git a/docs/static/gtagman.js b/docs/static/gtagman.js new file mode 100644 index 0000000000..57bf6717a5 --- /dev/null +++ b/docs/static/gtagman.js @@ -0,0 +1,5 @@ +(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','GTM-NF9NM7V');