How to track dropout on first screen before tracking consent - firebase

It is known that users must explicitly consent the use of tracking tools like Google Analytics, Firebase etc. by the app, I am wondering if it possible to track dropouts on the first screen since as I understand analytics tracking can only be activated once the user allowed this when starting the app for the first time. I would like to know if there are users that exited the app on the first screen before consenting the tracking and decided to uninstall the app after that.

Google Analytics for Firebase provides an API for disabling Analytics collection temporarily before getting a user consent
setAnalyticsCollectionEnabled(true);
You can log this as a event with int parameters 0 and 1 (or any other way you may want). Basically giving you the control and visibility of what you are looking for here.

Related

GTM consent mode Google analytics not tracking pageviews without consent

we have recently implemented cookies consent mode in Google tag manager. Pageviews in google analytics (both universal and GA 4) dropped to about 4 % of the original page views.
When I visit the web page without giving any consent some requests to google-analytics.com still appears in network tab. This tells me something is still tracked. No cookies are saved as expected.
Do you have a different experience? Should GA track pageviews anonymously even without consent or it this a correct behavior? Why would analytics script send any requests if it not appears in GA?
It is expected that you see requests to Google Analytics. However in consent mode you should not see _ga cookies being set (or existing _ga cookies being used). That's basically what consent mode is, cookie-free tracking. You should also see a parameter gcs=100 in the GA request to confirm that consent mode is indeed active.
However these requests are not surfaced in the reports (there would be no point, since without user identifier you cannot create sessions). Apparently they are being used for some sort of Machine Learning thing in the background, but I don't think this has much effect on the analytics part of GA (afaik this is more for Google Ads and GA audiences).
So yes, seeing requests in consent mode is normal (if this helps in any way with GDPR compliance etc. in entirely another matter). If you do not run campaigns and do not hope for an uplift via ML models applied to consent mode data, then you probably do not need to bother and can just disable the tags if no consent is given.
It happens because you have to set ad_storage and analytics_storage as denied by default in initialization code, like described in the documentation (in the example only ad_storage is denied, just add analytics_storage too): https://developers.google.com/tag-platform/devguides/consent#implementation_example

Does Google Analytics 4 (GA4) have session unification?

Universal Analytics has a setting (toggle) to enable session unification. This allows for events fired prior to the user logging in to be associated with that user's session. (During log in the Custom User Id (uid) is provided to enable this.)
However, I am unable to find this feature on Google Analytics 4 (GA4). Is this feature enabled by default? Or is this no longer supported? I have read almost all GA4 documentation, but unfortunately it is still pretty limited at the time of writing this.
Thanks!

How Does Firebase Analytics count New Users in Web App

We have a web app that users log into using Firebase Auth. According to our the authentication section of our firebase console, we have 690 user that have created accounts, and we believe that is correct.
According to our Firebase Analytics console, we have 2,100 new users in the past 90 days. I think I understand that Firebase Analytics tracks users with a device ID (?). So, if this were a iOS app, an uninstall and install would trigger a a new user counted in analytics. But, how does this work on a web app? Cookie? Some kind of browser id? A session?
So, I think if we want to track unique users accurately, we would use the set the user id, with this:
https://firebase.google.com/docs/reference/js/firebase.analytics.Analytics#setuserid
Which according to the docs linked above, 'Use gtag 'config' command to set 'user_id'. So it does this: https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#set_user_id
Which allows the users to be tracked across sessions. Therefore, users should not double count.
Notice that the setUserId section in the firebase analytics docs does not have a web section (although the setUserID function does exist in the javascript sdk as shown tow links above) https://firebase.google.com/docs/analytics/userid
So... would it then work to get the user id (uid) when they log in (https://firebase.google.com/docs/reference/js/firebase.User). And then use the setUserId method to set the id?
It's unclear because the documentation does not seem to be in one source. I am just trying to put it all together
You are correct that you can use the setUserId API (across iOS, web and Android) in order to identify the same user across platforms. Note that you'll need to:
Set the default reporting identity to "By User-ID then Device" in the Reporting settings for Google Analytics in the Firebase console (see attached screenshot and docs for more info).
Make sure you are following the Privacy Policy when using the User ID.

How can you prevent fake events in firebase analytics

I've recently set up Firebase Analytics with my website. I was beginning to add some events to be logged and realized any arbitrary event could artificially be called. I could just go into my browser's console and run the command firebase.analytics().logEvent('some_fake_event').
If you know a website is using firebase analytics, what's to stop you from simply spamming fake events into your console? The website owner's analytics would become fairly screwed up. Also, firebase mentions that there's a 500 event-type limit. One could also run firebase.analytics().logEvent('fake_event_1'), firebase.analytics().logEvent('fake_event_2'), etc. Oops, the website owner can't create any more new (legitimate) event types.
What is in place to prevent this?
The logEvent method will be available once you rely on standard firebase SDK. The only way to prevent this would be to obfuscate the library you're using.

Google Calendar: limit API access to a single calendar?

I'd like for my app to add/delete/update events on a user's Google Calendar. The app only needs to delete and update events that the app itself has added.
Have I understood it correctly, that in order for this to work, the users have to give the app full access to their Google Calendars, meaning that the app could potentially read and delete private events on any calendar?
Or, is there a way to limit the access that a user gives to the app, for example, allowing the app to create a single calendar and only giving it access to events on that one calendar?
I've read through the relevant Google Calendar API, and I'm not seeing that this is possible. However, giving full access seems crazy and unnecessary!
It seems that this isn't possible. Google, why!?
What I ended up doing was skipping the API and using a calendar subscription. Limited use since the user needs to be able to set up a subscription and, especially, because Google takes up to a day to update subscribed calendars.

Resources