From 0a15df730d92195dbd260829c41f239ba24cab9d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sat, 12 Dec 2020 19:17:21 -0600 Subject: [PATCH] Setup GA4 --- docs/javascripts/extra.js | 9 +++++++++ mkdocs.yml | 8 ++++---- overrides/main.html | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 docs/javascripts/extra.js create mode 100644 overrides/main.html diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js new file mode 100644 index 000000000..f77e8ab6e --- /dev/null +++ b/docs/javascripts/extra.js @@ -0,0 +1,9 @@ +app.location$.subscribe(function (url) { + window.dataLayer = window.dataLayer || []; + function gtag() { + dataLayer.push(arguments); + } + gtag("js", new Date()); + + gtag("config", "G-ZZKM4MPQXL"); +}); diff --git a/mkdocs.yml b/mkdocs.yml index 43de40639..7d49fd7b7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,13 +20,12 @@ extra: - icon: fontawesome/brands/github-square link: https://github.com/TRaSH-/Guides -google_analytics: - - G-ZZKM4MPQXL - - auto - extra_css: - stylesheets/extra.css +extra_javascript: + - javascripts/extra.js + markdown_extensions: - admonition - attr_list @@ -61,6 +60,7 @@ plugins: theme: name: material + custom_dir: overrides features: - navigation.instant - navigation.tabs diff --git a/overrides/main.html b/overrides/main.html new file mode 100644 index 000000000..9dc31a2ec --- /dev/null +++ b/overrides/main.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} + +{% block analytics %} + + +{% endblock %}