Data keys
This guide will show you how to target specific audiences using key value-based attributes. We call these key-value pairs Data Keys. Like most forms of targeting, you must create and define data keys before you can use them.
By default, only the Administrator can create, edit, and delete data keys. You can edit a user account's permissions or role to allow them to manage data keys as well.
For other forms of targeting, read Targeting overview. To find out how to set schedules and target dates, days, or periods, read Pacing & Schedule.
- How to create data keys.
- How to assign data keys.
- How to create data key rules and groups.
- Using data key rules templates.
- How to set data keys.
How to create data keys
Click Targets in the left navigation menu. The Targets section will appear.
Click Manage Data Keys to go to the Data Keys subsection.
- Click Add Data Key. The Data Key window will appear.
- Give the data key a name, select its type, then click Save.
The data keys you created will be listed in the table in the Data Keys subsection.
Once you start using data keys, you can check which placements they are being used by going to the Data Keys subsection. To see the placements, click on the three dots at the far right of a data key in the table. Then click See Usages for display ad placements, or See VAST Usages for VAST ad placements.
How to assign data keys
- Click Advertisers in the left navigation menu to go to the Advertisers section.
- Click on the appropriate advertiser to go to its dashboard.
- Click on the appropriate campaign to go to its dashboard.
- Under Zone Assignments, create a new zone assignment or click on the existing zone assignment that you want to use.
- In the Assignments page, click on Targeting to expand the Targeting menu, then click Manage Target. The Manage Data Key Rules window will appear.
- Create data key rules or groups as needed.
- Click Save Changes.
How to create data key rules and groups
In the Manage Data Key Rules window, each line is a rule. Use data keys together with the provided operators and options to define your target audience.
Conditional logic operators and options
- All: The target audience is one that meets all listed requirements.
- Any: The target audience can be anyone that meets at least one of the listed requirements.
- = : is equal to.
- != : is not equal to.
- < : is less than.
- <= : is less than or equal to.
- > : is greater than.
- >= : is greater than or equal to.
- starts with: the conditional characters must be at the start of the retrieved string.
- ends with: the conditional characters must be at the end of the retrieved string.
- contains: the conditional characters can be anywhere in the retrieved string.
- does not contain: the conditional characters must not be in the retrieved string.
- is after: the retrieved time must come after the conditional value.
- is before: the retrieved time must come before the conditional value.
- is between: the retrieved time must be between the conditional values.
To add a rule, click +Add, then click +Rule. By default, all rules for an assignment fall under either All or Any. In other words, your target audience either meets all of the rules, or just one or more unspecified rules. If you want to define a target audience that must meet specific rules but not necessarily all rules, you should create a group. A group is a set of rules that are treated as one rule. It allows you to use both All and Any in the same set of rules. To add a group, click +Add, then click +Group.
Example 1 wants to serve ads to males aged 21 to 65 years old.
Example 2 wants to serve ads to males aged 21 to 65 years old, and whose last names end in "son", "er", or "phy". The group of rules made it possible to define a target audience that must meet the first three rules, but comply with only one of the rules in the group.
Example 3 wants to serve ads to males of any age, or to females aged 21 to 65 years old. The group of rules made it possible to define a target audience that can meet either the first rule or the group. However, the latter has a set of requirements that must all be met.
Data key rules templates
While creating a set of rules, you can save it as a template. This lets you apply it to future placements without redefining the rules from scratch every time.
- Click Templates on the upper right corner of the Manage Data Key Rules window.
- Click Save current rules to new template. The Create Template window will appear.
- Enter a name for the template then click Create.
To apply a saved data key rules template:
- Click Templates on the upper right corner of the Manage Data Key Rules window.
- Click on the name of the template in the dropdown that appears. The set of rules in the template will appear.
To edit a template:
- Click Templates on the upper right corner of the Manage Data Key Rules window.
- Click on the name of the template in the dropdown that appears. The set of rules in the template will appear.
- Make your desired changes.
- Click Save change to current template.
To delete a template:
- Click Templates on the upper right corner of the Manage Data Key Rules window.
- Click on the trash can icon next to the template's name. A confirmation prompt will appear.
- Click Remove Template Permanently.
How to set data keys
- Click Publishers in the left navigation menu to go to the Publishers section.
- Click on the appropriate publisher to go to its dashboard.
- In the table of zones, look for the zone where the data key-targeted campaign is assigned.
- Click on Get Tags under the Zone Tags column of that zone. The Zone Tags window will appear.
- For asynchronous JavaScript zone tags, look for
keywords: abkw
in the code snippet.
- For data keys with a single value, enter
dataKeys: {'Name of Data Key' : 'Value'}
beforekeywords: abkw
. For example, let's add the data key Age and the value 21:
- For data keys with multiple values, the values must be entered as a JSON array:
dataKeys: {'Name of Data Key' : [Value 1, Value 2, etc.] }
For example, if the data key Age had values 21 and 65, we would enter it in the zone tag as
{ "Age": [21, 65] }
.
For email zone tags, look for uid
(the email macro) in the image tag. Enter the data key after the value of uid
.
- For data keys with a single value, enter
&_abdk[Name_of_Data_Key]=Value
- For data keys with multiple values, the values must be entered as a URL encoded JSON payload. Using the data key Age with values 21 and 65 as our example, we would enter it in the image tag as:
&_abdk_json=%7B%20%22Age%22%3A%20%5B21%2C%2065%5D%20%7D
Repeat Step 4 for each data key used in the rules you created. Each variable must be separated with a comma.
Paste the modified zone tag into the publisher's website.