From cf59a6b9fd12ec37b4051f1bb7258913c6625d73 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Thu, 14 Jun 2018 06:50:08 +1000 Subject: [PATCH] whoops --- src/app/Router.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/Router.js b/src/app/Router.js index 0609a759..eb52d8df 100644 --- a/src/app/Router.js +++ b/src/app/Router.js @@ -259,11 +259,13 @@ Route.prototype.match = function(path, params) { */ function gaTrack(path) { const match = path.match(/\/outfit\/(.*)(\?code=.*)/); - if (match[1]) { - ReactGA.ga('set', 'contentGroup1', match[1]); - } - if (match[2]) { - ReactGA.ga('set', 'contentGroup2', match[2]); + if (match) { + if (match[1]) { + ReactGA.ga('set', 'contentGroup1', match[1]); + } + if (match[2]) { + ReactGA.ga('set', 'contentGroup2', match[2]); + } } ReactGA.pageview(path); }