Expand my Community achievements bar.

SOLVED

Get Adobe Segment definition in JSON format

Avatar

Level 2

Hello Everyone, 

 

I am checking  the possibility of extracting the definition of segment into a JSON format. The scope of segment definition  is the filters that compromise the build of the segments , like the dimensions used, other segments etc.,

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

I am unaware of any feature that currently allows us to get our segment definitions in JSON... I have actually talked to some people at Adobe about that.. allowing us to export and import segment definitions in JSON format (since I believe they are saved in the format)... whether or not that happens is unknown, but it would certainly make it easier to share and diagnose segment issues with other people (like here in the forums) so much easier.....

 

You could try the audiences API as was suggested... but not all segments are "audiences" and I don't know if that would return what you need or not... 

 

You could try the Segments API, since there are retrieve and update endpoints?

https://developer.adobe.com/analytics-apis/docs/2.0/guides/endpoints/segments/

View solution in original post

4 Replies

Avatar

Community Advisor

Hey @avinash2711

 

You can try parsing the JSON response of the audience definition endpoint.

 

Here's the link to the documentation:

https://experienceleague.adobe.com/en/docs/experience-platform/segmentation/api/audiences

 

Hope this will help.

Let us know if you run into issues.

 

Cheers,

Abhinav

 

Avatar

Community Advisor

My bad.

 

Didn't realise this one was an Adobe Analytics thread. Thought was replying to an AEP query.

 

@Jennifer_Dungan and @Vinay_Chauhan are right in that case.

 

Cheers,

Abhinav

Avatar

Correct answer by
Community Advisor and Adobe Champion

I am unaware of any feature that currently allows us to get our segment definitions in JSON... I have actually talked to some people at Adobe about that.. allowing us to export and import segment definitions in JSON format (since I believe they are saved in the format)... whether or not that happens is unknown, but it would certainly make it easier to share and diagnose segment issues with other people (like here in the forums) so much easier.....

 

You could try the audiences API as was suggested... but not all segments are "audiences" and I don't know if that would return what you need or not... 

 

You could try the Segments API, since there are retrieve and update endpoints?

https://developer.adobe.com/analytics-apis/docs/2.0/guides/endpoints/segments/

Avatar

Community Advisor

Hi @avinash2711 

You're on the right track and yes, segment definitions are stored in JSON internally, but unfortunately, Adobe doesn’t expose them in a clean, exportable JSON format (yet) through the UI.

If your segment is tied to Adobe Audience Manager or Real-Time CDP, then the Adobe Experience Platform Audiences API can give you the audience definition in JSON. That said, it only works for platform-based segments not for segments created in Adobe Analytics Workspace.

For Analytics segments specifically, the Segments API (v2) is your best bet. It doesn’t return a fully structured JSON of the logic (like nested conditions), but it will give you metadata like container type, report suite, tags, and basic rules. You can fetch those via the GET /segments endpoint.

 

So in short:

  • No native JSON export for Analytics segments

  • Segments API can give partial metadata

  • Audiences API is only useful if your segment lives in AEP/CDP

It would definitely be helpful if Adobe made it easier to export/import segment logic especially for QA or sharing between environments. Fingers crossed for that in a future release.

Hope this helps!