Hello All in Matomo Forum,
I wanted use a query built like that in order to retrieve the “time_spent” fields (table “matomo_log_link_visit_action” ) information:
"
SELECTmatomo_log_action
.idaction
ASidaction
,
matomo_log_action
.name
ASURL
,
matomo_log_action
.url_prefix
ASurl_prefix
,LEFT(CONVERT(
matomo_log_link_visit_action
.server_time
, CHAR), 10) AS “Day”,
matomo_log_link_visit_action
.time_spent
AS “Time on Page”,
matomo_log_visit
.idvisit
AS “Visit ID”,
matomo_log_visit
.idsite
AS “Live Site ID”FROM
matomo_log_visit
LEFT JOINmatomo_log_link_visit_action
ONmatomo_log_link_visit_action
.idvisit
=matomo_log_visit
.idvisit
LEFT JOINmatomo_log_action
ONmatomo_log_link_visit_action
.idaction_url
=matomo_log_action
.idaction
WHEREmatomo_log_link_visit_action
.idsite
= <Parameters.Matomo Live> AND
matomo_log_visit
.idsite
= <Parameters.Matomo Live>"
However, the result of “time_spent” field is always “Null” - there seem to be no recorded information there. This is inconsistent with how information is presented in our Matomo instance where I can see “time spent on page” information.
If anyone could give a hint as for where this information is hidden in the database schema and why the field time_spent
in the matomo_log_link_visit_action
table returns no information I would be very grateful.