hi @dataen
Yes you are correct, the Adobe Analytics 1.4 API does not support segments as breakdowns. But the Adobe Analytics 2.0 API offers this support. Adobe Analytics 2.0 API uses JSON-based POST requests, which allows for more advanced and flexible reporting queries an you need the right permissions for the API.
Here is a basic example that you can try but I think you need to change based on your situation or environment:
// Import the required packages
var axios = require('axios');
var querystring = require('querystring');
// Set up the request headers
var headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer {Your_access_token}", //Replace {Your_access_token} with your actual access token
"x-api-key": "{Your_API_Key}", //Replace {Your_API_Key} with your actual API Key
"x-proxy-global-company-id": "{Your_Company_ID}" //Replace {Your_Company_ID} with your actual Company ID
};
// Create the request body
var data = {
"rsid": "{Your_Report_Suite_ID}", //Replace {Your_Report_Suite_ID} with your actual Report Suite ID
"globalFilters": [
{
"type": "segment",
"segmentId": "{Your_Segment_ID}" //Replace {Your_Segment_ID} with your actual Segment ID
}
],
"metricContainer": {
"metrics": [
{
"columnId": "0",
"id": "metrics/visits"
},
{
"columnId": "1",
"id": "metrics/pageviews"
}
]
},
"dimension": "variables/evar1",
"settings": {
"dimensionSort": "desc",
"limit": "100"
}
};
// Send the request
axios.post('https://analytics.adobe.io/api/{Your_Company_ID}/reports', data, { headers: headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
Hope this answers your question.
Thanks
Madhan