# Filters

One of Keitaro's key features is traffic filtering, which allows you to set conditions to redirect users to different pages or offers.

Keitaro provides flexible and powerful traffic management tools, allowing to customize redirection conditions based on multiple parameters. It helps to use traffic more efficiently, improve conversions, and achieve goals in marketing campaigns.

When thinking through and setting up a filter scheme, it is important to consider types of flows used

# Logical relation (AND/OR)

If there is more than one filter, you must select the filter logical relation AND or OR to determine the operation scheme.

# Logical relation — AND

With the AND logical relation, a click will be able to get to the flow only if it meets all the filter conditions

In this case, the click will go to the flow if the search engine is defined as Google and the value of the sub_id_1 parameter in the link is Keitaro.

If any of the parameters differ from the specified conditions, the click will not go to the flow and will not see the content, continuing to move further along the flow scheme according to flow rotation.

# Logical relation — OR

With the OR logical relation, the user will be taken to the flow if any one condition from the set filters is met

Clicks with both the Google search engine and the sub_id_1 parameter value are allowed in the Keitaro link.

# Switch "IS" and "IS NOT"

Almost every filter type has a switch with "IS" and "IS NOT" values.

# IS (allow)

Means that a click must have this feature to go to the flow.

For example, in this case, only those clicks whose location is defined as Australia will pass through the flow

# IS NOT (block)

Means that a click must not have this feature to go to the flow.

For example, with this filter setting, flows will be included in clicks from all countries except Australia

# Example

Let's consider a case where it is required:

  • Filter out bots.
  • Sending traffic to user 1 and user 2 in different flows.
  • Filter out clicks that were not made from a traffic source.

Setting option:

The first flow of the Forced type that will collect bot clicks and clicks with an empty source parameter. Please note, for receiving parameters from a source in the tracker, you need to configure the source in the tracker.

After this, two separate flows of the Regular type were established for each user's traffic. The rotation is based on the presence of a parameter with the user's name in the link. In this case, it is user_1 or user_2.

We will direct all the remaining after the filter to the Default flow. This is not a requirement and the flow does not need to be used if it is allowed.

# Filter by regular expression or empty value

Filters support masks, regular expressions, and the @empty meta word to filter empty values in campaign flows.

To filter by partial match, use masks or regular expressions with /regex/ between the characters.

# Using masks in filters

To filter by partial inclusion, use masks:

* - any numbers; ? — any one digit; - — interval.

Examples:

*keyword — any content before the keyword;

keyword* — any content after keyword;

*keyword* — any content before and after keyword;

keyw*d — any content between words.

# Date between

Specify the dates and time zone in which the flow works or does not work.

"IS" accepts clicks to a flow at the dates specified in the filter.

"IS NOT" accepts clicks to a flow EXCEPT the dates in the filter.

# Timetable

Allows you to schedule flows by day of the week, time, and time zone.

"IS" accepts clicks to a flow at the time specified in the schedule.

"IS NOT" accepts clicks to a flow EXCEPT the time in the schedule.

# Limit clicks

Limits flows to a certain number of clicks at a given time. Specify the number of clicks per hour, over the last 24 hours or total. Once the limit is reached, the flow will not allow any new clicks.

The filter works as follows: the filter checks whether the limit has been reached in the last hours set in the condition, counting from the moment the flow is clicked.

If the condition is set to 10 clicks per hour, and a click is received at 13:15, a check is performed — the time of the received click is 13:15 minus 1 hour.

  • From 12:15 to 13:15 10 clicks were not received — a new click will go to the flow.
  • From 12:15 to 13:15 10 clicks have already been received — a new click will not go through to the flow.

# Parameter

Filtering by the parameter received in the request. You can use custom parameter names specified in the parameters tab for a given campaign.

If a new name is specified for the name parameter in campaign parameters section, you can use the specified name in the flow filter or the default name of the tracker parameter. For example, in this case, checking the value by the name of the parameter sub_id_3 and name works

Example of using a filter:

  1. In the Filters section, select the Parameter filter.
  2. In the "parameter" field, specify the parameter name listed in the second column or the default value sub_id_#.
  3. In the input field, enter the parameter value that needs to be included in or excluded from the flow.

  1. With this setup, a click will be accepted into the flow only if the URL contains name=1.

The filter works on a strict matching. If partial matches are needed, use masks or regular expressions.

"IS" accepts clicks on the flow WITH the specified parameter value.

"IS NOT" accepts clicks on the flow WITHOUT the specified parameter value.

# Referrer

Filtering by the received referrer. An example of using a mask: *google* for the referrer http://google.com/search?q=123.

