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:

  1. 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 the user_id datalayer variable.

  2. Now, when a user logs in to my apps, I push user_id to the datalayer.

  3. 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:

  1. When I login to the website, I see a message trigger in tag assistant, that shows that the user_id being pushed to the datalayer.
  2. When I look in the debug view of the GA, I see the user id being passed.

enter image description here

  1. 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?)

enter image description here

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

enter image description here

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.