From 7c4578edfef0b1049aba3eee57cb66708255bfc9 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sun, 14 Apr 2019 23:49:50 -0400 Subject: [PATCH] fix: include search in ga page event --- src/ui/analytics.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ui/analytics.js b/src/ui/analytics.js index 27845420f..9e5068c57 100644 --- a/src/ui/analytics.js +++ b/src/ui/analytics.js @@ -91,15 +91,10 @@ analytics.pageView(window.location.pathname + window.location.search); // Listen for url changes and report // This will include search queries history.listen(location => { - const { - pathname, - // search - } = location; + const { pathname, search } = location; - // TODO: include search query somehow but not in the page name - // Google analytics separates those into different pages - // const page = `${pathname}${search}`; - analytics.pageView(pathname); + const page = `${pathname}${search}`; + analytics.pageView(page); }); export default analytics;