diff --git a/src/client/helpers/helpers.js b/src/client/helpers/helpers.js index 1f615609392f86619400dcefc3947816019475d4..9156ce854fa91ff7b573066ebbf41daeded9b85e 100644 --- a/src/client/helpers/helpers.js +++ b/src/client/helpers/helpers.js @@ -314,8 +314,10 @@ export const usePageViews = () => { const location = useLocation() useEffect(() => { if (typeof window.ga === 'function') { - console.log(window.ga) - window.ga.send(['pageview', location.pathname]) + // https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications#tracking_virtual_pageviews + // note: the ga function has been initialized in index.html + window.ga('set', 'page', location.pathname) + window.ga('send', 'pageview') } }, [location]) }