Targeting Object

Overview

in general, campaign fields that implement targeting are represented by a Targeting Object.

πŸ“˜

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

The Targeting Object has 3 fields:

  • type
  • value
  • href

The following sample Campaign Object illustrates:

{
   // Additional Campaign fields omitted...
   "postal_code_targeting": {
      "type": "INCLUDE",
      "value": null,
      "href": "https://backstage.taboola.com/backstage/api/1.0/demo-account/campaigns/1234/targeting/postal_code"
   },
   // Additional Campaign fields omitted...
   "platform_targeting": {
      "type": "INCLUDE",
      "value": [
         "TBLT",
         "PHON"
      ],
      "href": null
   },
   // Additional Campaign fields omitted...
}

πŸ“˜

Note

postal_code_targeting stores a reference to its collection in the href property. It's value property is always null.
platform_targeting stores its collection directly in the value property. Its href property is always null. Most targeting fields implement this scheme (with the exception of audience targeting fields - as noted above above).

Targeting Object Schema

NameModifier/DefaultsTypeDescription
typeRequired for targeting fields that implement a typical flow.

(See notes)
Possible values:

INCLUDE
The supplied values should be included (targeted).
EXCLUDE
The supplied values should be excluded
ALL
Target all (no targeting).
Type of targeting - whether the listed values should be excluded (EXCLUDE) or included (INCLUDE). ALL indicates that there is no targeting.

(For postal_code_targeting, this property is not updated directly.)
valueRequired for targeting fields that implement a typical flow.

(See notes)
Array

Possible values depend on the item being targeted.
For targeting fields that implement a typical flow - e.g. platform_targeting - this property is required and stores the targeted collection.

(For postal_code_targeting, this property is always null.)
hrefRead-onlyString (URL format)For postal_code_targeting, href stores a reference to the targeted values (e.g. a reference to the /targeting/postal_code endpoint, for the current campaign).

(For targeting fields that implement a typical flow - e.g. platform_targeting - this property is always null.)

🚧

You must adhere to the restrictions defined for each field. Otherwise, the server will return 400 Bad Request.