Custom targeting

  • Home / Case Study / Custom targeting

Custom targeting

It’s nice to have in-depth targeting options and be able to reach your target audience. And custom targeting can surely help you with that. This feature allows users to integrate various data from external sources (data providers) into their ad server accounts and use it for ad targeting. This customer data may include demographics, interests, income and more. Though, being a powerful instrument, this feature needs at least basic knowledge of JavaScript to implement. But once mastered, it opens new opportunities and can be a game-decider to your online business.

In order to set custom targeting up, you need to pass custom data to the ad server by configuring invocation codes on your website. At first, you need to insert a special Javascript block to the HEAD section. These scripts are usually provided by DMPs or other data providers.

var _aso = _aso || {};
_aso.attr = {
tags: ['apple', 'banana'],
keywords: ['aaa', 'bbb', 'ccc'],
any_array: ['auto','politics'],
any_name: 'whatever',
price: 100

After that, you should create attributes with the same names (e.g., “tags”, “keywords”, “any_array”, “any_name”, “price”) in Settings/Attributes section of your Adserver.Online account.

Then you will be able to use custom targeting based on the attributes in your campaign form:

custom targeting -

Though it is a basic article and doesn’t cover all the aspects of custom targeting. It will be useful for those who have some experience in coding and DMP integration. But even if you are not, it’s never late to learn something new.

Advanced targeting

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.

Field format

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”

Regular expressions

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:

-about, -shop

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, 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 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.

Interested To Get Our Featured Service