ABConvert Knowledge Base
  • Welcome to ABConvert
  • Getting started
    • ABConvert - Getting Started
    • ABConvert - How the Script Works
    • Use Cases
      • đź’°Price Test Use Cases
      • 📦Shipping Test Use Cases
      • đź§©Template Test Use Cases
      • 🎨Theme Test Use Cases
      • đź’łCheckout Test Use Case
      • đź”—URL Redirect Test Use Cases
      • ⚙️Advanced Options Use Cases
    • Best Practices
      • 🚦Test Design
  • Case Studies
    • How Smartwatchmagazijn Drove €10,000+ Monthly Growth Through A/B Testing
  • Price tests
    • Price Tests - Getting Started
    • Price Tests - How To Set Up
  • Shipping tests
    • Shipping Tests - Getting Started
    • Shipping Tests - How to Set Up
    • Shipping Tests - QA Checklist
    • Shipping Tests - Shipping Rates Mechanism
  • URL Redirect tests
    • URL Redirect Tests - Getting Started
    • URL Redirect Tests - How to Set Up
    • URL Redirect Tests - Trigger Conditions
  • URL Redirect Tests - QA Checklist
  • Template tests
    • Template Tests - Getting Started
    • Template Tests - How to Set Up
  • Theme tests
    • Theme Tests - Getting Started
    • Theme Tests - How to Set Up
  • Theme Tests - QA Checklist
  • Checkout tests
    • Checkout Tests - Getting Started
    • Checkout Tests - How to Set Up
  • Third Party App Integration
    • Third Party Integration List - Duplicate Variant Price Tests
    • Third Party Integration List - Cart Transform Price Tests
    • Page Builder Apps - Template Tests
  • Analytics
    • ABConvert Analytics Definition
    • Analytics Discrepancies
    • Statistical Significance Interpretation
  • More Resources
    • Changelog
    • FAQs
    • Submit User Feedback
  • Developer Resources
    • How to Access the A/B Test Group Index for Custom Code Injection
    • Shipping Test Event Listeners
Powered by GitBook
On this page
  • Understanding URL Structure
  • URL Matching Patterns
  • Starts with, Ends with
  • Matches Exactly
  • Contains
  • Matches Regex Exactly
  • Common Regex
  • Comparison Chart
  • Best Practices
  • Troubleshooting
  1. URL Redirect tests

URL Redirect Tests - Trigger Conditions

This article will explain how to use URL matching patterns for your URL redirect experiments.

PreviousURL Redirect Tests - How to Set UpNextURL Redirect Tests - QA Checklist

Last updated 5 months ago

Understanding URL Structure

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:

  • Path: /products/category/item

  • Query parameters: ?color=blue

  • Fragment: #details

URL Matching Patterns

ABConvert supports several URL matching patterns for redirect tests:

Starts with, Ends with

Matches URLs that start or end with the specified string. Ignores query parameters and fragments.

Example: /products

Will match:

Matches Exactly

Matches the entire URL exactly, including query parameters.

Example: /products?color=red

Will only match that exact URL.

Contains

Matches URLs that contain the specified string anywhere.

Example: products/shoes

Will match:

Matches Regex Exactly

Allows complex pattern matching using regex.

Example: ^https:\/\/www\.example\.com\/products\/[a-z-]+$

Will match:

But NOT:

Common Regex

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

Comparison Chart

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

Best Practices

  • 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

Troubleshooting

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.

https://www.example.com/products
https://www.example.com/products/shoes
https://www.example.com/products?color=red
https://www.example.com/products/shoes
https://www.example.com/all-products/shoes/running
https://www.example.com/products/shoes
https://www.example.com/products/t-shirts
https://www.example.com/products/123
https://www.example.com/products/shoes?color=red
www.example.com