From 974f1b45285f58d780e33c4c2eb26085975c772e Mon Sep 17 00:00:00 2001 From: salad Date: Mon, 12 Sep 2022 15:46:09 +0300 Subject: [PATCH] feat: integrate google analytics for user metrics collection (#38) --- assets/static/js/project.js | 13 +++++-------- assets/templates/atoms/head.html | 7 ++++++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assets/static/js/project.js b/assets/static/js/project.js index 1ae95fb..e20da3e 100644 --- a/assets/static/js/project.js +++ b/assets/static/js/project.js @@ -36,14 +36,11 @@ function switchDashboards(event) { (function($) { - /* Google Analytics */ - window.dataLayer = window.dataLayer || []; - - function gtag() { - dataLayer.push(arguments); - } - gtag("js", new Date()); - gtag("config", "G-WW2W29ZMTZ"); + /* Google Analytics */ + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-6XRLBC4TMR'); // Auto-collapse open menus in responsive mode $(".navbar-collapse a").click(function() { diff --git a/assets/templates/atoms/head.html b/assets/templates/atoms/head.html index cd79179..3f650d3 100644 --- a/assets/templates/atoms/head.html +++ b/assets/templates/atoms/head.html @@ -29,13 +29,18 @@ {% endblock css %} + {% block javascript %} {% compress js %} {% endcompress %} - + + + + {% endblock javascript %} +