URL targeting is a Session Replay setting that lets you define which pages should trigger a session replay. By creating URL match rules, you can focus replay capture on the pages that matter most to you, such as your checkout flow, key landing pages, or specific user journeys. When a user visits a URL that matches your rules, Contentsquare automatically starts capturing their session for replay.
Note
The session must have been selected for replay capture by the Replay Recording Rate to be eligible for recording.
This article explains how to set up URL targeting, the match options available, and includes examples of URLs that match (or don't match) each option.
How to set up URL targeting for replays
Only users with Admin or Expert user permissions can set up URL targeting for replays.
- Click your profile icon in the top-right corner.
-
Select Projects and users.
- Go to the Replays tab.
- Use the dropdown to choose a match condition (see options below).
-
In the text field, enter the URL or URL component you want to target.
- Click Save.
To turn URL targeting on or off:
Click the toggle next to Replay targeting to enable or disable it.
URL targeting options
A URL is made up of several parts. Contentsquare checks up to five of these when matching your targeting rules:
- protocol
- domain
- path
- query strings
- fragments
You can target sessions using one of eight match conditions:f
- URL matches exactly: Targets a specific URL, including it's protocol, query string and fragment.
- URL contains: Targets any page whose URL includes the text you enter.
- URL starts with: Targets any page whose URL begins with the text you enter, including the protocol.
- URL ends with: Targets any page whose URL ends with the text you enter.
- URL does not match exactly: Targets all URLs except the one you specify.
- URL does not contain: Targets pages whose URL does not include the text you enter.
- URL does not start with: Targets pages whose URL does not begin with the text you enter.
- URL does not end with: Targets pages whose URL does not end with the text you enter.
URL targeting examples
URL matches exactly
Example URL input: https://www.example.com/pages/?x=1
| Result | Example URL | Reason |
|---|---|---|
| Match | https://www.example.com/pages/?x=1 | All URL parts match exactly. |
| No match | https://www.example.com/pages/ | The query string ?x=1 is missing |
| No match | https://www.example.com/pages/subpage | The query string ?x=1 is missing and the page path should not include /subpage |
| No match | https://www.example.com/pages/?x=1&y=1 | The URL has a non-matching query string &y=1 at the end of it |
| No match | https://www.example.com/pages/?x=1#2 | The fragment #2 means the URL is no longer an exact match. |
URL contains
Example URL input: subpage
| Result | Example URL | Reason |
|---|---|---|
| Match | https://www.example.com/subpage/info | The URL path contains subpage. |
| Match | https://www.example.com/category/product-subpage-launch/ | The word subpage appears within a path segment. |
| Match | https://www.example.com/help/?q=subpage_results | The word subpage appears in the query string. |
| No match | https://www.example.com/mainpage | The URL does not contain the exact string subpage |
| No match | https://www.example.com/SUBPAGE/details | URL matching is not case-sensitive, so SUBPAGE matches subpage |
| No match | https://www.example.com/sub-page/details | The URL contains sub-page (with a hyphen), not the exact continuous string subpage |
URL starts with
Example URL input: https://www.example.com/pages/
| Result | Example URL | Reason |
|---|---|---|
| Match | https://www.example.com/pages/ | The URL matches the target criteria exactly |
| Match | https://www.example.com/pages/subpage | The URL begins with the target criteria. The additional path segment /subpage comes after the match point. |
| Match | https://www.example.com/pages/?x=1 | The URL begins with the target criteria. The query string ?x=1comes after the match point. |
| Match | https://www.example.com/pages/?x=1&y=1 | The URL begins with the target criteria. The query string ?x=1&y=1 comes after the match point. |
| Match | https://www.example.com/pages/?x=1#2 | The URL begins with the target criteria. The query string ?x=1 and fragment #2 come after the match point. |
| No match | https://example.com/pages/ | The subdomain www. is missing. The full domain must match the target criteria exactly. |
URL ends with
Example URL input: pages/
| Result | Example URL | Why? |
|---|---|---|
| Match | https://www.example.com/pages/ | The URL ends with the matching criteria pages/ |
| Match | https://www.example.com/folder/pages/ | The URL ends with the matching criteria pages/ |
| No match | https://www.example.com/pages/subpage | The URL path does not end with pages/ |
| Match | https://www.example.com/pages/?x=1 | The URL ends with ?x=1, not pages/. Query parameters are included in the match evaluation. |
FAQs
Is Replay Targeting retroactive?
No, the targeting will only start for sessions that occur after the setting is saved.
Will URL targeting capture every session that visits my targeted pages?
Not necessarily. A session must first be selected by your plan's global Replay Recording Rate before URL targeting applies. URL targeting then controls which of those selected sessions are captured based on page rules.