Referer templates
In each banner request, Adfox receives a page address called a referer.
This referer is then matched to the page templates configured for site sections with the Dynamic definition by REFERER option enabled, or to templates specified in URL-based targeting.
You cannot simultaneously specify different template types for the same object.
Note
For domains with non-Latin characters, use Punycode format. Example: сайт.рф → xn--80aswg.xn--p1ai.
Type <Standard>
- 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 works well for sites with a simple structure. For example, there is a website like www.website.ru with a logical structure of three sections specified in Adfox: Home page, News, and Everything else. 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.ru/news/*
The Other section template is as follows:
* support
The sections thus represent different pages of the site.
Type <POSIX.2>
Note
When setting up URL targeting, the template name is Regular expression.
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.
Here's a POSIX.2 template for home pages of www.website.ru:
.*(((website.сom|www.website.ru)/{0,1})|((website.ru)/(index.html)/{0,1}))$
.*
Any set of characters. If you don’t specify start or end characters, the string by default begins and ends with.*
, so you don’t have to add.*
at the beginning or end of the template.^
Start of string. If not specified, any characters may appear at the beginning of the URL. By default, the string starts with.*
.$
End of string. If not specified, any characters may appear at the end of the URL. By default, the string ends with.*
.|
The OR condition.()
We wrap each option 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 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
: The template doesn't contain start or end characters. By default, the string can include any set of characters.
forum\.rojadirecta\.org
https://www.forum.rojadirecta.org/?b=123
: The template doesn't contain start or end characters. By default, the string can include any set of characters.
^hidan\.eklablog\.com.*
hidan.eklablog.com/?b=123
: The string starts with a start-of-string character, so the URL can't begin 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 boundary characters at the start and end of the string. However, after .ru, any sequence allowed by.*
can follow.
How to check if page templates for site sections are set up correctly
You can determine which section a site page belongs to, if Adfox site-level ad codes are installed on it:
- Copy the URL of the site page that you want to check.
- In the Adfox interface, go to the Sites tab. Select the site where you want to check the section settings.
- In the Sections tab, paste the site page URL in the URL by template box and click Find.
The system shows the section that the site page URL currently belongs to according to the available page templates.