ga integration buggood first issue
描述
Hi all, in my React App I use ReactGA.initialize and ReactGA.pageview on the first page rendered and ReactGA.pageview on every route change.
If I open my react application in a route different from the root, like this one:
/my-folder
GA Debug returns me in console:
location: http://myreactapp.com/my-folder
page: /my-folder
On every following route change, the page value changes correctly its value, but the location doesn't change, like this:
location: http://myreactapp.com/my-folder
page: /my-second-route-folder
---
location: http://myreactapp.com/my-folder
page: /my-third-route-folder
---
Is this correct? Or I have to update also the location in this way?
ReactGA.ga('send', {
hitType: 'pageview',
location: `${window.location.protocol}//${window.location.host}/`,
page: window.location.pathname,
});