Learn business growth with Google Analytics 4 Forums Google Analytics 4 Exploring Solutions for Ending Sessions in Google Analytics 4

  • Exploring Solutions for Ending Sessions in Google Analytics 4

    Posted by Mia on 3 October 2022 at 11:34 am

    So, imagine I’m putting together a self-service ticket terminal app for a train station (it’s a web app). I want to use Google Analytics to keep tabs on how users interact with it. Thing is, loads of different people will be using the same device. This means that the reports from Google Analytics aren’t going to show the true number of users. A possible fix could be to reset the GA session each time a user finishes a transaction.

    In the past, Universal Analytics supported this with its sessionControl feature. But, I can’t seem to find anything like it with GA4.

    I’ve had a go at kick-starting the session_start event to do it manually. It’s popping up on the dashboard but doesn’t seem to have an impact on the internal gtag state. So, all the following events are still linked to the previous session. This means that the “session count” and “engaged sessions count” is still off in the GA dashboard.

    Can anyone tell me if there’s a way to manually end a session in GA4? Or, failing that, any other solutions for this particular situation that I could delve into?

    Ava replied 1 year ago 3 Members · 2 Replies
  • 2 Replies
  • Alexander

    Member
    28 February 2023 at 6:34 pm

    Google Analytics 4 (GA4) does not currently have a built-in way to manually end a session like its predecessor, Universal Analytics, did. Sessions in GA4 are automatically ended after 30 minutes of inactivity or at midnight local time. While it’s possible to manually start a session using the session_start event, this doesn’t directly affect the session state in GA4 — it really only logs the event. For your specific situation with multiple users on a single device, you might consider alternative solutions since GA4 can’t manually end sessions. One possible workaround could be to use a unique user identifier for each transaction or interaction, so that each user on the terminal is considered separate regardless of the session count. It’s important to note though any solution might need some technical implementation and testing to ensure it provides the data you need.

  • Ava

    Member
    5 April 2023 at 12:05 am

    Google Analytics 4 (GA4) handles sessions differently from Universal Analytics. In GA4, there is no explicit way to manually end a session since it is based on an automatic algorithm. A new session is started after 30 minutes of inactivity, or at midnight local time and there is no built-in way to manually reset this.

    You might want to consider other workarounds to get the insights you need:

    1. User Pseudonymization: One possible solution could be to assign a unique pseudonym or ID to each user and send it as a user_id parameter with each event.

    2. Event Customization: If you need detailed tracking for each transaction, you could create and track custom events for each step of the process. This would give you visibility into each user’s journey, regardless of whether it is technically considered as one session or multiple.

    3. Cohort Analysis: GA4 has the ability to group users together with shared characteristics (e.g. transaction completed) with its Cohort analysis feature. This might provide the insights you need.

    Be sure to comply with Google Analytics’ Terms of Service and any relevant data privacy laws and regulations if considering pseudonymization.

Log in to reply.