"IS" accepts clicks WITH the specified referrer to the flow.

"IS NOT" accepts clicks on the flow WITHOUT the specified referrer.

# X-Requested-With

Filter by the contents of the X-Requested-With http—request header.

"IS" accepts clicks WITH the specified header to the flow.

"IS NOT" accepts clicks on the flow WITHOUT the specified header.

# Site

Filter by data on source sites. It is taken from the referrer or from the source, utm_source parameters.

"IS" accepts clicks WITH the specified source to the flow.

"IS NOT" accepts clicks on the flow WITHOUT the specified source.

# Keyword

Filter by keywords. The data is taken from the keyword parameter.

Masks, regular expressions and the meta word @empty (for selecting empty values) are supported. The filter works on a strict matching. If partial matches are needed, use masks or regular expressions.

"IS" accept clicks WITH the specified keyword to a flow.

"IS NOT" accepts clicks on the flow WITHOUT the specified keyword.

# Search engines

Filter by search engines. The data is taken from the user—agent of a click. Masks and regular expressions are available.

"IS" accepts clicks on the flow WITH the specified search engine.

"IS NOT" accepts clicks on the flow WITHOUT the specified search engine.

# Ad Campaign ID

Filter by advertising campaign IDs. The data is transferred with a click from the source. Masks and regular expressions are available.

"IS" accepts clicks WITH the specified advertising campaign ID to a flow.

"IS NOT" allows clicks on the flow WITHOUT the specified advertising campaign ID.

# Creative ID

Filter by creative ID. The data is transferred with a click from the source. Masks and regular expressions are available.

"IS" accepts clicks WITH the specified creative ID to the flow.

"IS NOT" allows clicks on the flow WITHOUT the specified creative ID.

# Empty referrer

Filter by empty referrer.

"IS" accepts clicks on the flow WITH an empty referrer.

"IS NOT" accepts clicks WITH a filled referrer on the flow.

# Proxy

Checking whether the user is using a proxy server. Checking occurs using HTTP—headers. Proxy servers add their own headers, which allow you to determine the presence of proxying, but it is impossible to calculate all proxies based on headers.

For a more accurate check, you need to connect an additional geo-database IP2Location PX2.

"IS" accepts clicks to the flow WITH signs of using a proxy.

"IS NOT" allows clicks on the flow WITHOUT signs of using a proxy.

# City

Cities must be selected from the drop—down list or entered manually in English. The list includes cities with a population of more than 500,000.

"IS" accepts clicks FROM the specified cities to a flow.

"IS NOT" accepts clicks FROM ALL cities EXCEPT those specified.

# States/Regions

It is possible to select from a list. The region codes differ for each geo—base. After changing the database in Maintenance — Geobases — Settings, you need to re-configure the filter by region.

"IS" lets clicks FROM the specified regions pass through the flow.

"IS NOT" accepts clicks FROM ALL regions EXCEPT those specified.

# Country

You can select countries from the list. To quickly fill in many countries, create a list of country codes, separating the values ​​with a space, for example, "RU UA KZ" and paste it into the values ​​section.

WARNING

The countries are determined based on geo databases installed in your tracker, which collect data from the RIPE registry. Take this into account when setting up a filter for disputed territories (for example, Kosovo).

"IS" accepts clicks FROM the specified countries to a flow.

"IS NOT" accepts clicks FROM ALL countries EXCEPT those specified.

# IP

Filter by IP addresses. To enter a list of values, separate the addresses with semicolons and paste them into the filter. For example: 1.2.3.0; 2.2.2.0; 5.2.3.0 IPv4 and IPv6 filtering is supported.

"IS" accepts clicks WITH the specified IP to the flow.

"IS NOT" allows clicks on the flow WITHOUT the specified IP.

Supported: masks, intervals, CIDR and regular expressions
  • Masks

Add the * character to the search phrase to include any content at the specified location.

Examples:

168.102.233.* — addresses from 168.102.233.0 to 168.102.233.255.

168.102.233.22? — addresses from 168.102.233.220 to 168.102.233.229.

168.102.233.100-150 — addresses from 168.102.233.100 to 168.102.233.150.

  • Intervals

Example:

168.102.233.100 — 168.102.233.150 — addresses from 168.102.233.100 to 168.102.233.150.

  • CIDR

Example:

192.168.2.0/24 — addresses from 192.168.2.0 to 192.168.2.255.

To convert the interval to CIDR or conversely, use the service http://www.ipaddressguide.com/cidr.

  • Regular expressions

# IPv6

Click filter with IPv6 addresses.

"IS" accepts clicks with IPv6 to the flow.

