summaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
Diffstat (limited to '_includes')
-rw-r--r--_includes/head/custom.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/_includes/head/custom.html b/_includes/head/custom.html
index 33b1508..def324f 100644
--- a/_includes/head/custom.html
+++ b/_includes/head/custom.html
@@ -1,3 +1,14 @@
<!-- start custom head snippets -->
+{% if site.google_analytics and jekyll.environment == 'production' %}
+ <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
+ <script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', '{{ site.google_analytics }}');
+ </script>
+{%- endif -%}
+
<!-- end custom head snippets -->