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

fix: missing user id in ga4 forwarder plugin #948

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

liuyang1520
Copy link
Contributor

Summary

fix: missing user id in ga4 forwarder plugin

Tested with a local setup:
image

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

@liuyang1520 liuyang1520 requested review from kevinpagtakhan, Mercy811 and a team January 14, 2025 20:01
Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem is that the if condition is always false so that setUserId() is never called. Please see https://discourse.amplitude.com/t/ga4-events-forwarder-how-can-i-set-user-id-for-forwarded-event/15319/2.

@liuyang1520
Copy link
Contributor Author

I think the problem is that the if condition is always false so that setUserId() is never called. Please see https://discourse.amplitude.com/t/ga4-events-forwarder-how-can-i-set-user-id-for-forwarded-event/15319/2.

@Mercy811 Thanks for reviewing! I think the event.user_id will always be undefined since it is deleted in previous line, my understanding is when we see a new userId, we setUserId and update the lastSeenGAUserId, so I don't think amplitude.setUserId(event.user_id) is correct. lastSeenGAUserId should be set during the iterations, when we see a new userId but no lastSeenGAUserId. Let me know if I miss anything, haven't touch the SDK code for a long time 😄

Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @liuyang1520

@liuyang1520 liuyang1520 merged commit e1f2da7 into v1.x Jan 15, 2025
4 checks passed
@liuyang1520 liuyang1520 deleted the fix-missing-user-id-in-ga4-forwarder-plugin branch January 15, 2025 19:02
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 this pull request may close these issues.

3 participants