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

What's the difference between payload.userId and instance.user('userId')? No way to reset google-tag-manager userId property #399

Open
benjamindulau opened this issue Aug 22, 2023 · 1 comment

Comments

@benjamindulau
Copy link

benjamindulau commented Aug 22, 2023

I don't quite understand where the payload.userId comes from here https://github.com/DavidWells/analytics/blob/master/packages/analytics-plugin-google-tag-manager/src/browser.js#L81

Problem is once you called identify with a non null userId, there is absolutely no way to set it back to null. Neither calling identify() again without an userId nor calling analytics.reset() have any effect on this.

Every subsequent calls to track include a stale userId property...

What code is responsible of setting this userId property in the payload object? And why is this plugin using this instead of instance.user('userId')? What's the difference between the two?

Thanks :)

@benjamindulau
Copy link
Author

Well it seems that calling reset() or identify() or identify(null) does not clear instance.user('userId') either...
I give up, I don't understand what is the recommended way to handle the user identification there.

user.traits are correctly overridden, but I don't find any way to clear the user.userId property..

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

No branches or pull requests

1 participant