Expand my Community achievements bar.

SOLVED

Analytics API requests - filtering by segments

Avatar

Level 2

Hi,

I've recently started using the API to make requests and am now successfully pulling metrics and splitting them out by elements.

However I am not succeeding to filter my results by previously configured segments. I have two issues:

1) To obtain the segment ID I am pulling a list using Segments.Get. It returns a list of 101 segments showing ID and name, but this does not appear to be comprehensive, and doesn't include the one I'm looking for. The segment definitely exists because I'm using it regularly in workspace.

2) In the absence of the segment I'm attempting to recreate it by using inline segments, as described here (analytics-1.4-apis/inline_segments.md at master · AdobeDocs/analytics-1.4-apis · GitHub ). However the original segment is based on an exclusion - e.g. "propXX" is NOT "zzz". The documentation shows how to create an inclusive one with " segment element selected " but not an exclusive one . Any ideas how to achieve this?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

1) you can get all segmentID's by setting the "accessLevel": "all"

2) see the examples for "does not contain" at the end of this page: https://github.com/AdobeDocs/analytics-1.4-apis/blob/master/docs/reporting-api/inline_segments.md

View solution in original post

5 Replies

Avatar

Correct answer by
Community Advisor

1) you can get all segmentID's by setting the "accessLevel": "all"

2) see the examples for "does not contain" at the end of this page: https://github.com/AdobeDocs/analytics-1.4-apis/blob/master/docs/reporting-api/inline_segments.md

Avatar

Level 2

Wow, thanks for the instant reply!

The accessLevel:all worked - is that documented somewhere?

Regarding the examples for "does not contain". I did see these but they seem to require Classification Values which I'm not familiar with. I tried to simply remove "classification": "Group Name", from the query but that didn't work.

Avatar

Community Advisor

2) yes, thats right. this is one if the mayor issues in API 1.4, but will be solved in 2.0. If you start to use the API, I recommend you start with 2.0 (I think it will be officially released in the next month ....)

Avatar

Community Advisor

2) if you want to use 1.4, just add a simple classification with regex * to map original values. just a workaround with lot of work ...

Avatar

Level 2

Thanks. Unfortunately I wasn't aware of 2.0 so I've been working with 1.4. I'll take a look at 2.0 shortly. Thanks again.