Expand my Community achievements bar.

Join us at Adobe Summit 2024 for the Coffee Break Q&A Live series, a unique opportunity to network with and learn from expert users, the Adobe product team, and Adobe partners in a small group, 30 minute AMA conversations.
SOLVED

Tracking the time spent on a page of a bounce visit

Avatar

Level 1

We have been working on some custom KPI’s in order to track the quantity and quality of the visit.

Unfortunately, we noticed that the average time spent on a page (bucketed) does not include the 1 page pageviews. After some additional research, we found out that AA does not have access to this information since the time on a page is calculated between when somebody arrives on a page and loads the next one. If there is no next one, the time is considered 0.

We would like to accurately track this and saw there are several ways to do this. For instance by installing a counter on the server.

 

 

Is there a way to achieve, on the logical discussion we understand that we can have time from when page loads but nothing track on for a time when page exit with any interaction? Basically, the requirement is to track the time between page loads to exit for non-interactive exits of a page or bounce. If anyone has any idea on how this would work, request you to kindly assist us.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

In theory, you could attempt to create custom code to detect when the user is performing an "exit intent" or use of "browser back" button (only when the referrer is something other than your own site).. 

 

A lot of hearbeat trackers do something like this... they fire a heartbeat every X seconds... if the tab or window goes out of focus, they fire a heartbeat, when resumed a new heartbeat is sent, and when the page changes, a final heartbeat for the page is triggered... but most of these systems are designed to take the active engaged time all into consideration (within the session timeout and add them together), Adobe wouldn't have that.. you would need to export all that data into a data lake and come up with all the proper calculations around that... plus, since you pay for every server call... this could easily overwhelm your contract.

 

You may be better off looking for a third-party heartbeat tracker and using that for your time spent if this is really a concern... or just always provide a caveat on this data that this is merely a calculation between timestamp A and timestamp B and that there will always be a certain amount of loss on the data that can be collected.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

In theory, you could attempt to create custom code to detect when the user is performing an "exit intent" or use of "browser back" button (only when the referrer is something other than your own site).. 

 

A lot of hearbeat trackers do something like this... they fire a heartbeat every X seconds... if the tab or window goes out of focus, they fire a heartbeat, when resumed a new heartbeat is sent, and when the page changes, a final heartbeat for the page is triggered... but most of these systems are designed to take the active engaged time all into consideration (within the session timeout and add them together), Adobe wouldn't have that.. you would need to export all that data into a data lake and come up with all the proper calculations around that... plus, since you pay for every server call... this could easily overwhelm your contract.

 

You may be better off looking for a third-party heartbeat tracker and using that for your time spent if this is really a concern... or just always provide a caveat on this data that this is merely a calculation between timestamp A and timestamp B and that there will always be a certain amount of loss on the data that can be collected.

Avatar

Community Advisor

Almost all browsers support listening for an "unload" event in the browser window. So you could do this:

window.addEventListener("unload", function (e) {
  // track the time spent with a Custom Link s.tl() beacon
});

This implies 2 things:

  1. You have recorded the timestamp of when the page was loaded, so that you can then calculate the difference between that window loaded timestamp vs this window unloaded timestamp.
  2. You will be tracking this with every page, not just this page.

Also, note that because this happens with the window "unload" event, it is possible that the user's browser could finish unloading/exiting already before your Custom Link beacon has had a chance to be run to completion. As a result, you should expect that you will not be able to get the data of all of your visitors. But I believe you should still be able to get the data for a sizeable number of them.

Also, because of implication #2, your Analytics users may get confused about why there are 2 "Time spent on page" metrics in your report suite now. Furthermore, they will get confused when they see different times spent for each metric, due to the different ways that they're calculated (AA's standard way vs your window "unload" implementation). I suppose you could create a Calculated Metric from this window "unload" time where it is reported only for the segment of bounced visits.

Hope the above helps to guide your thinking on this topic.