-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[No QA] Publish user_id with GTM events #55434
Conversation
@madmax330 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
import analytics from '@react-native-firebase/analytics'; | ||
import Log from '@libs/Log'; | ||
import type {GoogleTagManagerEvent} from './types'; | ||
import type GoogleTagManagerModule from './types'; | ||
|
||
function publishEvent(event: GoogleTagManagerEvent, accountID: number) { | ||
analytics().logEvent(event, {accountID}); | ||
Log.info('[GTM] event published', false, {event, accountID}); | ||
analytics().logEvent(event, {user_id: accountID}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use snake case here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_id
is the property we need to send for Google Tag Manger: https://developers.google.com/analytics/devguides/collection/ga4/user-id?client_type=gtm
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/madmax330 in version: 9.0.89-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.89-8 🚀
|
Explanation of Change
For cross device tracking, we need to set a
user_id
with our Google Tag Manager events. This will just be theaccountID
for the user.Fixed Issues
Part of #55292
Tests
sign_up
event is published with auser_id
set to the user'saccountID
:Offline tests
None
QA Steps
None
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
iOS: Native
MacOS: Chrome / Safari
MacOS: Desktop