-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(analytics): add method to retrieve the app instance id from the … #5210
feat(analytics): add method to retrieve the app instance id from the … #5210
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/3aL7xezMzhjb4SVZspM1weTyWTrb |
8fe6c2a
to
98bf93c
Compare
Codecov Report
@@ Coverage Diff @@
## master #5210 +/- ##
==========================================
+ Coverage 88.87% 88.87% +0.01%
==========================================
Files 109 109
Lines 3744 3745 +1
Branches 360 360
==========================================
+ Hits 3327 3328 +1
Misses 370 370
Partials 47 47 |
Hi there! Thanks for this @gabrielbull - first let me say this is probably the cleanest first contribution I have ever seen, seriously, and that's a big help, thank you. I'm a bit new to the GA4 thing - it appears that this is the relevant explainer for how the instance id is used, am I correct in thinking so? https://support.google.com/analytics/answer/9213390?hl=en If so it appears that setting the user-id would bet the first way to identify a user across properties, and the app instance id will be used as a fall back in certain analytics configurations? And you want to retrieve it here in order to pass it to e.g. cloud functions (or really any non-app location where you also want to log events related to this user?) I think I'm understanding things but I want to make certain, and then I'll just re-read the docs and maybe add that link and a bit more explaining for anyone else coming at it with semi-fresh or totally fresh eyes, as I was Otherwise looks almost good to go - I just approved the CI workflows so they are chewing through it now |
98bf93c
to
3ec776a
Compare
Hi @mikehardy. It's actually a bit different than the link you sent. It is a required parameter for sending events to the Google Analytics Measurement Protocol. Here is a cool tool you can use to create events and validate them using the Measurement Protocol Validation Server. For my specific use case (there are infinite use cases I'm sure), I'm using a Stripe webhooks to send purchase/subscription events to GA and this allows me to see the revenue on GA. This can't be done on the frontend only as the subscriptions are renewed by Stripe automatically. I just noticed my PR failed ESLint due to an extra space, so I just removed it and force-pushed my fixed commit. I believe you have to trigger the workflows again unfortunately. |
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.
I thought about maybe putting more information (like a link to the doc you sent) explaining this would be needed for GA4 but I imagine since it's strictly required there and offered here with the obvious name that anyone who needs it won't have a feature discovery issue. So I think this is good to go right out of the gate and I learned some GA4 stuff. Great
Our CI has slowly fallen prey to entropy so it takes me a few attempts to get a clean run sometimes but this is marked for merge as soon as CI goes green and will go out as either v11.3.4 o whatever version is next. I literally just did a release tonight and I'd like to gather a bit more change before another, but knowing this will merge you should feel free to use the auto-generated patch-package set to integrate this locally until the new version comes out and you may evict them, if you don't already have a local patch installed - https://github.com/invertase/react-native-firebase/pull/5210/checks?check_run_id=2425065299 Thanks again |
Awesome news 🎉! |
Release 11.4.1 just went out with the change related to this among other fixes + features. Enjoy! 🚀 |
…service
Description
Added method to retrieve the app instance id from the service. This is necessary when triggering GA events from a backend using the Measurement Protocol.
Related issues
Release Summary
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Tested on both Android and iOS.
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter