The Adzerk Developer Hub

Welcome to the Adzerk developer hub. You'll find comprehensive guides and documentation to help you start working with Adzerk as quickly as possible, as well as support if you get stuck. Let's jump right in!

Demographic / Custom Properties

Demographic targeting requires UserDB, a data management platform that comes with the Business & Enterprise tiers. Custom Properties can be added to UserDB only by the API.

Please note: Adzerk is not providing demographic data. You need to be collecting that and sending it to UserDB. Adzerk will do the heavy lifting of using that data to determine if an ad is eligible to be shown.

Demographic Segments are loved by advertisers, who will pay more knowing that they are showing ads to a targeted audience (or will keep spending because they are seeing great performance). It's a big reason why Facebook's native ad product has seen such success.

Overview

Demographic targeting refers to targeting users based on user-given key/value pair information, like:

Key
Value

Gender

Male, Female

Age

18+, 20, 40-50, etc

Income

<$50K, $50K - $100K, $100K+

Custom Properties is a broader term that captures any user-specific info you have acquired (through onboarding process or behavioral tracking), such as:

Type
Examples

Favorite Website

Pinterest, Hacker News

Total Times Logged Into App

1, 5, 50+

UserDB UserKeys

Adzerk saves a user's demographic data in UserDB, a data management platform for storing user-level info. All data is stored as the custom field, tied to a UserKey, which is the persistent key field in UserDB. Please refer to our UserDB documentation for more information.

Adzerk does not provide the demographic data itself. Instead, you will need to send information associated with the user to UserDB, which will store the data and then be used for ad targeting.

Adding Demo/Custom Properties to a User

To tie Custom Properties data to a UserKey (the key field in UserDB), you will need to use the UserDB API Custom Property Endpoint.

In the request you'll include the azk={UserKey} at the beginning and {"Key":"Value"} at the end.

key = The Custom Properties category, such as "age", "gender", "FavoriteRestaurant"
value = The value for key for that particular user, such as "30", "male", "Olive Garden"

For example of a cURL request:

curl -b "azk=234412" -X POST -H "X-Adzerk-ApiKey:<APIKEY>" http://e-1234.adzerk.net/udb/1234/custom -d '{"Age":"30"}' 

This will update or create a record in UserDB for that UserKey. In the future, if you created a Flight targeting "People over 25-years-old", this user would be in that segment.

Targeting Custom Properties

To target these segments, refer to our Custom Targeting and UserDB Reserved Keys docs.

The queries used to target should look like:

UserDB Custom Property Key/Value
Example Custom Targeting Query

Age: 30

$user.custom.age > 25

Gender: Female

$user.custom.gender = "Female"

FavWebsite: Pinterest

$user.custom.orientation contains "Pinterest"

Setting Up Custom Property Targeting - Flight Level

When creating flights via the Create Flight endpoint, include the Reserved Keys targeting string under the CustomTargeting parameter. You can also update CustomTargeting with the Update Flights endpoint.

You'll want to use Reserved Keys with a format of $user.custom.[Key]

An example JSON request via the endpoint is:

flight={
  "CampaignId":1234,
  "PriorityId":1325,
  "Name":"People Over 25-Years-Old",
  "StartDateISO":"2017-05-01T00:00:00.00.0000000",
  "GoalType": 1,
  "CustomTargeting":"$user.custom.gender = \"Male\""
}

Make sure to use \ before quotation marks in strings to avoid the API request breaking

Setting Up Custom Property Targeting - Ad Level

Similar instructions to the Flight level. You'd want to use the Create Ads endpoint. An example request would look like:

creative={
    "CampaignId":123,
    "Creative":{
    "Id":12345
  },
    "FlightId":1234,
    "IsActive":true,
    "CustomTargeting":"$user.custom.age > 25"
}

Setting Up with UI

  • Flight-Level - Go to Flight Settings, click "Custom Targeting" on the left
  • Ad-Level - Click on the Creative in the Flights page, put in details under "Delivery Settings"

Remember: for Custom Properties Targeting to work, you will need to pass the UserKey in the user object's key field of the Decision API request. If you send the UserKey, Adzerk's Ad Decision Engine will cross-reference with UserDB when picking the right ad. If you do not send UserKeys, Custom Properties Targeting will not work.

Alternative Method - Custom Targeting

You could also use the Custom Targeting method to do demographic targeting. However, with it you need to pass the demographic information in each request. With the UserDB method, you need to only send once.

Demographic / Custom Properties