Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AceGentile
Copy link

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 #34

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

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

rif. https://support.google.com/analytics/answer/12370404
@radixdt2501
Copy link

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

@arisyo13
Copy link

This should be definitely merged

@jpyoda
Copy link

jpyoda commented Jul 1, 2023

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

Repository owner deleted a comment from jpyoda Dec 8, 2023
Repository owner deleted a comment from elamperti Jan 18, 2024
Repository owner deleted a comment from elamperti Jan 18, 2024
@ihorbond
Copy link

ihorbond commented Feb 9, 2024

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

@tri-surfaceai
Copy link

this comment is a workaround for me: #34 (comment)

and can be debugged through in GA > admin > data display > debug view > user properties active now

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting "user_properties" scope
7 participants