In this section
Resources / Developers / Behavior
How the widget decides whether a URL rule matches the current page: paths, full URLs, wildcards, query parameters and regular expressions.
Notifications, NPS and surveys can be limited to certain pages with a whitelist and a blacklist of URL rules. Each rule is a string that is matched against the visitor’s current location, window.location.href, in the browser. Whitelist entries can carry per-URL targeting overrides. Reusable snapshots of these rules are stored as saved audiences in the admin app.
| Rule looks like | Behavior | Example |
|---|---|---|
| Path, starts with / | Matches the page path. A path also matches its sub-paths (prefix match), except / which matches only the home page. | /pricing matches /pricing and /pricing/annual |
| Path with * | * matches any characters. A trailing /* also matches the base path itself. | /blog/* matches /blog and /blog/my-post |
| Path with query | Every query parameter in the rule must be present with the same value. Extra parameters in the page are fine. | /signup?plan=pro |
| Path with hash | The page hash must equal the rule hash. | /docs#install |
| Full URL or host + path | Scheme (when written), host and path must match exactly. Leading www. is ignored. A port is compared only when the rule includes one. No prefix matching. | https://example.com/pricing |
| Host with wildcard | A * in the host matches any characters. | https://*.example.com/app |
| Pattern with * and no scheme | Glob matched against the full URL, or against host + path. | *example.com/blog/* |
| Regular expression | Written between slashes. Tested against the full URL. Case is controlled by flags. | /\/product\/\d+/i |
# Show only on the pricing page and everything below it
whitelist: /pricing
# Show on any blog post but not the blog index query pages
whitelist: /blog/*
blacklist: /blog?preview=1
# Only on the production domain, any subdomain
whitelist: https://*.example.com/
# Product pages with numeric ids
whitelist: /\/products\/\d+/Globs are case-insensitive
Paths, hosts and wildcard patterns are compared case-insensitively. Trailing slashes are normalized, so /pricing and /pricing/ are the same.
Regex rules
A rule is treated as a regular expression only when it is wrapped in slashes and either has flags or contains regex syntax. Invalid expressions and unsafe patterns (nested quantifiers such as (a+)+, or quantified alternations such as (a|aa)+) are rejected in the admin UI and at save time — Save stays disabled until the rule is fixed. Test your expression in the browser console against location.href before saving.
Rules are evaluated against the live browser location, so client-side route changes are respected. If your app changes the URL without reloading, the next evaluation uses the new URL.