From 9c98f11ecfe82ba6c5bc24224bd2713b4a98010f Mon Sep 17 00:00:00 2001 From: Honore Hounwanou Date: Thu, 18 Jan 2024 10:07:19 -0500 Subject: [PATCH] Add Google Analytics support --- docs/assets/js/google-analytics.js | 10 ++++++++++ mkdocs.yml | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 docs/assets/js/google-analytics.js diff --git a/docs/assets/js/google-analytics.js b/docs/assets/js/google-analytics.js new file mode 100644 index 0000000..54ed48b --- /dev/null +++ b/docs/assets/js/google-analytics.js @@ -0,0 +1,10 @@ +var gtag_id = "G-3XLJELJ2TF"; + +var script = document.createElement("script"); +script.src = "https://www.googletagmanager.com/gtag/js?id=" + gtag_id; +document.head.appendChild(script); + +window.dataLayer = window.dataLayer || []; +function gtag(){dataLayer.push(arguments);} +gtag('js', new Date()); +gtag('config', gtag_id); diff --git a/mkdocs.yml b/mkdocs.yml index 379083b..11dd37b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,6 +30,9 @@ theme: features: - navigation.expand +extra_javascript: + - assets/js/google-analytics.js + markdown_extensions: - admonition - markdown_include.include