Passing Custom Targeting Data
Passing Custom Targeting Data via API
Pass key/value pairs as properties
in a placement in the Decision API Request:
“properties”: {
“numeral-key-name”: 42,
"string-key-name": "the answer to the ultimate question",
"array-key-name": ["life", "the universe", "everything"]
}
For example, if you want to target a key/value pair where genre = rock, you'd write a Zerkel query of: genre = "rock"
. This is what the Decision API request would look like:
{
"placements": [
{
"divName": "homepage",
"networkId": 123,
"siteId": 456,
"adTypes": [5],
"eventIds": [12,13,14],
"properties": {
"genre": "rock",
"age": 25
}
}
],
"ip": "10.123.123.123"
}
Passing Custom Targeting via Ad Call
Add this function to the placement you want to set Custom Targeting key/value pairs for, appended to the ados_add_placement(); function:
setProperties({"key": value,"key":value});
For example:
ados_add_placement(1234, 12345, "azk12345", 4).setProperties({"genre":"rock"});
Passing Values in Creative
To pass the contents of a value into a creative, use this macro:
{{placement.properties.key-name}}
When the ad is served, the macro will be replaced with the value of key-name
.
Updated 4 months ago