"IS NOT" accepts clicks on the flow with IPv4.

# Mobile operator

Select from the list of available ones. The operator's data is taken from the user—agent of a click.

"IS" accepts clicks on the flow WITH the specified mobile operators.

"IS NOT" accepts clicks on the flow WITHOUT the specified mobile operators.

# ISP

Filter by internet providers.

"IS" accepts clicks on the flow WITH the specified internet providers.

"IS NOT" lets clicks through the flow WITHOUT the specified internet providers.

WARNING

Works if you have a Keitaro Geo database or IP2Location ISP.

# Uniqueness

Checking the user's uniqueness. Occurs over IP or IP and user—agent + Cookies, depending on the selected campaign settings.

Verification options:

  • For flow — the user is unique in the current flow.
  • For campaign — the user is unique for the entire campaign.
  • For all campaigns — the user is unique within all tracker campaigns.

The user becomes unique again after the Uniqueness Period set in the campaign settings has expired. The period is counted from the moment of the first click.

"IS" allows the unique clicks into the click flow.

"IS NOT" to accept non—unique clicks into the click flow.

# Bot

Filter by tracker bot database. To add values for checking the filter, go to Maintenance — Settings — Bots.

"IS" allows bot clicks through the flow.

"IS NOT" allows not identified clicks as bots to pass through the flow.

How to filter bots in a flow?

# Connection type

If you have a database, the following options are available. For example, Dialup, cable, DSL, corporate and mobile networks. If not available, you can choose between "mobile network" and "wifi".

"IS" accepts clicks to the flow WITH the specified connection types.

"IS NOT" allows clicks to pass through the flow WITHOUT the specified connection types.

# Browser

Filter by browser. List entry and manual entry are available. The data is taken from the user—agent of the click.

"IS" accepts clicks on the flow WITH the specified browsers.

"IS NOT" allows clicks on the flow WITHOUT the specified browsers.

# Browser version

Filter by browser version. The data is taken from the user—agent of the click.

"IS" accepts clicks on the flow WITH the specified browser versions.

"IS NOT" allows clicks on the flow WITHOUT the specified browser versions.

# Device model

Filter by device model. List entry and manual entry are available. The filter works on a loose match, enter "iPhone" to display iPhone 5, 6, 6 Plus and others. The data is taken from the user—agent of the click.

"IS" accepts clicks from the specified models to the flow.

"IS NOT" accepts clicks from ALL models EXCEPT those specified.

# Device type

Filter by device type. Available options: desktop, mobile phone, tablet, game console, player, TV, smart display, camera, car browser or unknown. The data is taken from the user—agent of the click.

"IS" accepts clicks from the specified device types to a flow.

"IS NOT" accepts clicks from ALL types of devices EXCEPT those specified.

# OS

Filter by operating systems. The data is taken from the user—agent of the click. List entry and manual entry are available. Regular expressions and masks are supported.

"IS" accepts clicks from the specified operating systems to the flow.

"IS NOT" accepts clicks from ALL operating systems EXCEPT those specified.

# OS version

Filter by operating system versions. The data is taken from the user—agent of the click.

"IS" accepts clicks from the specified versions of operating systems onto the flow.

"IS NOT" accepts clicks from ALL versions of operating systems EXCEPT those specified.

# UserAgent

The filter based on data received from the user—agent of the click works on a strict matching. If a partial match is required, masks or regular expressions must be used.

"IS" accepts clicks on the flow WITH the specified UserAgent data.

"IS NOT" allows clicks on the flow WITHOUT the specified UserAgent data.

# Languages

Filter by languages ​​installed in the browser or app. The data is taken from the user—agent of the click.

"IS" accepts clicks WITH the specified languages ​​to the flow.

"IS NOT" accepts clicks through the flow WITHOUT the specified languages.

# Sub ID 1 - Sub ID 30

Filtering by incoming parameters sub_id_1..30. If a campaign has a selected traffic source, the name of the source parameter can also be used in the filter name.

"IS" accepts clicks to the flow WITH the specified Sub ID data.

"IS NOT" accepts clicks on the flow WITHOUT the specified Sub ID data.

# Filters FAQ

How to test filters?
How to check the way the click went through the filters?
How to use masks?

* — any numbers; ? — any one digit; - — interval.

Examples:

*keyword — any content before the keyword;

keyword* — any content after keyword;

*keyword* — any content before and after keyword;

keyw*d — any content between words.

How to search for empty values?

Use the meta word @empty.

How to use regular expressions?

The regular expression is wrapped in slashes, for example, /pattern[0-9]+/. PCRE Compatible Regular Expressions are supported.