fix: include search in ga page event
This commit is contained in:
parent
3e57793406
commit
7c4578edfe
1 changed files with 3 additions and 8 deletions
|
@ -91,15 +91,10 @@ analytics.pageView(window.location.pathname + window.location.search);
|
||||||
// Listen for url changes and report
|
// Listen for url changes and report
|
||||||
// This will include search queries
|
// This will include search queries
|
||||||
history.listen(location => {
|
history.listen(location => {
|
||||||
const {
|
const { pathname, search } = location;
|
||||||
pathname,
|
|
||||||
// search
|
|
||||||
} = location;
|
|
||||||
|
|
||||||
// TODO: include search query somehow but not in the page name
|
const page = `${pathname}${search}`;
|
||||||
// Google analytics separates those into different pages
|
analytics.pageView(page);
|
||||||
// const page = `${pathname}${search}`;
|
|
||||||
analytics.pageView(pathname);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default analytics;
|
export default analytics;
|
||||||
|
|
Loading…
Add table
Reference in a new issue