Configure URL Targeting in the Web Analytics and Management module. This allows you to specify the pages to run the experiments. URL Targeting helps in targeting a particular or a group of URLs with the options specified.
Including and Excluding URLs
In the URL Targeting section, you can include the URL and specify the match type, in which the experiment has to run. If the experiment has to run on multiple pages, then click on the ⊕ button for extra fields.
Use Include URLs and Exclude URLs to specify pages to include in, or exclude from the target group.
Setting URL Types
URL you enter can be matched with any of these types:
- Simple Match- This is the default match type and targets a page on your site. This URL match type ignores query parameters and string fragments.
- Exact Match- This URL match type includes query strings and fragments. The URL should be identical to the one specified.
- Regex- Regular expression or regex is used to target multiple and complicated URLs by providing a pattern to match the URLs.
- Substring- Matches all pages that contain the specified substring or text.
Let’s explore in detail and understand the different URL match types
Simple Match
This is the default match type and is used for targeting a single page site. The experiment runs on a particular page when the URL specified is matched.
Simple match ignores the following parts in the URL:
- Query Parameters
- Hash or Anchor tags
- Protocol and trailing slashes (http, https)
- Presence/Absence of WWW in the URL
Example
Let us consider the URL: http://test.com
MATCH | https://test.com |
MATCH | http://test.com |
MATCH | http://test.com?query=true |
MATCH | https://test.com/#pages |
MATCH | http://www.test.com |
Simple match considers the following:
- Subdomains
- Subdirectories
- File extensions (.html, .php,etc.)
Example: http://app.test.com
MATCH | https://app.test.com |
NO MATCH | http://test.com |
NO MATCH | http://app.test.com/index.php |
NO MATCH | http://app.test.com/freshmarketer |
NO MATCH | http://test.com/freshmarketer |
NO MATCH | http://docs.test.com |
Exact Match
Exact match matches the URL exactly with the target URL.
The Experiment runs only if the exact match of the URL gets hit.
An exact match doesn’t ignore any part of the URL
Example:
NO MATCH | http://test.com |
NO MATCH | http://test.com/blog |
NO MATCH | http://test.com/promo?utm=twitter |
NO MATCH | http://test.com/promo/subpage |
NO MATCH | http://test.com/promo/#pages |
MATCH | http://test.com/promo |
NO MATCH | http://docs.test.com/promo |
The exact match may come in handy when you need to exclude a page with a particular query or hashtag(anchor tags)
Example:
URL: Simple Match: http://test.com
Exclude URL (Exact Match): http://test.com?query=false
Substring
Substring - targets the URL with substring present. (ie) The experiment will run on URL with the substring being present in it.
Substring option consists of two parts.
Base domain represents the base URL of the website.
To provide the actual base domain name, select Domain is from the subtype.
To provide a keyword present in the base domain, select Domain contains from the subtype.
Contains represents the substring to search for in URL leaving the base URL.
All marketing campaigns have UTM trackers associated with this. Substring match helps in filtering out one particular campaign and run the experiment on that page.
This will help in identifying the specific campaigns’ insights into the data.
Example :
URL: Domain is - http://test.com Substring - app
MATCH | http://test.com/app |
MATCH | http://test.com/app?query=true |
NO MATCH | http://app.test.com |
MATCH | http://test.com?query=app |
URL: Domain contains- test.com Substring – app
MATCH | http://docs.test.com/app |
MATCH | http://test.com/app |
NO MATCH | http://test.com |
NO MATCH | http://app.test.com |
Regex
Regular expressions (RegEx) is used to define a set of pages on which an experiment should run. For instance, to target all pages in a site - www.example.com, you can use the regular expression
NOTE: To properly utilize and take advantage of regex, knowledge on how it works is required. Your webmaster can help you set up a regular expression, based on your requirements.
For a more detailed explanation of Regular Expressions and some important usage examples, please read this article.