Page targeting rules are different with Continuous Heatmaps
If you are on a Hotjar Business or Plus plan, Heatmaps are based on Continuous Capture by default instead of snapshots. To learn more you can check out our article on Continuous Heatmaps.
- Page targeting and filtering options for Continuous Heatmaps
- Page targeting for manual snapshot-based Heatmaps
Page targeting for manual snapshot-based Heatmaps
Page targeting options can be found for snapshot-based Heatmaps by selecting either Visit a specific page, Visit one of multiple similar pages or Trigger a JavaScript snippet.
Make sure you are targeting the correct URL in your Heatmap
Sometimes a URL can change when it is loaded on the browser. Check to make sure that the URL of your live site matches the URL your Heatmap is targeting.
Hotjar's page targeting rules are:
- Simple match: This is the default match type and is used to target a page on your site, ignoring any query strings and fragments that might get added, as well as ignoring the 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 begins with the entered text.
- Ends with: Target all pages that have a URL that ends in the entered text.
- Contains: Target all pages which contain the entered text. This rule is case sensitive.
- Regular Expression: A regular expression, regex or regexp for short, is a unique text string for describing a search pattern.
Hotjar can only support the following characters
a-z, A-Z,0-9, -, ., _, /, and ~. Any other characters need to be percent-encoded.
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.
Query strings and fragments are ignored
If query strings or fragments are added to the URL when the page loads, the Simple URL target will still track, regardless of any appended queries.
Simple Match - http://www.x.com/pages/
Result | Example URL | Why? |
MATCH | http://www.x.com/pages/ | The domain (x.com) and page path (/pages) is a match |
NO MATCH | http://www.x.com/pages/subpage | /subpage is not part of the page path criteria |
MATCH | http://www.x.com/pages/?x=1 | The query string (?x=1) is ignored |
MATCH | http://www.x.com/pages/?x=1&y=1 | The query string (?x=1&y=1) is ignored |
MATCH | http://www.x.com/PAGES | The Simple Match method is NOT case sensitive |
MATCH | https://www.x.com/pages/ | The HTTPS protocol is ignored |
MATCH | http://x.com/pages | The www. prefix to the domain is ignored |
MATCH | https://x.com/pages/ | The HTTPS and www. prefix to the domain are ignored |
Exact match
The match will be correct if the URL path, query-string and fragment your visitor is on match EXACTLY the ones you specify.
Example:
Exact match - http://www.x.com/pages/?x=1
Result | Example URL | Why? |
NO MATCH | http://www.x.com/pages/ | The required query string (?x=1) is missing |
NO MATCH | http://www.x.com/pages/subpage | The required query string (?x=1) is missing and the page path should not include /subpage |
MATCH | http://www.x.com/pages/?x=1 | All URL components are an exact match |
NO MATCH | http://www.x.com/pages/?x=1&y=1 | The URL has a non-matching query string (&y=1) at the end of it |
NO MATCH | http://www.x.com/pages/?x=1#2 | The URL has a non-matching URL fragment (#2) at the end of it |
NO MATCH | https://www.x.com/pages/?x=1 | The URL protocol (HTTPS) needs to be changed to HTTP to become an exact match. |
Starts with
The match will be correct if the URL your visitor is on, starts exactly as you specify it, including the protocol.
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.
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, includes the text you specified.
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 |
Regular Expressions (REGEX)
The match will be correct if the REGEX you create includes the URL your user visits. More about REGEX can be found How to Use Regular Expressions for Page Targeting.