From 593d6e5fba9330142e47dd75a339a9d6f88d4878 Mon Sep 17 00:00:00 2001 From: Robert Austin Date: Wed, 13 Mar 2019 17:46:17 +1000 Subject: [PATCH] update ga --- _includes/google-analytics.html | 50 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html index 392024d..503058b 100644 --- a/_includes/google-analytics.html +++ b/_includes/google-analytics.html @@ -1,30 +1,28 @@ {% if jekyll.environment == "production" %} - {% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %} - {{ gid }} +{% assign gid = site.env.NETLIFY_GOOGLE_ANALYTICS_ID %} +{% if gid %} + + - +{% else %} +{% if site.google_analytics_id %} + + - {% else %} - {% if site.google_analytics_id %} - - - {% endif %} - {% endif %} + function gtag() { + dataLayer.push(arguments); + } + gtag('js', new Date()); + gtag('config', '{{ site.google_analytics_id }}'); + +{% endif %} +{% endif %} {% endif %} \ No newline at end of file