Key/Value Targeting

Key/Value Targeting is a powerful method to fine-tune delivery of your campaigns. An ad will only be shown if a key matches the value as defined by the campaign's targeting rules. AdGlare's ad serving engines will automatically check if the key is present in a cookie or in the global JavaScript scope.
Contrary to Keyword Targeting you can use numeric, string and boolean operators to set up your expressions. Here's an example of such a configuration in AdGlare.
String Operators
Operator | Example | Matches | |||
---|---|---|---|---|---|
equals | category=car | car | new car | cartoon | new cartoon |
does not equal | category!=car | car | new car | cartoon | new cartoon |
contains | category=%car% | car | new car | cartoon | new cartoon |
does not contain | category!=%car% | car | new car | cartoon | new cartoon |
begins with | category=car% | car | new car | cartoon | new cartoon |
does not begin with | category!=car% | car | new car | cartoon | new cartoon |
ends with | category=%car | car | new car | cartoon | new cartoon |
does not end with | category!=%car | car | new car | cartoon | new cartoon |
is empty | category=null | car | new car | cartoon | new cartoon |
is not empty | category!=null | car | new car | cartoon | new cartoon |
Numerical Operators
Operator | Example | Matches | |||
---|---|---|---|---|---|
equals | val=10 | 9 | 10 | 11 | 369 |
less than | val<10 | 9 | 10 | 11 | 369 |
less than or equals | val<=10 | 9 | 10 | 11 | 369 |
greater than | val>10 | 9 | 10 | 11 | 369 |
greater than or equals | val>=10 | 9 | 10 | 11 | 369 |
Boolean Operators
Operator | Example | Matches | |||
---|---|---|---|---|---|
true | bool=true | true | false | ||
false | bool=false | true | false | ||
not true | bool!=true | true | false | ||
not false | bool!=false | true | false |
AND / OR Operators
Use a , to separate your OR statements. Each new line is considered an AND operator. For example:
upgraded=false
Do I have to change my ad tags?
For Display Ads you don't have to modify the ad tag whatsoever: it works out of the box.
However, for VAST and Native Ads you have to add the key/values to the URL. Keys have to be prepended with kv_. Here's an example:
https://try.engine.adglare.net/?736482736&kv_key1=val1&kv_key2=val2
How does AdGlare retrieve my key/value pairs?
The ad server engines will first check if a cookie is set containing your key. If not, we'll check if your key is found in a global JavaScript variable on the web page by determining:
window[key] !== undefined. If that fails too, the GET parameter will be used as per the example above.
How can I test my configuration?
Keys found as a JavaScript global variable override cookie keys. To test your configuration, you can consider defining those key/value pairs on your web page before loading the ad tag. Alternatively, you can add the key/value pairs to your ad tag as described above.
Good to know...
- Allowable characters for both keys and values are limited to letters (a-z), digits (0-9), underscores (_) and dashes (-).
- Operations are case-insensitive.
- Values should contain no more than 40 characters.
- If you're targeting user-generated search queries, replace spaces by dashes. For example: q = q.replace(/ /g,'-').replace(/[^0-9a-z-]/gi,'');
emoji_peopleMore about AdGlare
Since 2013, AdGlare powers the ad serving stack of hundreds of brands and publishers worldwide. With ideas and suggestions coming from Publishers, AdOps and Marketeers like you, we're proud to offer one of the most up-to-date ad servers in the market. We adhere to IAB's LEAN Ads Program and Google's Coalition for Better Ads.
Are you a publisher or brand? Reach out to see how we can help you.