Documentation sections

Stream filters

The conditions a stream uses to select traffic: fields, operators, value format and AND / OR logic.

Filters decide which traffic gets into a stream. They are set in the Stream settings («Настройки потока») window on the Filters («Фильтры») tab. A stream without conditions accepts all traffic.

How to add a condition

  1. Open the campaign on the Streams («Потоки») tab.
  2. Click + Stream («+ Поток») or the gear button in the card of an existing stream.
  3. Go to the Filters tab.
  4. Click + Condition («+ Условие»). A row appears with the GEO («Гео») field, the in list («в списке») operator and an empty value field.
  5. Choose the field and the operator.
  6. Enter the values separated by commas. For the regex and not regex («не regex») operators, the field becomes multiline: enter one expression per line.
  7. If there are several conditions, choose AND («И») or OR («ИЛИ») between neighboring ones. AND is the default.
  8. Click Save stream («Сохранить поток»).

In the stream card, each condition is shown as a label like “GEO: US, CA” («Гео: US, CA»). For conditions with the not in list («не в списке»), ≠ and not regex operators, the label shows the operator: “GEO not in list: US, CA” («Гео не в списке: US, CA»). A stream without conditions says “no filters — all traffic” («без фильтров — весь трафик»). Remove an extra condition with the × button to the right of the row.

General rules

  • A condition is a field, an operator and a list of comma-separated values. Spaces around commas are ignored. Expressions for regex and not regex are written one per line.
  • Comparison in the in list, not in list, = and ≠ operators is case-insensitive: chrome and Chrome are the same.
  • If the click's value is not determined (the country is unknown, there is no referrer), an in list condition is not met, and a not in list condition is met.
  • A condition with an empty value list and the in list or = operator is never met. With the not in list, ≠ or not regex operator, it is always met.
  • Conditions work in streams of any type. A final stream with conditions gets only the clicks that match them.
  • The schedule and the stream state are checked before filters: a disabled stream and a stream outside its schedule get no traffic.
  • For a returning visitor with binding, the filters of the bound stream are not checked again.
Warning.

A click that matched no stream gets a 404 response. If your streams have filters, create a final stream without conditions. Until it exists, the panel shows a warning on the Streams tab: “There are streams with filters but no final one — traffic that matches no filter will go to 404. Add a final stream.” («Есть потоки с фильтрами, но нет замыкающего — трафик, не подошедший ни под один фильтр, уйдёт в 404. Добавьте замыкающий поток.»)

Operators

OperatorWhen the condition is met
in listThe click's value matches one of the listed values
not in listThe click's value matches none of the listed values
=Works the same as in list
≠Works the same as not in list
regexThe click's value matches at least one regular expression
not regexThe click's value matches none of the regular expressions

Specifics of regex and not regex:

  • RE2 syntax: lookahead and backreferences are not supported.
  • Case matters. For case-insensitive matching, start the expression with (?i).
  • The expression is searched for in any part of the value. For an exact match, put ^ at the start and $ at the end.
  • In the panel form, each expression goes on a separate line. A comma inside an expression is part of it, not a separator.
  • With the regex operator, an expression with an error matches nothing. With the not regex operator, a stream with such an expression will not be saved.
  • The regex and not regex operators do not work for the IP / CIDR field: the stream will not be saved.

AND / OR logic

The AND / OR switch sits between neighboring conditions. OR joins neighboring conditions into a group, AND starts a new group. The stream matches if at least one condition is met in each group.

Example. Three conditions in a row:

text
GEO in list US, CA
        AND
OS in list iOS
       OR
Browser in list Chrome

This gives “GEO AND (OS OR Browser)”: the stream gets clicks from the US and Canada whose OS is iOS or whose browser is Chrome.

To make sure the conditions are assembled correctly, click Check stream («Проверить поток») on the Streams tab. The Conditions in order («Условия по порядку») column shows whether each condition is met, see Stream selection check.

Condition fields

The field list offers 14 options. The hint in an empty value field shows the format: US, CA for GEO, a subnet for IP, false for bot and proxy. For the regex and not regex operators, the hint is “one pattern per line” («один шаблон на строку»).

GEO

The visitor's country according to the GEO database. Values are two-letter country codes: US, CA, DE.

Case does not matter: entered values are converted to upper case. This also applies to regex expressions, so list countries with the in list and not in list operators. not regex expressions stay as entered and are compared case-insensitively.

Next to the value field there is a Geo profile… («Гео-профиль…») list. Choose a profile, and its countries are added to those already entered. Profiles are set up separately, see Geo profiles.

