Applying v15 Segments to Web Services Reports
It’s here! Well, it’s been here for a few months — but to be sure everyone is aware… you can now apply v15 segments to reports you request using the Web Services. Here is how you do it.
Consider applying the following “First Time Visits” segment to a PageViews (overtime) report in the SiteCatalyst UI. You simply select the segment name in the segmentation drop down menu.
To apply the same segment using the Web Services (i.e. Reporting API) you would use the “segment_id” attribute in your reportDescription object and then pass that as the parameter for your queuing method (Report.QueueOvertime in this case).
The reportDescription would look something like this…
Notice that the value of the “segment_id” attribute is NOT the same as what you see in the segmentation menu in the SiteCatalyst UI. This is because segments have friendly names as well as IDs (just like report suites). It is only the ID of the segment that will work in the reportDescription. So that begs the question… “how do I know what the segment ID is?”. Well, there is a method for that! If you call the new ReportSuite.GetSegments method you will get the complete list of segment names and IDs for a report suite.
A few key things to remember…
- If the report suite you are querying is not enabled for SiteCatalyst v15 then won’t be able to apply segments.
- You need to be using the “1.3″ API endpoint (or newer) to take advantage of this segmentation goodness. You should see “1.3″ in the URL that your requests are being made to.
- Many of the segments you create in the Marketing Suite UI will be tied to a specific report suite AND user. So, if you are not able to apply segments that you know exist or even see them when making the ReportSuite.GetSegments call, you should double check that you are working with the right report suite and that your API credentials are tied to the user you created the segment with.
Good luck! And let me know if you have feedback or questions on this topic.
Sean is a Sr. Partner Integration Manager focusing on integrations with the Adobe Digital Marketing Suite. This includes Adobe Genesis integrations and custom integrations using Adobe’s Web Services.