codler / react-ga4

React Google Analytics 4
https://www.npmjs.com/package/react-ga4
266 stars 34 forks source link

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

Open AceGentile opened 1 year ago

AceGentile commented 1 year ago

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

radixdt2501 commented 1 year ago

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

arisyo13 commented 1 year ago

This should be definitely merged

jpyoda commented 1 year ago

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

ihorbond commented 7 months ago

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