aboutsummaryrefslogtreecommitdiff
path: root/_includes/google-analytics.html
diff options
context:
space:
mode:
Diffstat (limited to '_includes/google-analytics.html')
-rw-r--r--_includes/google-analytics.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html
new file mode 100644
index 0000000..b8b4d38
--- /dev/null
+++ b/_includes/google-analytics.html
@@ -0,0 +1,9 @@
+<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
+<script>
+ window['ga-disable-{{ site.google_analytics }}'] = window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1";
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){window.dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', '{{ site.google_analytics }}');
+</script>