Explorar el Código

Add Google Analytics

Håvard O. Nordstrand hace 5 años
padre
commit
b00bf86892
Se han modificado 2 ficheros con 11 adiciones y 0 borrados
  1. 2 0
      _config.yml
  2. 9 0
      _includes/google_analytics.html

+ 2 - 0
_config.yml

@@ -10,3 +10,5 @@ readme_index:
 
 optional_front_matter:
     remove_originals: true
+
+google_analytics_id: UA-154149655-1

+ 9 - 0
_includes/google_analytics.html

@@ -0,0 +1,9 @@
+<!-- Global site tag (gtag.js) - Google Analytics -->
+<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_id }}"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag(){dataLayer.push(arguments);}
+  gtag('js', new Date());
+
+  gtag('config', '{{ google_analytics_id }}');
+</script>