Sunday, September 26, 2021
No menu items!
HomeData Analytics and VisualizationTrying to Demystify user_engagement Event in Google Analytics 4

Trying to Demystify user_engagement Event in Google Analytics 4

If you are at least a little familiar with event tracking in Google Analytics 4, you already know that one of the automatically tracked events is called user_engagement. When exactly does it fire on a website?

After taking a look at the official Google Analytics documentation, you’ll see this: user_engagement fires periodically, while the app is in the foreground or the webpage is in focus.

“Periodically”. What does that even mean?

After digging here and there I still could not find a final and clear technical description of when does this event really fired. Therefore, I decided to do several experiments and see for myself. This blog post is the result of those tests.

Note: The list of tested situations (that I have identified) is not final. There should be more of them (I just haven’t figured that out (yet?)).

If you know additional details about this event, feel free to post a comment below the article and I’ll add some updates here.

 

Short version

If you don’t care about the details of my experiments, here are the key takeaways that I have noticed.

user_engagement is sent if there are at least two page_view events in the same session. Event fires before the redirect BUT only if the visitor has stayed at least for 10 seconds on the previous page. If I land on a page (start a new session), then go to the 2nd page after 5 seconds, user_engagement event will not fire. Once I stay longer than 10 seconds and do one more page_view, then user_engagement event will be sent to Google Analytics 4.
user_engagement event is sent to Google Analytics even on single-page-view sessions if a visitor stays for at least 10 seconds on a single page. But the event is sent only right before the tab/window is closed. I presume that beforeUnload is used here.
If a visitor lands on a page and a conversion event is sent on the very same pageview (but no other pages are viewed), user_engagement event is not sent to Google Analytics. (I just presumed that it might be because conversions are mentioned in the Engaged Sessions metric calculations).
Looks like in general other events (except page_view) don’t affect the user_engagement event. What matters is multiple page_views combined with minimal time on page. But there are still some unknowns. Continue reading.
Pretty often, user_engagement event fires once per session. HOWEVER, I have noticed some sessions where there are multiple user_engagement events. But I could not reproduce those situations myself whenever I wanted. Thus further investigation is needed.

 

Longer version

Let’s take a look at all experiments that I did. Again, I want to emphasize that there are more situations where user_engagement event might be sent from a website to GA4. I just haven’t found concrete evidence yet.

 

How experiments were conducted

GA4 events were sent to my server-side GTM endpoint. Then it forwarded data to GA4. I used SGTM debug mode to see the incoming requests and their parameters
I repeated each test several times to make sure that the results are consistent. They were.
All experiments were done in Chrome’s Incognito mode. Before every test, I completely closed all incognito windows to make sure that no first-party GA cookies remain from the previous session.

 

“seg” parameter

Every time a request is sent from your website to Google Analytics 4, you will notice a parameter called seg. It stands for “session engaged”. If its value is 1, the session is considered engaged by GA (and if I understand correctly, that session is then included in the engaged sessions metric).

Based on my trials, it looks like user_engagement event is sent to Google Analytics around the same time when the value of seg changes (or is about to change) from 0 to 1 (read “GA started treating the session as engaged”).

Then all the subsequent events of the same session continue having that seg=1 parameter.

 

Experiment #1

The flow of events that I tried:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
I did nothing for 20 seconds (no events were sent)
Click a link to go to the second page (user_engagement event is sent before the redirect). seg=1
I am redirected (page_view event is sent). seg=1

Result: user_engagement event fires when a session consists of more than 1 pageview.

But this got me thinking. What if the second pageview occurs in less than 10 seconds after the first pageview? I picked 10 seconds because it was mentioned as one of the components in the engaged sessions metric.

Let’s do another test.

 

Experiment #2

The flow of events that I tried:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
Then I clicked the menu as soon as I could to go to another page (in less than 10 seconds) (menu_click event sent). seg=0
The second page loaded (page_view event was sent. No user_engagement event was sent). seg=0

Result: user_engagement event fires when a session consists of more than 1 pageview. But a visitor must stay for at least 10 seconds on a single page. If a visitor navigates from one page to another every 5 seconds, the user_engagement event will not be sent to GA until the visitor stays on one page for at least 10 seconds. How do I know that? Enter experiment #3.

 

Experiment #3

The flow of events that I tried:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
Then I refreshed the page as soon as I could + as soon as GA4 loaded on a page (another page_view was sent). seg=1
The second page loaded (page_view event was sent. No user_engagement event was sent). seg=1
The third page loaded (page_view event was sent. No user_engagement event was sent). seg=1
The fourth page loaded (page_view event was sent. No user_engagement event was sent). seg=1
I stayed for 10+ seconds on the fifth page and then refreshed the page again (user_engagement was sent before the page reload). seg=1

Result: user_engagement event fires when a session consists of more than 1 pageview, BUT only if a visitor stays for more than 10 seconds on a page.

 

Experiments #4, #5, and #6

The results of these three experiments were the same. Basically, I wanted to check what happens if a visitor actually manages to do something on a website in less than 10 seconds after the page_view (except for another page_view).

The flow of experiment #4:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
Scrolled down (several customized scroll events were sent). seg=0
Close the browser tab in less than 10 seconds after the first page_view (user_engagement event was not sent). seg=0

The flow of experiment #5:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
Did nothing
Close the browser tab in less than 10 seconds after the first page_view (user_engagement event was not sent). seg=0

The flow of experiment #6:

Landed on a page (page_view, first_session, session_start events were automatically sent). seg=0
An event (that is marked as conversion in the GA4 interface) was sent
Close the browser tab in less than 10 seconds after the first page_view (user_engagement event was not sent). seg=0

Results: user_engagement event does not fire if a visitor does not spend less than 10 seconds on a page.

 

There are still some unknowns

I sometimes notice that a session has several user_engagement events but I could not identify specific moments when this happens (so that I could reproduce it every time I want). This is probably one of those “periodical” situations. Like a heartbeat hit to measure the engagement time on a website.

Unfortunately, this part still remains unsolved for me and maybe one of my readers knows some details.

 

To sum up

user_engagement is sent if there are at least two page_view events in the same session. Event fires before the redirect BUT only if the visitor has stayed at least for 10 seconds on the previous page. If I land on a page (start a new session), then go to the 2nd page after 5 seconds, user_engagement event will not fire. Once I stay longer than 10 seconds and do one more page_view, then user_engagement event will be sent to Google Analytics 4.
user_engagement event is sent to Google Analytics even on single-page-view sessions if a visitor stays for at least 10 seconds on a single page. But the event is sent only right before the tab/window is closed. I presume that beforeUnload is used here.
If a visitor lands on a page and a conversion event is sent on the very same pageview (but no other pages are viewed), user_engagement event is not sent to Google Analytics. (I just presumed that it might be because conversions are mentioned in the Engaged Sessions metric calculations).
Looks like in general other events (except page_view) don’t affect the user_engagement event. What matters is multiple page_views combined with minimal time on page. But there are still some unknowns. Continue reading.
Pretty often, user_engagement event fires once per session. HOWEVER, I have noticed some sessions where there are multiple user_engagement events. But I could not reproduce those situations myself whenever I wanted. Thus further investigation is needed.

If you know something additional (that was not mentioned in this blog post), please let me know in the comments and I will update it accordingly.

 

The post Trying to Demystify user_engagement Event in Google Analytics 4 appeared first on Analytics Mania.

Read MoreAnalytics Mania

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments