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 you usually do.
API selector groups are defined and assigned in the Experience OS console, and the Campaigns page supports filtering by selector groups so that you always know which campaign is assigned to which group.
Note that a campaign can’t belong to more than 10 groups, and a selector group name cannot be longer than 255 characters.
Example of a Choose API request using API selector groups:
{
2 "selector": {
3 "names": [
4 "test1"
5 ],
6 "groups": [
7 "homepage_campaigns"
8 ]
9 },
10 "user": {
11 "dyid": "-4350463893986789401",
12 "dyid_server": "-4350463893986789401"
13 },
14 "session": {
15 "dy": "ohyr6v42l9zd4bpinnvp7urjjx9lrssw"
16 },
17 "context": {
18 "page": {
19 "type": "HOMEPAGE",
20 "location": "https://example.org",
21 "locale": "en_US",
22 "data":[]
23 },
24 "device": {
25 "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
26 "ip": "54.100.200.255"
27 }
28 },
29 "options": {
30 "isImplicitPageview": false,
31 " returnAnalyticsMetadata": false
32 }}