We should have the ability to track custom dimensions not just with an even but also with a pageview:
ReactGA.pageview(window.location.pathname, {
dimension1: 'my-custom-dimension-value',
});
Because the second parameter to pageview() is a list of trackers to use, I propose the following variable syntax where the first parameter is either a string (for compatibility) or an object:
ReactGA.pageview('/valid', ['baz']);
ReactGA.pageview({
path: '/valid', /// required
dimension1: 'dog', // optional
}, ['baz']);
Hello! Same issue here, any update on this?
These steps worked for me.
ReactGA.set({ dimension1: 'dimension1Value' });
ReactGA.pageview('/my-page-url', undefined, 'My Page');
Most helpful comment
Because the second parameter to pageview() is a list of trackers to use, I propose the following variable syntax where the first parameter is either a string (for compatibility) or an object: