UserID returning (not set) (Google Analytics) - firebase

Inside the reports for some of the custom events we have setup, the User_ID is set to 0/(not set), and if we do a comparison with "all users" and "Signed in with UserID" there is a difference. Thus some users are able to trigger the event without having a UserID? Which should not be possible because these events are triggered after login and the assigning of userID is assigned at login?
What possible reason could the UserID be set to 0 or (not set)?
await analytics().setUserId(internalUserID);
Additional Information:
We use: '#react-native-firebase/analytics'
Tested locally via GA debug view and the userID is assigned everytime

There was an edge case where the setUserId was bypassed

Related

User's google calendar ID changes when primary email is updated

Essentially I've noticed that when a user's primary email is updated on their google account, their calendar ID will also change (e.g. ID will change from john#company.com to john_new#company.com).
This is a problem because I work on an application that relies on the calendar ID being a stable identifier for users. For example, lets say user A at a company schedules an event to their calendar through my application. We'll save metadata related to that event in our own database along with user A's calendar ID to denote that the event was scheduled to that calendar. This is important because we use this information to ensure that only users with write access to this calendar ID can edit this event from our application (important for security purposes).
Lets say user A gets their primary email updated, which causes their calendar ID to also change. Now, when I query the CalendarList endpoint to get a list of user A's calendars, I get back the new calendar ID, which makes my application think that user A should not have access to edit the event they just scheduled since that event was scheduled to a calendar ID that user A no longer has access to.
Is there a way around a problem like this? I can't find an endpoint that will return user A's "archived" calendar ID in addition to their new one. More deeply, I don't understand why their calendar ID changes as it feels like IDs should be stable identifiers...
In this case, by testing and working with the calendar API and Google Workspace it's a fact that the Calendar ID will always be the email address of the user account it’s associated with. I wish there was actual documentation but this is only from testing that I have verified this. There are other threads that explain the same, in this case with your situation you should modify your app in a way that the CalendarID is not based in a stable ID, as this depends on your email address.

Built-in user-id status is set to "Unassigned" in predefined user id view

If I apply a session-based custom segment defined as user-id status matches exactly "Unassigned" in the standard user-id view the segment is matched by several sessions / users.
Since the user id view should only encompass sessions where the user id is set this shouldn't be the case.
I can't find any proper documentation on how the built-in dimension user-id status gets populated, but I would assume that it is derived from the uid parameter sent with the server calls.
How can the value of dimension user-id status ever be "Unassigned" within the user id view?
Taking the reversed segment defined as status=Assigned there are users that never had a userid assigned to them and are still in the user-id view.
How can user without an assigned userid be part of the user-id view?
Side note:
Implemented via GTM
Session Unification is active
user-id status is a Google-intern dimension automatically created when setting up the userid feature.
Unassigned is not a value GA would set (when a value is not defined in GA it is set to (not set)), **so if it's there it's because someone set it.*
Now with regards to your segment, the question you are asking GA is:
give me users who during ANY session had status=Unassigned
this includes sessions prior to identification because Session Unification is active
So anybody who had status=Unassigned at some point and then identified will match that segment.
If you want to know users who have status=Unassigned as their latest status you want to make sure your custom dimension is set to User Scope and that you replace Sessions Include with Users Include in your filter.

Firebase + Tag Manager: Fetch variable from previously sent event

With the previous version of Tag Manager (dataLayer), it was easy to fetch variables sent within previous events, when those variables weren't sent with the current.
How to persist parameters with the Firebase version of GTM?
For example, previously, I could send an event with a user_id variable at the start of the session or as soon as the user logs in. I would then create a "Data Layer Variable" in GTM and use it to get this user_id at any subsequent point in the session. For instance, to send it as a GA custom dimension on a purchase event possibly made later.
Now, if I push a Firebase event with a custom parameter user_id and then create an "Event Parameter" variable in GTM, it will only be available within this event.
Same if I send a user property with Firebase and register a "Firebase User Property" variable in GTM. I won't be able to use this variable within an event at a later point in the session
Is there a way to persist user properties and event parameters?
Unfortunately, we all miss the data layer like approach.
I got a confirmation that the only way to "persist" data between events using Firebase SDK is to use user properties, which function like "sticky" events within Firebase. Otherwise, the parameter would need to be sent anew with a future event.
Combined with a limitation of only sending string and numbers but not dictionaries makes this a bit less convenient.

sending offline measurment data - does cid have to match the original cid?

I need to send a cart status update based on an offline activity. My customers will add items to their cart online via the website but the final checkout and purchase happen offline.
Here is my question: In the example below, a checkout step is updated. Does the client_id provided in this step have to match the original client_id used when the web user started their cart originally?
Measuring Checkout Options
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
**&cid=555 // Anonymous Client ID.**
&t=event // Event hit type
&ec=Checkout // Event Category. Required.
&ea=Option // Event Action. Required.
&pa=checkout_option // Product action (checkout_option).
&cos=2 // Checkout step.
&col=FedEx // Checkout step option.
Client ID is how Google Analytics tracks each individual user throughout their multiple sessions. So, yes- if you want that payload to be associated with the same user, then the CID will need to match- otherwise you'll be artificially inflating your user count (as well as severing the contextual data from that user).
You can parse the cookie that GA stores in the browser to obtain the CID and then fill it there. Not sure what language you're writing in, but there are plenty of snippets out there for parsing the GA cookie. You could also store the CID when it is initially generated in your own session data to be used later while offline. For example:
ga(function(tracker) {
var clientId = tracker.get('clientId');
console.log(clientId);
});
You could also provide your own CID from the start that you generate yourself and tell Google Analytics to use. This might be overkill for your situation, but I wanted to mention it as an option.

1st party cookie and user session/visit activity google tag manager

I am new to GA & GTM. I want to track users session/visit activity like page views,document download etc. whatever activity user performs during the session/visit. In Omniture I do activity using evar variable. How can I do the same with GA & GTM.
Going through the document on internet I tried to do this using 1st party cookie variable in GTM. but it is not working. when i see the value for cookie variable it showing undefined and also for return type.
A
You don't need to set a 1st party cookie as GA will do this itself when you put the tag on the website. Its a lot less setup and has more metrics out of the box than Adobe Analytics. In an aggregated fashion the activites you mention can be tracked via event tracking.
If you are looking to also track this on an individual level, then also set a user custom dimension or the userId parameter unique for each user. This will then be associated with the out of the box metrics as above, that you can access via a custom report.
Logical for your question is:
When users authenticate, the user ID should be stored in dataLayer
When subsequent Universal Analytics tags are fired, the &uid key
should first check if the User ID is in dataLayer
If it is, then a cookie is written in the user’s browser with this
User ID, and finally the value is returned to the tag
If the User ID is not in dataLayer, GTM checks if it’s stored in a
cookie, and if it is, the cookie value is returned
If there is no such cookie, nothing is returned and the User ID
parameter will not get sent
Check this post

Resources