From 6416172d1b217847135295dda91789c39e27b41e Mon Sep 17 00:00:00 2001 From: Chris Waring Date: Thu, 14 Feb 2019 14:19:13 +0000 Subject: [PATCH] do not track localhost activity --- src/layouts/partials/analytics.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/layouts/partials/analytics.html b/src/layouts/partials/analytics.html index 07529de..566b7de 100644 --- a/src/layouts/partials/analytics.html +++ b/src/layouts/partials/analytics.html @@ -1,8 +1,10 @@ \ No newline at end of file + if (location.hostname !== 'localhost') { + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'UA-96910779-8'); + } +