Referer templates

In each banner request, the Adfox server receives a page address called a referer.

The received referer is mapped to the page templates specified for the sections of the site with the Dynamic definition by REFERER option enabled or with the templates specified in URL-based targets.

You cannot simultaneously specify different template types for the same object.

<Standard> type

  • The * symbol stands for a sequence of any characters of any length.
  • You can only specify one template per line, a total of 30 lines are available.

The Standard template type is suitable for sites with a simple structure. Let's say there is a site like www.website.ru with a logical structure of three sections specified in Adfox: Home page, News, and Other. The user can open the home page by typing one of the following in the browser's address bar:

website.com 
www.website.com 
http://www.website.com 
http://www.website.com/index.html

You can either list all possible options line by line or use templates:

*website.com
*website.com/index.html

The News section template looks like this:

*website.com/news/*

The Other section template is as follows:

*

The sections thus represent different pages of the site.

<POSIX.2> type

In this type of templates, you can use characters from POSIX regular expressions.

The template type is used for highly branched site structures, for example, with multiple home pages (a common case: separate home pages for specific cities) or when it's impossible to describe the structure using a standard template type. A field with the POSIX.2 template type may contain no more than 3000 characters.

For the home pages of the site www.website.ru, a template written using POSIX.2 looks like this:

.*(((website.сom|www.website.ru)/{0,1})|((website.ru)/(index.html)/{0,1}))$
  • .* Any set of characters (if no characters are specified for the beginning and end of the string, by default, the string begins and ends with .*, therefore, it is not necessary to specify the .* character at the beginning and end of the template).
  • ^ The beginning of the string (if the beginning of the string is not specified, the URL may contain any characters at the beginning, that is, by default, the string starts with .*).
  • $ The end of the string (if the string is not finished, the URL may contain any characters at the end, that is, by default, the string ends with .*).
  • | The OR condition.
  • () Each option is wrapped in brackets.
  • \ Escaping special characters with a backslash (characters that are used when writing a POSIX expression, for example, ? or .).
  • /{0,1} the {0,1} construct means that the character preceding it may occur 0 or 1 time.

Example of POSIX.2

homer-simpson-tv\.blog4ever\.com|forum\.rojadirecta\.org|^hidan\.eklablog\.com.*|^aniworld\.spb\.com\/.*\/adfox\/.*s$

Let's analyze a template in parts and see why these examples are suitable:

  • homer-simpson-tv\.blog4ever\.com

    http://homer-simpson-tv.blog4ever.com/?a=1212: There is no start or end character at the beginning or end of the template, and, by default, a string may have any set of characters at the beginning and at the end.

  • forum\.rojadirecta\.org

    https://www.forum.rojadirecta.org/?b=123: There is no start or end character at the beginning or end of the template, and, by default a string may have any set of characters at the beginning and at the end.

  • ^hidan\.eklablog\.com.*

    hidan.eklablog.com/?b=123: The string starts with a character indicating the start of a string, so the URL may not start with any other characters. However, any construct may be used at the end of the string, after .com.

  • ^aniworld\.spb\.com\/.*\/adfox\/.*s$

    aniworld.spb.ru/123/adfox/s: There are limiting characters at the beginning and at the end of the string. However, after .ru, there may be any construct that is allowed by .*.

How to check whether the page templates for the site sections are set up correctly

To check what section the site page with the Adfox ad tags from the site level installed refers to:

  1. Copy the URL of the site page that you want to check.
  2. In the Adfox interface, go to the Sites tab. Select the site where you want to check the section settings.
  3. On the Sections tab, insert the site page URL in the URL by template field and click Find.

The system shows the section that the site page URL currently belongs to according to the available page templates.

Contact support

Send an email