URL targeting enables a Survey to show only when a user visits a specific URL. This article describes how to set up URL targeting, the available targeting options, and options to exclude certain pages from targeting.
Targeting settings can apply to either the Survey itself or to on-site invitations to a Survey. For Popover or Full-Screen Surveys, the targeting settings will determine when your Survey will appear on your site. For Link Surveys, the targeting configurations will determine where an optional Survey invite will appear on your site.
Find out more about the types of Surveys in our Types of Surveys article.
How to set up URL targeting for Surveys
1. In the setup process of your Survey, click on the Target section.
2. Within the Pages subsection, choose Specific pages and enter your URL targeting condition.
- To set up targeting based on the URL visited, see the available URL targeting options below.
3. Click Next at the bottom of the setup to review and save your changes.
Available URL targeting options
To better understand how URL targeting works, it is good to understand the components that make up a URL. Five different URL components are evaluated to target matches: protocol, domain, path, query strings, and fragments:

URL components are shown in the image above
You can choose from the following match types. Click on a match type to see a set of examples.
- Contains: Targets all pages whose URL contains the entered text.
- does not contain: Excludes all pages whose URL contains the entered text.
- Starts with: Targets all pages whose URL starts with the entered text.
- Does not start with: Excludes all pages whose URL starts with the entered text.
- Ends with:Targets all pages whose URL ends with the entered text.
- Does not end with:Excludes all pages whose URL ends with the entered text.
- Is: Targets a specific page by URL path. Ignores protocol, www, query strings, and fragments.
- Is not: Excludes a specific page by URL path. Ignores protocol, www, query strings, and fragments.
- is exactly: Targets a specific URL, including the protocol, query string, and fragment.
- Is not exactly: Excludes a specific URL, including the protocol, query string, and fragment.
- Matches regex: Targets pages using a regular expression pattern.
Note: Only the following characters are supported: a-z, A-Z,0-9, -, ., _, /, and ~. Any other characters need to be percent-encoded.
Contains
The match will be correct if the URL the user is on contains the text you specified.
Example: Contains — ?x=1
Does not contain
The match will be correct if the URL the user is on does not contain the text you specified.
Example: Does not contain — ?x=1
Starts with
The match will be correct if the URL the user is on starts exactly as you specify it, including the protocol.
Example:
Starts with - https://www.x.com/pages/
Does not start with
The match will be correct if the URL the user is on does not start with the text you specified.
Example: Does not start with — https://www.x.com/pages/
| Result | Example URL | Why? |
|---|---|---|
| No match | https://www.x.com/pages/ | The URL starts with the excluded criteria |
| No match | https://www.x.com/pages/subpage | The URL starts with the excluded criteria |
| No match | https://www.x.com/pages/?x=1 | The URL starts with the excluded criteria |
| Match | https://www.x.com/other/ | The URL does not start with the excluded criteria |
| Match | https://x.com/pages/ | The domain does not match www.x.com as specified, so it is not excluded |
Ends with
The match will be correct if the URL the user is on ends exactly as you specify it.
Example:
Ends with - pages/
| Result | Example URL | Why? |
|---|---|---|
| Match | https://www.x.com/pages/ | The URL ends with the matching criteria (pages/) |
| Match | https://www.x.com/folder/pages/ | The URL ends with the matching criteria (pages/) |
| NO MATCH | https://www.x.com/pages/subpage | The URL path does not end with pages/ |
| NO MATCH | https://www.x.com/pages/?x=1 | The URL ends in a query string (?x=1), not pages/ |
| NO MATCH | https://www.x.com/pages/?x=1&y=1 | The URL ends in a query string, not pages/ |
| NO MATCH | https://www.x.com/pages/?x=1#2 | The URL ends in a fragment (#2), not pages/ |
Does not end with
The match will be correct if the URL the user is on does not end with the text you specified.
Example: Does not end with — pages/
| Result | Example URL | Why? |
|---|---|---|
| No match | https://www.x.com/pages/ | The URL ends with the excluded criteria (pages/) |
| No match | https://www.x.com/folder/pages/ | The URL ends with the excluded criteria (pages/) |
| Match | https://www.x.com/pages/subpage | The URL does not end with pages/ |
| Match | https://www.x.com/pages/?x=1 |
The URL ends in a query string, not pages/ |
| Match | https://www.x.com/pages/?x=1#2 | The URL ends in a fragment, not pages/ |
Is
This is the default match type and is intended to be used to target a specific page on your site. The match will be correct if the URL path the user is on matches the URL path you specify. The protocol, www, query strings, and fragments are ignored if entered in the field.
Example: https://www.x.com/pages/
| Result | Example URL | Why? |
|---|---|---|
| Match | https://www.x.com/pages/ | The domain (x.com) and page path (/pages) is a match |
| NO MATCH | https://www.x.com/pages/subpage | /subpage is not part of the page path criteria |
| Match | https://www.x.com/pages/?x=1 | The query string (?x=1) is ignored |
| Match | https://www.x.com/pages/?x=1&y=1 | The query string (?x=1&y=1) is ignored |
| Match | https://x.com/pages | https://x.com/pages |
| NO match | https://www2.x.com/pages | Only www. is ignored; any other prefix or subdomain must be included |
Is not
The match will be correct if the URL path the user is on does not match the URL path you specify. The protocol, www, query strings, and fragments are ignored.
Example: Is not — https://www.x.com/pages/
| Result | Example URL | Why? |
|---|---|---|
| No Match | https://www.x.com/pages/ | The URL path matches the excluded criteria |
| No Match | https://www.x.com/pages/?x=1 | The query string is ignored; the path still matches the excluded criteria |
| No Match | https://x.com/pages |
The www. prefix is ignored; the path still matches the excluded criteria |
| Match | https://www.x.com/pages/subpage | /subpage makes it a different path — not excluded |
| Match | https://www.x.com/other/ | The URL path does not match the excluded criteria |
| Match | https://www2.x.com/pages | The subdomain (www2.) is not ignored, so this does not match the excluded criteria |
Is exactly
The match will be correct if the full URL — including the protocol, path, query string, and fragment — matches exactly what you specify.
Example: Is exactly — https://www.x.com/pages/?x=1
| Result | Example URL | Why? |
|---|---|---|
| NO MATCH | https://www.x.com/pages/ | The required query string (?x=1) is missing |
| NO MATCH | https://www.x.com/pages/subpage | The required query string (?x=1) is missing and the path includes /subpage |
| Match | https://www.x.com/pages/?x=1 | The full URL matches exactly |
| NO MATCH | https://www.x.com/pages/?x=1&y=1 | The extra query string (&y=1) does not match |
| NO MATCH | https://www.x.com/pages/?x=1#2 | The fragment (#2) does not match |
| NO MATCH | https://x.com/pages/?x=1 | The www. prefix is part of the specified URL and must be present |
Is not exactly
The match will be correct if the full URL does not match exactly what you specify, including the protocol, path, query string, and fragment.
Example: Is not exactly — https://www.x.com/pages/?x=1
| Result | Example URL | Why? |
|---|---|---|
| NO MATCH | https://www.x.com/pages/?x=1 | The full URL matches the excluded criteria exactly |
| Match | https://www.x.com/pages/ | The required query string (?x=1) is missing — not an exact match |
| Match | https://www.x.com/pages/subpage | The path and query string do not match — not excluded |
| Match | https://www.x.com/pages/?x=1&y=1 | The extra query string (&y=1) means it is not an exact match |
| Match | https://x.com/pages/?x=1 | The www. prefix is missing — not an exact match |
Matches regex
The match will be correct if the regular expression you create matches the URL your user visits. A regular expression (regex or regexp) is a unique text string used to describe a search pattern.
Wildcard examples (where * can be anything)
Example:
Target: www.example.com/pages/*
Example: (http|https):\/\/www.example.com\/pages\/.*
Example:
Target: www.example.com/pages/*/article
Example: (http|https):\/\/www.example.com\/pages\/[^\/]+\/article
Example:
Target: www.example.com/user/<user_id>/profile/(numeric user_id)
Example: (http|https):\/\/www.example.com\/user\/[0-9]+\/profile\/Wildcard excluding a certain pattern
Example:
Target: All pages which match the pattern but do not include the word "article" or "post" www.example.com/pages/*/subpage
Example: (http|https):\/\/www.example.com\/pages\/(?!article|post)[^\/]+\/subpageExcluding certain words or patterns in a URL
Example: Target: Pages which include the word "page" and do not include "somepage":
Example: (?=.*page.*)(?!.*somepage).*Multiple pages that don't follow any pattern
Example: Target these three pages:
- www.example.com/pages/article-one/details/
- www.example.com/pages/some-random-word/details/
- www.example.com/pages/another-post/details/
Example: (http|https):\/\/www.example.com\/pages\/(article-one|some-random-word|another-post)\/details\/Does not mach regex
The match will be correct if the URL the user is on does not match the regular expression pattern you create. Use this to exclude sets of pages that follow a pattern.
Example: Exclude all pages under /admin/:
(http|https):\/\/www.example.com\/admin\/.*Any URL that does not match this pattern will be targeted.
How to exclude pages using negated rules
To exclude a page, add a new rule and select a negated match type such as Does not contain, Is not, Does not start with, etc.
Note
Negated rules always take priority over included rules, regardless of the order they are added. At least one include rule is required, you cannot use negated rules alone.
Example: To show a survey on all pages under /checkout/ except /checkout/confirmation/:
- Rule 1: Starts with → https://www.x.com/checkout/
- Rule 2: Does not contain → /confirmation/
Because the negated rule takes priority, the survey will appear on all /checkout/ pages except those containing /confirmation/ in the URL.