Working with Experience API Selector Groups

To streamline the process of calling specific API campaigns, you can group API campaigns and apply the grouping in your choose calls. Your developers can refer to a static API selector group without having to worry about any changes made to a specific campaign’s selector name. All the active campaign selectors in the group are sent back in the response to your choose call, enabling you to call relevant campaigns by their correct selector names as usual.

API selector groups are defined and assigned in the Experience OS console, and you can see which campaign is assigned to which group on the Campaigns page: Just filter by selector group.

🚧

Note

A campaign can’t belong to more than 10 groups, and a selector group name can't be longer than 255 characters.

Example of a Choose API request using API selector groups:

{
  "selector": {
    "names": [
      "test1"
    ],
    "groups": [
      "<span>homepage_campaigns</span>"
    ]
  },
  "user": {
    "dyid": "-4350463893986789401",
    "dyid_server": "-4350463893986789401"
  },
  "session": {
    "dy": "ohyr6v42l9zd4bpinnvp7urjjx9lrssw"
  },
  "context": {
    "page": {
      "type": "HOMEPAGE",
      "location": "https://example.org",
      "locale": "en_US",
      "data":[]
    },
    "device": {
      "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
      "ip": "54.100.200.255"
    }
  },
  "options": {
    "isImplicitPageview": false,
    " returnAnalyticsMetadata": false
  }
}