Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

GA not tracking logged in users, GTAG user_id seems to require a different syntax now #197

Open
keyvanm opened this issue Oct 6, 2021 · 4 comments · May be fixed by #226
Open

GA not tracking logged in users, GTAG user_id seems to require a different syntax now #197

keyvanm opened this issue Oct 6, 2021 · 4 comments · May be fixed by #226

Comments

@keyvanm
Copy link

keyvanm commented Oct 6, 2021

Hi,

Thank you for this library! I've been using this for Google Analytics but having trouble loading user-id information there.

It seems like per Google documentation the code required to send user_id information looks like this:

gtag('config', 'G-XXXXXXXX', {'user_id': 'USER_ID'});
gtag('set', 'user_properties', { 'crm_id' : 'USER_ID' });

What the library renders is this:

gtag('set', {'user_id': 'USER_ID'});
gtag('config', 'G-XXXXXXXX');

Perhaps this is not sending the user id to GA properly? If you think this is the case, I can happily submit a PR to address this.

@keyvanm
Copy link
Author

keyvanm commented Oct 7, 2021

Ok, so I just had to wait for the data to show up in GA. Is there any way to send custom variables to GA? The current implementation doesn't seem to support it. I can submit a PR to address this. I can update to the new syntax according to the latest docs too while at it.

@bittner
Copy link
Member

bittner commented Dec 23, 2021

Sure, feel free to submit a PR to fix the implementation. Thank you!

@bittner
Copy link
Member

bittner commented Jul 13, 2022

This problem seems to be related to #189. Can you confirm?

@PetrDlouhy
Copy link
Contributor

PetrDlouhy commented Jul 14, 2022

I can confirm, that setting user_id works without the user_properties being set. At least according to my User-ID Coverage view, where it shows about 30% coverage.

Setting the additional variables might be a good idea. The provider can take it from the context.

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

Successfully merging a pull request may close this issue.

3 participants