TestaDocs
Docs/Experiment Setup/Split URL tests

Split URL tests

A split URL test sends part of your traffic to a different URL - the variation - and compares it against the control, which is the page as it is today. Use it when the variation is a separate page rather than an edit to the current one. You set up the control and the variations together in the same step.

Control URL match types

The control has a target URL and a match type. The match type decides which pages are eligible to enter the experiment.

  • Exact - the experiment runs when the origin and path of the page URL match the target URL. Enter the target as a full URL including the origin, for example https://example.com/pricing - a path on its own, such as /pricing, never matches. Query parameters are treated separately: any extra parameters on the visitor's URL are ignored, so a visitor arriving with tracking parameters still enters the experiment. If the target URL itself includes parameters, those must be present on the page URL with the same values.
  • Contains - the experiment runs on any page whose URL contains the target value. Use this when one experiment should cover a group of pages, for example every URL under /product/.
  • Regex - the experiment runs when the regular expression you provide matches the page URL. The pattern is tested against the full URL, including the origin, so a pattern like /blog/(\d+) still works. Use this for advanced patterns, such as matching several related paths at once, or when you need to capture part of the URL and reuse it in the variation.
  • Site-wide - the experiment runs on every page of the site, with no specific URL to match.

Variation destination URLs

Each variation has its own destination URL and a match type that controls how that URL is built when a visitor is redirected.

  • Exact - the variation URL is used as the destination. Enter it as a full URL including the origin. Query parameters on the current URL are carried over, and the variation's own parameters win on conflict.
  • Contains - the matched part of the current URL is replaced with the variation value, and the rest of the URL is preserved.
  • Regex - the variation URL is a template. Capture groups from the control pattern are inserted using $1, $2, and so on. The template becomes the whole destination path, so include every part of the path you want to keep - anything you leave out is dropped. The origin and any current query parameters are preserved.
  • Query - no separate destination page. The visitor stays on the same URL and the parameters you specify are added to it. Query is available on variations only; it is not a targeting option for the control.

Examples

Each example lists the control and variation you configure, then shows where a sample visitor is sent.

  • Swap one page for another (Contains → Contains) — control contains(/quiz), variation contains(/aab-quiz-1). A visitor on https://example.com/quiz?utm_source=ads is sent to https://example.com/aab-quiz-1?utm_source=ads. Only the matched part is rewritten; the rest of the URL, including the query string, is kept.
  • Send all matching traffic to one page (Exact → Exact) — control exact(https://example.com/pricing), variation exact(https://example.com/pricing-b). A visitor on https://example.com/pricing?utm_source=google is sent to https://example.com/pricing-b?utm_source=google. Everyone lands on the same destination, and the visitor's query parameters are carried over.
  • Dynamic URL matching (Regex → Regex) — control regex(/account/([^/]+)/overview), variation regex(/account/$1/overview-v2). A visitor on https://example.com/account/a1b2c3/overview is sent to https://example.com/account/a1b2c3/overview-v2. A dynamic part of the URL - here the user hash a1b2c3 - is captured with (...) and reused in the destination with $1.
  • Add a parameter without leaving the page (Query) — control exact(https://example.com/checkout), variation query(variant=b). The visitor stays on https://example.com/checkout?utm_source=ads, now with the parameter added: https://example.com/checkout?utm_source=ads&variant=b.

Watch for redirect loops

Make sure the destination no longer matches the control target. With a Contains or Regex control, if the redirected URL still matches, the visitor lands on a page that matches again and is redirected once more - an endless loop. For example, a contains(/quiz) control that redirects to /quiz-v2 still contains /quiz, so it keeps redirecting. Point the variation at a value the control can no longer match.

Common setup problems

  • Variation flicker. The original page briefly appears before the visitor is redirected. Make sure the anti-flicker snippet is the first script in the <head>, before anything else loads. The full snippet and installation steps are in Integration.
  • Variation not applying. Confirm the page URL actually matches the target, and that no rule is excluding the visitor. Common causes: an Exact target of https://example.com/pricing/ while visitors land on https://example.com/pricing without the trailing slash; a targeting rule that restricts the experiment to a country or device that does not match the browser being tested; or traffic allocation set below 100 percent, where the visitor was assigned to the excluded group. That exclusion is stored for 30 days, so a browser that was excluded once will keep seeing the original page.
  • Exact match too strict. An exact match fails when the URL carries a trailing slash that was not part of the target, or when the target URL includes a query parameter that the visitor's URL does not. Use Contains when the same page can be reached through more than one path.
  • Unescaped regex. A regular expression that is not written correctly can match more or fewer pages than intended. Test the pattern against real URLs before publishing.