URL Redirect Tests - Trigger Conditions
This article will explain how to use URL matching patterns for your URL redirect experiments.
Last updated
This article will explain how to use URL matching patterns for your URL redirect experiments.
Last updated
Before setting up URL matching, it's helpful to understand the basic structure of a URL:
https://www.example.com/products/category/item?color=blue#details
Protocol: https://
Domain: www.example.com
Path: /products/category/item
Query parameters: ?color=blue
Fragment: #details
ABConvert supports several URL matching patterns for redirect tests:
Matches URLs that start or end with the specified string. Ignores query parameters and fragments.
Example: /products
Will match:
Matches the entire URL exactly, including query parameters.
Example: /products?color=red
Will only match that exact URL.
Matches URLs that contain the specified string anywhere.
Example: products/shoes
Will match:
Allows complex pattern matching using regex.
Example: ^https:\/\/www\.example\.com\/products\/[a-z-]+$
Will match:
But NOT:
Pattern
Description
Example
^
Matches the start of a string
^https://
matches URLs starting with https://
$
Matches the end of a string
\.html$
matches URLs ending with .html
.
Matches any single character
a.c
matches "abc", "a1c", "a@c", etc.
*
Matches zero or more of the preceding character
ab*c
matches "ac", "abc", "abbc", etc.
+
Matches one or more of the preceding character
ab+c
matches "abc", "abbc", but not "ac"
?
Matches zero or one of the preceding character
colou?r
matches "color" and "colour"
\d
Matches any digit (0-9)
\d{3}
matches any three-digit number
\w
Matches any word character (a-z, A-Z, 0-9, _)
\w+
matches any word
\s
Matches any whitespace character
\s+
matches one or more spaces, tabs, or newlines
{n,}
Matches n or more occurrences of the preceding character
\d{2,}
matches two or more digits
{n,m}
Matches between n and m occurrences of the preceding character
\d{2,4}
matches between two and four digits
Here's a table using the URL https://abconvert-ob-test.myshopify.com/collections/all
to demonstrate different match types:
URL Pattern
Starts With
Ends With
Matches Exactly
Matches Regex Exactly
Contains
/collections
V
X
X
X
V
/collections/all
V
V
V
V
V
collections
X
X
X
X
V
^https:\/\/abconvert-ob-test\.myshopify\.com\/collections\/[a-z]+$
(Regex)
X
X
X
Matches /collections/all
X
Start with simple matching when possible
Use Starts with
or Ends with
for pages with important query parameters
Test your matching patterns before launching the experiment
If your URL matching isn't working as expected:
Double-check for typos in your URL patterns
Ensure you've selected the correct matching method
Test with multiple sample URLs to verify the pattern
Use the ABConvert preview mode to test matching in real-time
By mastering URL matching patterns, you'll be able to set up precise and effective URL redirect tests across your website. Remember to monitor your tests closely and analyze the results to make data-driven decisions about your page variations.
If you have any questions or feedback, feel free to email support@abconvert or reach out through the in-app support widget.