Expand my Community achievements bar.

SOLVED

Extract calculated metrics with dimensions

Avatar

Level 2

Hey!

 

I wanted to extract a few calculated metrics along with certain number of dimensions (breakdowns) where in both calculated metrics and dimensions are greater than 1.

In the Adobe Data Warehouse UI, I couldn't find my calculated metrics so I assume warehouse doesn't support this? 

 

Any other API(1.4 / 2.0) that could fit my use case?

 

Any help would be highly appreciated, thank you!

1 Accepted Solution

Avatar

Correct answer by
Employee

@prerna ,

Analysis workspace is always an option to extract data for dimensions and calc. metrics but you can use API as well. 

You can use swagger links to run the API requests which has made API so simpler:

 

API v1.4

https://adobedocs.github.io/analytics-1.4-apis/swagger-docs.html

API v2.0
https://adobedocs.github.io/analytics-2.0-apis/

 

View solution in original post

8 Replies

Avatar

Community Advisor

API 2.0 is probably your best option.

If you are going to be working in Excel, you could also consider installing the ReportBuilder add-on (Windows only) to get your segments and metrics.

Avatar

Level 2
The plan is to get it in a dataframe and do some transformation further on. In DWH API 1.4, we're able to get metrics broken down by dimensions- is there a similar work around for API 2.0 where in we can have calculated metrics broken down by dimensions?

Avatar

Correct answer by
Employee

@prerna ,

Analysis workspace is always an option to extract data for dimensions and calc. metrics but you can use API as well. 

You can use swagger links to run the API requests which has made API so simpler:

 

API v1.4

https://adobedocs.github.io/analytics-1.4-apis/swagger-docs.html

API v2.0
https://adobedocs.github.io/analytics-2.0-apis/

 

Avatar

Level 2
@vibhatna- i suppose api1.4 cannot be used if i want to extract calculated metrics with dimensions as breakdowns

Avatar

Level 7

@prerna  In addition to @vibhatna  if you want response in JSON format without using the API then you can simply do this by enabling the debugger in Workspace Project from Help -> Enable Debugger. Once the debugger is enabled than simply hover on the right side of free form table (just below the date range selector) and you will see a bug icon. Click on that icon and then you will be able to see request and response in both XML and JSON format.

Note:- Use this approach only if you want to get data in JSON format without manually sending the request to API endpoint.

Avatar

Level 2

Hi @amgup, 

 

I have a similar requirement as @prerna and I am using the same procedure as you mentioned. 

 

avinash2711_1-1629904041368.png

 

 

The JSON query through debugger gives a request json like below:  

avinash2711_5-1629904614181.png

 

 

and the response as below : 

avinash2711_4-1629904437809.png

 

Instead of returning the dimension type values the response returns the calculated metric id 2 times. 

writing the data part in response to dataframe gives something like below: 

 

avinash2711_6-1629904812726.png

 

Hope I am clear with the above explanation. 

 

1. Is there any way I can get the dimension values in the response ?

2. If the above is not possible is it possible to get dimension values based on the itemids in the request  screenshot ?

Avatar

Level 2

I was able to achieve this ( not entirely though)  by requesting top n items for that dimension. 

 

This works well when your top n results coincide with the top n of the dimension with the segment and metric filters, else it would fail.

Avatar

Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?