TestaDocs
Docs/Experiment Setup/Advanced traffic targeting

Advanced traffic targeting

On an experiment's Advanced Settings - alongside the experiment URL and traffic settings - you decide who takes part using two kinds of rules:

  • Targeting rules - who is included in the experiment.
  • Exclusion rules - who is left out, even if they match your targeting.

All rules are evaluated in the visitor's browser as the page loads, so each visitor is assigned instantly and stays on the same variation throughout their visit.

Targeting rules

Targeting rules define who is eligible: a visitor must match them to enter the experiment. The available targeting options:

RuleMatch typesExample
Device typeis · is notDevice is mobile
Region (country)is · is notCountry is United States
UTM Sourceis · is not · contains · doesn't containUTM Source is google
UTM Mediumis · is not · contains · doesn't containUTM Medium is cpc
UTM Campaignis · is not · contains · doesn't containUTM Campaign contains black_friday
UTM Termis · is not · contains · doesn't containUTM Term is running_shoes
UTM Contentis · is not · contains · doesn't containUTM Content is header_cta
UTM Keywordis · is not · contains · doesn't containUTM Keyword contains shoes

Device and country are detected automatically; UTM values are read from the visitor's URL.

Targeting runs once, on page load

Targeting rules are applied on the initial page load. Even if the browser state changes during the session (e.g. utm_source parameter gets dropped) the visitor can still get included in the experiment.

Exclusion rules

Exclusion rules keep specific visitors out, even if they match your targeting. There are two kinds.

General exclusions

Exclude visitors by the page URL or a cookie:

RuleMatch typesExample
URLexact · contains · doesn't contain · regexURL contains /admin
Cookiecontains · doesn't contain · regexCookie contains staff=1

Cookie exclusions don't support the exact match type.

Experiment exclusions

Exclude anyone already in another experiment, so two tests never overlap (mutually exclusive tests). You just pick the experiment(s) to exclude - there's no match type to set.

Exclusions are checked on every page load

Unlike targeting, exclusions run on-demand. They are checked each time a visitor loads an experiment page. Ultimately, visitor exclusion is determined by their browser session state at the moment of evaluation.

Using multiple targeting and exclusion rules

When you add several rules, Testa combines them like this:

  • Targeting, same attribute → OR. Two country rules (US, CA) mean US or CA.
  • Targeting, different attributes → AND. A device rule and a country rule must both pass.
  • Any exclusion match → out. If a visitor matches any exclusion rule, they are excluded - even if they passed targeting.

Worked example. Say you set:

  • Targeting: Device is mobile, Device is tablet, Country is US, Country is CA
  • Exclusions: URL contains /admin, Cookie contains staff

A visitor enters the experiment only if they are (mobile or tablet) and in the (US or CA) - and not on a URL containing /admin, and without a staff cookie. So a mobile visitor from the US enters; a desktop visitor, a UK visitor, or a staff member with the staff cookie does not.