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.

https://blog.adobe.com/media_51a47ea9097eebc124b7dba692da12d5fe9ebb39.gif

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…

https://blog.adobe.com/media_795cfd24768a26c1c62f978a53d129875c6e3aba.gif

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…

Good luck! And let me know if you have feedback or questions on this topic.

-Sean (@seangubler)

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.