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); }