Our page targeting options allow you to activate specific Hotjar features on specific pages of your site. To do this, you can use one of our six URL targeting options (and you can also use a virtual page view)
URL Targeting
To better understand how URL targeting works, it is good to also understand what components form a URL:
Components of a URL
We offer six types of URL targeting:
- Simple Match: This is the default match type and is used to target a page on your site, ignoring any query strings and fragments as well as protocol, http vs https, and the presence or not of 'www'.
- Exact Match: Targets a specific URL, including the protocol, which can include a query string and fragment.
- Starts With: Target all pages that have a URL, including the protocol, which starts with the entered text;
- Ends With: Target all pages that have a URL which ends in the entered text;
- Contains: Target all pages which contain the entered text;
- Regular Expression: A regular expression, regex or regexp for short, is a special text string for describing a search pattern.
Simple Match:
This is the default match type and is intended to be used to target a page on your site. The match will be correct if the URL path your visitor is on matches the URL path you specify.
Note
Query strings and fragments are ignored if entered in the field
Example:
Simple Match - http://www.x.com/pages/
Result | Example URL |
MATCH | http://www.x.com/pages/ |
NO MATCH | http://www.x.com/pages/subpage |
MATCH | http://www.x.com/pages/?x=1 |
MATCH | http://www.x.com/pages/?x=1&y=1 |
MATCH | http://www.x.com/PAGES |
MATCH | http://www.x.com/pages/?x=1 |
MATCH | https://www.x.com/pages/ |
MATCH | http://x.com/pages |
MATCH | https://x.com/pages/ |
Exact Match:
The match will be correct if the URL path, query string, and fragment your visitor accesses matches EXACTLY with the ones you specify.
Example:
Exact Match - http://www.x.com/pages/?x=1
Result | Example URL |
NO MATCH | http://www.x.com/pages/ |
NO MATCH | http://www.x.com/pages/subpage |
MATCH | http://www.x.com/pages/?x=1 |
NO MATCH | http://www.x.com/pages/?x=1&y=1 |
NO MATCH | http://www.x.com/pages/?x=1#2 |
NO MATCH | https://www.x.com/pages/?x=1 |
Starts With:
The match will be correct if the URL your visitor is on starts exactly as you specify it, including the protocol.
Example:
Starts with - http://www.x.com/pages/
Result | Example URL |
MATCH | http://www.x.com/pages/ |
MATCH | http://www.x.com/pages/subpage |
MATCH | http://www.x.com/pages/?x=1 |
MATCH | http://www.x.com/pages/?x=1&y=1 |
MATCH | http://www.x.com/pages/?x=1#2 |
NO MATCH | https://www.x.com/pages/ |
Ends With:
The match will be correct if the URL your visitor is on ends exactly as you specify it.
Example:
Ends with - pages/
Result | Example URL |
MATCH | http://www.x.com/pages/ |
NO MATCH | http://www.x.com/pages/subpage |
NO MATCH | http://www.x.com/pages/?x=1 |
NO MATCH | http://www.x.com/pages/?x=1&y=1 |
NO MATCH | http://www.x.com/pages/?x=1#2 |
Contains:
The match will be correct if the URL your visitor is on contains the text you specified.
Example:
Contains - ?x=1
Result | Example URL |
NO MATCH | http://www.x.com/pages/ |
NO MATCH | http://www.x.com/pages/subpage |
MATCH | http://www.x.com/pages/?x=1 |
MATCH | http://www.x.com/pages/?x=1&y=1 |
MATCH | http://www.x.com/pages/?x=1#2 |
Virtual Page Views:
For a detailed explanation of Virtual Page Views and usage examples, read our knowledge base article: virtual page view.