Advanced targeting is a nice feature that gives you extra control over your ad campaigns. We will explain what options this feature has and how to use them in this short article.
Adserver.Online has the following advanced targeting options available:
- URL substring – URL where ads will be displayed
- Referrer substring – URL from where a visitor has come
- User-agent substring – User-Agent HTTP header from visitors’ browser
Generally, the logic behind all these options is the same. The ad server finds occurrences of a substring in an ad request data and makes a decision whether to display an ad or not.
Substring is a comma-separated string. For example:
apple, orange, mango
Please note that the comma symbol means AND. Therefore, the expression above will be interpreted as “apple AND orange AND mango”. So all words must present to trigger ads displaying.
If you would like to use negative keywords, you need to place a hyphen (-) symbol before the keyword. For example:
apple, orange, -mango
As mentioned, a comma symbol means AND. So this expression will be interpreted as “apple AND orange AND NOT mango”
If you need more complex logic (including OR logic), you should use regular expressions.
In this case, a substring has to start from a tilde (~) symbol. Then it will be treated as a regular expression. We recommend you double check your regular expressions and test them here before using them in your campaign targeting.
For example, it can look like this:
In this case, ads will displayed if either “apple” OR “orange” OR “mango” presents.
Advanced targeting examples
Let’s say you have placed the same invocation code on to several pages, for example:
If you would like to display ads on “blog/post” pages only, you should put this expression to “URL substring” field:
When you want to display ads on all pages except “about” and “shop”, you should use this expression:
When you want to display ads on “about” or “shop” pages only, you should use this regular expression:
If you wish to display ads on two particular posts, then you should use this regular expression:
If you wish to exclude the main page of the domain example.com, but still display ads on all other pages, then you should use this regular expression:
If you wish to display ads on the main page of the domain example.com only, then you should use this regular expression:
If you wish to exclude the Safari browser, then you should use this regular expression in “User agent substring” field:
This should give you a basic understanding of how to use advanced targeting in your advertising campaigns. Though this feature might be very powerful, it’s relatively easy to implement and doesn’t need any coding experience. Use it wisely and don’t forget to follow the instructions.