Expand my Community achievements bar.

Reporting API Time Spent on Page

Avatar

Level 1

We've been using Reporting API for years to return the uniquevisitors per page. We've been asked to add another report for only including uniquevisitors per page that spent greater than 5 seconds on the page. I've looked through the documents and I found averageTimeSpentOnPage metric. Is there a way to include this in the search portion of the queue? If it is possible, is it going to remove unique visitors that spent less than 5 seconds on the page so they're not included in the count, or is it going to be looking at the aggregate time spent on page and exclude the entire page regardless unique visitors? Here is our current report description (the one we've used for years) which might be able to be modified:

 

{
	"reportDescription":{
		"reportSuiteID" : "activitypages",
		"dateFrom" : "2024-7-01",
		"dateTo" : "2024-9-01",
		"dateGranularity" : "month",
		"locale": "en_US",
		"elementDataEncoding": "utf8",
		"currentData": false,
		"anomalyDetection": false,
		"metrics" : [
			{
			"id" :"uniquevisitors"
			}
		],
		"sortBy": "uniquevisitors",
		"elements": [
			{
			"id": "page",
			"top": 50000,
			"search": {
				"type": "and",
				"keywords": [": (Activity)"]
				}
			}
		]
	}
}

 

1 Reply

Avatar

Level 2

@marc-sequel  Yes you can use "averagepagetime" in reporting API to get the bucketed values. In workspace, you can use the dimension name "Time Spent On Page - Bucketed" to see the occurrences for the visitors in time range bucketed format. 

You can go through the below accepted solution and follow the same steps to enable the debugger to get the API request.

https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/can-i-use-total-time-spen...