Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
Google analytics - Store event when GA session ends?

Is it possible to tell Google Analytics to do something when the user's session ends? (NOT a local session, but a Google Analytics session).

According to this: https://support.google.com/analytics/answer/2731565?hl=en#zippy=%2Cin-this-article the session has a timeout of 30 minutes of inactivity, which means it's something that happens on Google's server. Can I tell it to track an event after this session has ended using javascript custom events?

I want to track the user's progress after the user has left the website/session has ended. I want to avoid flooding the analytics with an event every time the user progresses to the next part of the quiz.

I want something like

on_analytics_session_end({
 ga('send', {
  hitType: 'event',
  eventCategory: 'Progress',
  eventLabel: 'Quiz: ' + quizNumber,
 });
});

I can't find anything that allows you to hook onto a session ending.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You're approaching it backwards.

First, you have to indicate whether you're on GA4 or GA UA. From the usage of the ga() function, I guess that we're using UA here.

UA changes session in all kinds of weird scenarios like IP change (when you're traveling while on a phone, for example) or when your source/medium change. Or sometimes even when your resolution changes. Catching all that with JS would be pretty hard, and certain things won't be caught for sure. Therefore, no sending events with JS.

You could theoretically run timed function that would check the time of inactivity, and you also can override the onbeforeunload() to send a quick event if a tab is closed or navigated from, but that has little to do with session end tracking as UA defines it.

The proper way of doing it is via building funnels in GA that would start from quiz start and end with quiz end, having all the in-between pages listed for analysis. That will give you the drop-off on every page. Or just use the exit pages report.

If you need to conduct even deeper analysis, then we typically go away from GA interface by exporting the data to BQ, and then either solve your analytics tasks with SQL, or ETL the data from BQ, enriching it and generating fake events to indicate every session end. I've seen a lot of custom GA data ETL and data enriching, but I never seen anyone needing a generated event to indicate session end. Usually the session id dimension solves a lot of session-related quesions, especially in SQL, where you can just count unique session ids where/by/having whatever and so on.

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda