1
0
Håvard O. Nordstrand 5 жил өмнө
parent
commit
2121f05c41

+ 2 - 0
_includes/google_analytics.html

@@ -1,4 +1,5 @@
 <!-- Global site tag (gtag.js) - Google Analytics -->
+{% if site.google_analytics and jekyll.environment == 'production' %}
 <script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics }}"></script>
 <script>
   window.dataLayer = window.dataLayer || [];
@@ -7,3 +8,4 @@
 
   gtag('config', '{{ google_analytics }}');
 </script>
+{% endif %}

+ 2 - 0
_includes/header.md

@@ -1,3 +1,5 @@
+{% include analytics.html %}
+
 # {{ site.name }} / {{ page.title }}
 {:.no_toc}
 

+ 0 - 3
_layouts/head.html

@@ -1,3 +0,0 @@
-{% if site.google_analytics and jekyll.environment == 'production' %}
-{% include analytics.html %}
-{% endif %}