Search code examples
google-analyticsgoogle-tag-managergoogle-analytics-4

Login Status Tracking in GA4


As you know GA4 divides tracking into events & user attributes, and currently has no "session-based" tracking as far as I know. I would like to see if a user came to the site as login or a guest, and then track the status of the session if its guest or logged in. The status will change if the user is logged in to True, and if not will stay False. In UA, it was possible through adding a pseudo event with a parameter or a virtual page view however couldn't figure out how to achieve this in GA4. Should it be done the same way?

Setting a user attribute seems like not the correct way as "login_status" does change throughout the session, guess this is not the appropriate way of tracking?

Should we send a custom parameter to every page_view (or virtual_page_view) and send session-based parameters (custom dimensions) this way?


Solution

  • That's right, the best way is to send that information as an event parameter.

    Also in Universal Analytics the tracking of a user's login status had to be carried out either with events or with custom dimension at the hit level, in this way it was possible to understand his behavior as logged in and logged out within the same session. By sending the information at the session level, however, this detail would have been lost.

    So even in GA4 the concept remains the same.