/Docs

Geographic Targeting

Geographic targeting lets you limit an experiment to visitors from a specific country, or visitors whose browser is set to a particular language. Use it to run localized experiments, test country-specific promotions, or validate that a change works well for your largest markets before rolling it out globally.

Country targeting

A vs B can determine the country a visitor is connecting from. In the Audience Builder, add a condition of type Country and select one or more countries from the list. You can use the Is operator to include specific countries or Is Not to exclude them.

Example countries

A vs B supports targeting for all countries. Some common examples:

  • United States (US)
  • United Kingdom (GB)
  • Canada (CA)
  • Germany (DE)
  • France (FR)
  • Australia (AU)
  • Japan (JP)
  • Brazil (BR)
  • India (IN)
  • Mexico (MX)

Countries are identified by their two-letter ISO 3166-1 alpha-2 code. The Audience Builder shows country names for easy selection — you do not need to remember the codes.

Language targeting

Language targeting targets visitors whose browser language matches the value you select. This is determined by the visitor's browser language preference, not by geo-location. A visitor in Germany whose browser is set to English will match an English language condition, not a German one.

In the Audience Builder, add a condition of type Language and enter or select a language code. Common language codes:

  • en — English
  • es — Spanish
  • fr — French
  • de — German
  • pt — Portuguese
  • ja — Japanese
  • zh — Chinese
  • it — Italian
  • nl — Dutch
  • ko — Korean
Language codes match browser.language
The language value is read from navigator.languagein the visitor's browser. This typically returns a two-letter code like en, but may sometimes include a regional variant like en-US or en-GB. A vs B matches on the primary language code (the part before the hyphen), so a condition for en will match both en-US and en-GB.

How geo data is fetched

When the A vs B snippet loads on a visitor's browser, it makes a lightweight request to the /v1/geoendpoint. This endpoint is served by A vs B's edge infrastructure, which determines the visitor's country based on their IP address. The country code is returned in the response and stored in memory for the duration of the page session.

This lookup is fast — it runs in parallel with experiment initialization — but it does introduce a small network request. If the geo lookup has not completed by the time an experiment is evaluated, the country condition will be treated as unknown and the visitor will not be enrolled. In practice, the lookup completes before any visible content loads.

Common use cases

Country-specific promotions

Testing a Black Friday banner for US visitors only? Add a Country condition of United States to your audience so the promotional variation is only shown to US traffic. Visitors from other countries continue to see the control.

Localized experiments

If you are testing translated copy for your French market, use a Country = France condition (or a Language = French condition, depending on which is more appropriate) to ensure only the right visitors see the French-language variation.

Regional rollout validation

Before rolling out a major change globally, run the experiment in a single region first. Target one or two countries to gather initial data and validate the change works as expected, then remove the country condition to expand to all visitors.

Tip
Combine country and language targeting for precision. For example, Country = Canada AND Language = French will target French-speaking Canadians specifically — useful if your site has a separate experience for Quebec.