Can I use Total Time Spent metric in API 1.4 warehouse type report? | Adobe Higher Education
Skip to main content
Level 2
July 12, 2023
解決済み

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

  • July 12, 2023
  • 2 の返信
  • 1231 ビュー

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!

このトピックへの返信は締め切られました。
ベストアンサー Jennifer_Dungan

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:

 

 

This will add a new icon to your freeform tables:

 

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:

 

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

 

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...

2 の返信

FarazHusain
Adobe Employee
Adobe Employee
July 12, 2023

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

Andrii2023作成者
Level 2
July 12, 2023

Thank you @farazhusain, 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

 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 13, 2023

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:

 

 

This will add a new icon to your freeform tables:

 

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:

 

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

 

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...

Andrii2023作成者
Level 2
July 14, 2023

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!