diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js index f77e8ab6e..c244dd294 100644 --- a/docs/javascripts/extra.js +++ b/docs/javascripts/extra.js @@ -1,9 +1,16 @@ -app.location$.subscribe(function (url) { +var gtag_id = "G-ZZKM4MPQXL"; + +var script = document.createElement("script"); +script.src = "https://www.googletagmanager.com/gtag/js?id=" + gtag_id; +document.head.appendChild(script); + +location$.subscribe(function (url) { window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } - gtag("js", new Date()); - gtag("config", "G-ZZKM4MPQXL"); + gtag("js", new Date()); + gtag("config", gtag_id); }); diff --git a/overrides/main.html b/overrides/main.html index d8da0d49e..8ac0c8d7d 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -1,10 +1,5 @@ {% extends "base.html" %} -{% block analytics %} - - -{% endblock %} - {% block content %} {{ super() }}