React-ga: Custom dimensions in pageview

Created on 28 May 2018  路  3Comments  路  Source: react-ga/react-ga

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',
});

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:

ReactGA.pageview('/valid', ['baz']);

ReactGA.pageview({
  path: '/valid',   /// required
  dimension1: 'dog',  // optional
}, ['baz']);

All 3 comments

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');

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dirtyredz picture dirtyredz  路  7Comments

olalonde picture olalonde  路  3Comments

horaceleung picture horaceleung  路  6Comments

199911 picture 199911  路  6Comments

nicolasiensen picture nicolasiensen  路  7Comments