From 87bdb7ab4cf4c1d4faf35444d5137ae23c2c66aa Mon Sep 17 00:00:00 2001 From: Abhinav Adduri Date: Wed, 21 Jun 2017 14:30:14 -0700 Subject: [PATCH] truncating referrer --- views/partials/analytics.handlebars | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/views/partials/analytics.handlebars b/views/partials/analytics.handlebars index 4f6aaff9..3f7babc8 100644 --- a/views/partials/analytics.handlebars +++ b/views/partials/analytics.handlebars @@ -5,6 +5,13 @@ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', '{{{trackerId}}}', 'auto'); + + if (window.URL && document.referrer) { + ga("set", "referrer", (new URL(document.referrer)).origin); + } else { + ga("set", "referrer", ""); + } + ga('set', 'anonymizeIp', true); ga('send', 'pageview'); \ No newline at end of file