API ReferenceAnnouncementsCommunity Discussion
API ReferenceCommunity DiscussionAnnouncementsSubscribeLog In
API Reference

Targeting Flow

Targeting - 2 Flows

The methodology used to update a targeting field - and store its targeted values - depends on the flow implemented for that collection.

📘

Audience targeting fields are handled a bit differently - and are represented by a Multi-Targeting Object - see Audience Targeting Overview.

Typical Flow

This flow is used for most targeted collections:

a. The targeting field is updated directly via the campaigns endpoint.
b. The collection is stored directly in the value property.
c. The href property is always null.

Example - Update platform targeting (campaigns endpoint):

POST /backstage/api/1.0/demo-advertiser/campaigns/1234
{
    "platform_targeting": {
        "type"  : "INCLUDE",
        "value" : ["TBLT", "PHON"]
    }
}
{
   // Additional campaign fields omitted...
   
   "platform_targeting": {
      "type": "INCLUDE",
      "value": [
         "PHON",
         "TBLT"
      ],
      "href": null
   }
}

Flow for Large Collections

This flow is used for large collections - at the time of this writing, it is implemented by Postal Code Targeting only:

a. The targeting field is updated indirectly via a separate endpoint - e.g. /targeting/postal_code. (For this reason, you can only update postal code targeting after you create the campaign object. In practice, you first update the country targeting and then update the postal code targeting.)
b. A reference to the above endpoint, for the current campaign, is stored in the href property. This URL can be used to fetch the targeted collection.
c. The value property is always null.

Example - Update country targeting (campaigns endpoint):

POST /backstage/api/1.0/demo-advertiser/campaigns/1234
{
    "country_targeting": {
        "type"  : "INCLUDE",
        "value" : ["US"]
    }
}
{
   // Additional campaign fields omitted...
   "country_targeting": {
      "type": "INCLUDE",
      "value": [
         "US"
      ],
      "href": null
   }
}

Then - update postal code targeting (targeting/postal_code endpoint):

POST /backstage/api/1.0/demo-advertiser/campaigns/1234/targeting/postal_code
{
    "type": "INCLUDE",
    "collection":[
            "1351",
            "1430",
            "1522",
            "1534",
            "1540",
            "1585",
            "1601"   
    ]
}
{
    "collection": [
        "10001",
        "10002"
    ],
    "type": "INCLUDE"
}

📘

The flow used for postal_code_targeting is similar to that of Audience Targeting - see the Multi-Targeting Object.