Skip Navigation

Search

Time spent viewing article
Answer ID 12941   |   Last Review Date 01/16/2025

How is the time spent by users viewing an article calculated?

Environment:

Users (contacts) on Customer Portal (CP), Knowledge Foundation (KF), Knowledge Advanced (KA)
Oracle B2C Service

Resolution:

When an answer is viewed, the event is logged in the clickstreams table. Any subsequent actions are also recorded in the clickstreams table with a timestamp (created column), as shown below:

cs_session_id

action_id

created

*LzoI3Lq

20

2024-09-10 13:26:06

*LzoI3Lq

1

2024-09-10 13:26:06

*LzoI3Lq

2

2024-09-10 13:26:06

*LzoI3Lq

25

2024-09-10 13:26:06

*LzoI3Lq

12

2024-09-10 13:26:07

*LzoI3Lq

44

2024-09-10 13:26:08

The action_id for viewing an answer is 20. Within a session, all actions are sorted in ascending order by the created column. The next action after an answer view action, with a created timestamp greater than that of the answer view, is identified. If no such next action exists, the time spent on the answer is recorded as 0. Otherwise, the time difference between the next action's created timestamp and the answer view's timestamp is calculated.

Example:

In the table above, the session "*LzoI3Lq" viewed the answer (action_id = 20) at 2024-09-10 13:26:06. The next action with a greater created timestamp is action_id = 12, occurring at 2024-09-10 13:26:07. The time spent on the answer is calculated as the difference between these timestamps, which is 1 second.

Question:  Suppose someone clicks on an article and that opens a new tab in their browser, but they don’t immediately click on the new tab, and they continue another task. Does this report measure the time you open the article in your browser until you actually click on the article?

Answer: When someone opens an article in a new tab, the session remains the same, and an "answer view " action is recorded in the clickstream table, even if the answer is not actually viewed in that tab. Any subsequent actions in the original tab are also recorded under the same session. The time spent on the answer view is then calculated by subtracting the timestamp of the next action from the timestamp of the answer view action. This is how the answer view time is determined in this scenario.

Question. For another scenario, suppose a new article is opened and the user starts clicking around in it, but then they get distracted with another task and come back to the article to read some more later. Then, much later in the day, the user closes out of the article. Is all the time recorded or only the first click?

Answer: When someone opens an article, an "answer view" action is recorded in the clickstream table. If the user starts clicking around and any of those actions are linked to a custom clickstream action, those will also be recorded in the clickstream table and used to calculate the time. However, if the user clicks around without any custom clickstream actions and later returns to the article after the previous session has expired, the time will be calculated as 0. This is because there is no subsequent action in the same session to calculate the time difference with.

Related Links

Answer ID 5142: Description of Action ID's in Clickstreams