I am very new to GA tracking. In a project that I am working on, I have implemented user_id tracking using GTM. The configuration looks like this:
Firstly I create a GA4 configuration tag in GTM with the GA measurement id. It also contains
user_id
in 'Fields to set', which is set the theuser_id
datalayer variable.Now, when a user logs in to my apps, I push
user_id
to the datalayer.I also have created a bunch of GA4 event tags the uses the GA4 configuration tag. Those events are configured to the fired when I push those events to the datalayer.
When I try to test this configuration using tag assistant
locally or in staging version of my app, everything seems to be working fine. The way I verify this is by doing the following:
- When I login to the website, I see a
message
trigger intag assistant
, that shows that theuser_id
being pushed to the datalayer. - When I look in the
debug view
of the GA, I see the user id being passed.
- And, finally, in the event that comes after the user_id is pushed to the datalayer, I can see the
user_id
property in the "User Properties" tab. (I cannot see any user_id in "Parameters" though, which I think is not an issue, isn't it?)
So, after these verifications I was confident that the user_ids will be tracked properly so I published these changes.
But there is an issue. You see, there are some GTM custom events that should never fire before the user logs in to the website and the user_id
has been pushed. But when I look into the events
report in under Life Cycle
-> Engagement
, I see that none of those events have been triggered by user that have user_id
I am very lost on why this might have occured. If all of the steps I mentioned above is current and the way that I have verified user_id being sent to GA is also fine, then I do not see any way that this can happen (besides my codebase having some bugs, that this causing this event to be fired before user_id is pushed to datalayer, which I have verified many time locally and on staging).
Am i missing anything? Is there an additional ways to debug this that I have not metioned here. Thanks.