react-ga4 icon indicating copy to clipboard operation
react-ga4 copied to clipboard

ga4: make "set [string] [object]" requests work

Open AceGentile opened this issue 2 years ago • 5 comments

gtag set command can have two sets of params:

gtag('set', <object>)
gtag('set', <string>, <object>)

the latter doesn't work because of some checks in set() method requiring the first parameter to be always an object. This breaks some user-scoped custom dimensions like this one:

gtag('set', 'user_properties', {
  favorite_composer: 'Mahler',
  favorite_instrument: 'double bass',
  season_ticketholder: 'true'
});

This should fix https://github.com/codler/react-ga4/issues/34

rif. https://support.google.com/analytics/answer/12370404

AceGentile avatar Jun 15 '23 09:06 AceGentile

When are we planning to merge this ? @codler @AceGentile

radixdt2501 avatar Jun 27 '23 15:06 radixdt2501

This should be definitely merged

arisyo13 avatar Jun 29 '23 12:06 arisyo13

Any workaround? Been a while and branch has not been merged.

jpyoda avatar Jul 01 '23 17:07 jpyoda

@codler why make a package you don't intend to maintain ? People spend their time to write code and submit PRs too.

ihorbond avatar Feb 09 '24 19:02 ihorbond