Add more analytics

This commit is contained in:
Tim Byrne 2019-11-13 02:55:17 -06:00
parent 49e754ace1
commit e32521fb5e
No known key found for this signature in database
GPG Key ID: 14DB4FC2465A4B12
5 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,7 @@ analytics:
provider: google-universal
google:
tracking_id: UA-83783540-1
gtm: GTM-55MC869
# Site Author
author:

View File

@ -2,3 +2,4 @@
url: http://localhost:4000
analytics:
provider: false
gtm: false

6
_includes/body.html Normal file
View File

@ -0,0 +1,6 @@
{% if site.gtm %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ site.gtm }}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}

View File

@ -0,0 +1,13 @@
<!-- start custom head snippets -->
{% if site.gtm %}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ site.gtm }}');</script>
<!-- End Google Tag Manager -->
{% endif %}
<!-- end custom head snippets -->

View File

@ -16,6 +16,7 @@
<body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">
{% include body.html %}
{% include_cached browser-upgrade.html %}
{% include_cached masthead.html %}