In a campaign with cloaking, the list of allowed countries is taken from the GEO conditions of the money streams, see Cloaking streams.

Device («Устройство»)

The device type by User-Agent. Values: mobile, tablet, desktop, unknown.

OS («ОС»)

The operating system name by User-Agent. Example values: Windows, Android, iOS, macOS, Linux, ChromeOS.

Browser («Браузер»)

The browser name by User-Agent. Example values: Chrome, Safari, Firefox, Edge, Opera, Samsung Browser, Facebook App, Instagram App, TikTok App.

Language («Язык»)

The first language from the Accept-Language header, without the region code and in lower case: for en-US,en;q=0.9 it is en. Example values: en, de, ru.

Connection («Коннект»)

The connection type according to the IP2Proxy database. Values: hosting (data center), vpn, tor, proxy. For a regular connection and when the database is not connected, the value is empty.

ISP

The visitor's provider. The name comes from the IP2Location and IP2Proxy databases; without them the value is empty. The name is written as it is recorded in the database. If you do not know the exact name, use regex: (?i)telecom.

Region («Регион»)

The visitor's region according to the GEO database. The name is as in the database, for example California.

City («Город»)

The visitor's city according to the GEO database. The name is as in the database, for example Berlin.

IP / CIDR

The visitor's IP address. One list can mix three formats:

  • an exact address: 203.0.113.10;
  • an IPv4 mask with an asterisk per octet: 203.0.113.*;
  • a subnet in CIDR format: 203.0.113.0/24.

With the in list or = operator, the condition is met if the address matches any value. With not in list or ≠, it's met if the address matches none.

Referrer («Реферер»)

The whole Referer header, including https:// and the path. To select visits from one site, use regex: example\.com.

sub_id_1

The value of the click's sub_id_1 parameter. A value that arrived through source tokens is also counted.

Bot («Бот»)

The value is true or false. A bot is detected by User-Agent, by the hosting (data center) connection type and by your bot lists.

Proxy / DC («Прокси / ДЦ»)

The value is true or false. true means a connection through a data center, proxy, VPN or Tor. The connection type comes from the IP2Proxy database; without it the value is always false.

Protecting a stream without cloaking

In a campaign with cloaking enabled, cloaking cuts off bots and data center addresses, and also proxy, VPN and Tor when the Block proxy / VPN / Tor («Блокировать прокси / VPN / Tor») checkbox is on. Without cloaking, add two conditions joined by AND to the money stream:

  1. Bot = false.
  2. Proxy / DC = false.

Clicks that did not pass these conditions go to another matching stream or to the final one.

Tip.

The + Black («+ Чёрная») button opens a new stream window with two ready conditions: Bot = false and GEO in list with no countries. Enter the countries before saving: with an empty list such a stream will not get a single click.

Extra fields via API and import

These fields cannot be chosen in the list, but you can set them via the API or stream import. In the form, such a condition is shown with its code instead of a name and is saved unchanged.

CodeCompared with
countryThe same as geo
os_versionOS version
browser_versionBrowser version
user_agentThe whole User-Agent header
empty_referertrue if the referrer is empty, otherwise false
ad_campaign_idThe click's ad_campaign_id parameter
creative_idThe click's creative_id parameter
keywordThe click's keyword parameter
sub_id_2 … sub_id_30The value of the corresponding sub_id

Common errors

Unknown filter type or operator («неизвестный тип или оператор фильтра»)

The stream is not saved if a condition has a field the tracker does not know, or the regex or not regex operator is chosen for IP / CIDR. After the colon, the message shows the field code, for example ip. For IP / CIDR, replace the operator with in list and list the addresses, masks or subnets.

Invalid regular expression in filter («некорректное регулярное выражение в фильтре»)

The stream is not saved if a condition with the not regex operator has an expression with a syntax error. After the colon, the message shows the field code, for example user_agent. Fix the expression and check that each one is on a separate line.

A stream with a “GEO” condition gets no traffic

Check that the value field contains country codes. An in list condition with empty values lets no one through. If the codes are there, check the GEO database: without it the click's country is not determined.

The connection or “Proxy / DC” condition does not fire

The connection type is determined only when the IP2Proxy database is connected. Its status is visible to the installation owner: Settings → Bots and GEO («Настройки → Боты и гео»), the IP2Proxy block, the State («Состояние») row.

Traffic goes to 404

The click matched no stream. Add a stream of the Final («Замыкающий») type without conditions and check the distribution with the Check stream button.

Updated Need help? ↗