Expand my Community achievements bar.

SOLVED

Can I use Total Time Spent metric in API 1.4 warehouse type report?

Avatar

Level 2

Hello!

I'm trying to create a warehouse report with Total Time Spent (totaltimespent) metric using API 1.4 but get the error:

"error":"metric_not_supported_in_warehouse","error_description":"Metric \\"totaltimespent\\" not supported in warehouse requests","error_uri":"https:\\/\\/marketing.adobe.com\\/developer\\/en_US\\/documentation\\/analytics-reporting-1-4\\/metrics"

Does it mean Total Time Spent metric isn't supported in warehouse report OR it has some different name?

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

Not to throw your whole process into disarray... but maybe this is something you should consider using API 2.0 for? I say this because if you are getting "metric not supported" it seems like this isn't something you can overcome using that version of the API....

 

Workspaces all use version 2.0, so if the metric appears there it should return via the API.

 

 A little known fact about building API 2.0 calls, is that you can get the API calls used to build your Workspaces using the Debug mode, then you can tweak the API calls if needed.

 

First enable Debug mode:

Jennifer_Dungan_0-1689262261076.png

 

 

This will add a new icon to your freeform tables:

Jennifer_Dungan_1-1689262374607.png

 

When you click on this, it will have a popup asking if you want to get the call for the freeform or the sparkline.. choose freeform table:

Jennifer_Dungan_2-1689262397903.png

 

Now you will be presented with times for each API call:

Jennifer_Dungan_3-1689262481810.png

 

When you select the time(s), it will open a new window that will show the API call in multiple formats including JSON and CURL, etc.

 

Maybe this will have better luck getting the Total Time Spent? Or maybe that metric truly isn't available this way? I don't use the Time Metrics in Adobe...

View solution in original post

4 Replies

Avatar

Level 3

Hey @Andrii2023 related to Time spent this document states which metrics are supported in data warehouse - https://experienceleague.adobe.com/docs/analytics/components/metrics/time-spent.html?lang=en

Total seconds spent is something available in Data Warehouse and I believe the ID for the same is - itemtimespent

Avatar

Level 2

Thank you @f_husain, I read this doc before and it says that Total Time Spent is available in Date Warehouse. And indeed it works in Adobe Analytics Data Warehouse UI to request a report.

But I use API requests in my application and got the error.

 

Also tried to use "itemtimespent" name but the error is 

metric_id_invalid

 

Avatar

Correct answer by
Community Advisor and Adobe Champion

Not to throw your whole process into disarray... but maybe this is something you should consider using API 2.0 for? I say this because if you are getting "metric not supported" it seems like this isn't something you can overcome using that version of the API....

 

Workspaces all use version 2.0, so if the metric appears there it should return via the API.

 

 A little known fact about building API 2.0 calls, is that you can get the API calls used to build your Workspaces using the Debug mode, then you can tweak the API calls if needed.

 

First enable Debug mode:

Jennifer_Dungan_0-1689262261076.png

 

 

This will add a new icon to your freeform tables:

Jennifer_Dungan_1-1689262374607.png

 

When you click on this, it will have a popup asking if you want to get the call for the freeform or the sparkline.. choose freeform table:

Jennifer_Dungan_2-1689262397903.png

 

Now you will be presented with times for each API call:

Jennifer_Dungan_3-1689262481810.png

 

When you select the time(s), it will open a new window that will show the API call in multiple formats including JSON and CURL, etc.

 

Maybe this will have better luck getting the Total Time Spent? Or maybe that metric truly isn't available this way? I don't use the Time Metrics in Adobe...

Avatar

Level 2

That's exactly what I was trying to grab report request from UI. Total Time Spent has the same id I try to use in my report request. Obviously, warehouse type of report within API 1.4 doesn't support this metric. I decided to keep using my report with source=standard.

Thank you Jennifer for the suggestion!