Hi,
I am trying to retrieve data provided in a report using the Adobe Reporting API.
I have a pages report and would like to get top 20 pages containing a specific keyword and sorted by pageviews on a specific date. I see that search clause helps you search by dimension but not sure how to use it in the json response code. Also, is there a way to sort by metric. My dimension is Page and Metric is Pageviews.
Thank you!
Solved! Go to Solution.
Yes, I was able to get the exact json request required using the below steps:
Analytics API thanks to
You would want to use a segment instead of search. If you only pull in a single dimension, it will automatically sort by that.
Are you using the v1.4 or v2.0 API?
Views
Replies
Total Likes
In API 1.4 you can't filter on a dimension directly, a call like "where page contains 'help' or 'contact'" does not work. the "contains" is only supported for classifications. what you need here are inline segments: https://github.com/AdobeDocs/analytics-1.4-apis/blob/master/docs/reporting-api/inline_segments.md
as a workaround you could add a classification to the desired dimension (eg. "page copy") and just copy the original value to the classified one by simply use a regex rule ".*"
havin g the classified value (which is basically the original one) allows to filter by a "contains"
and as Gigazelle said, it's always ordered by the metric by default or what you indicate in the API call. see "sortby" here: https://github.com/AdobeDocs/analytics-1.4-apis/blob/master/docs/reporting-api/data_types/r_reportDe...
Views
Replies
Total Likes
We are using API 2.0. I was able to search pages by adding search clause:
"dimension": "variables/page",
"search": {
"clause": "( CONTAINS 'contact' )"
},
if you are using API 2.0 and open console to inspect the API calls. that means you can build the desired table in workspace and have your API call in the network traffic.
There is even a hidden feature which allows you to show a debug mode and directly inspect the API for each table. can't find the link anymore, maybe ericmatisoff or Gigazelle have the link?
Views
Replies
Total Likes
Yes, I was able to get the exact json request required using the below steps:
Analytics API thanks to
exactly what I was looking for. thanks for posting it!
Views
Replies
Total Likes
"dimension": "variables/page" this statement saved my whole week.Thank you
Views
Replies
Total Likes
Views
Likes
Replies