In this section

Resources / Developers / Behavior

URL matching rules (whitelist and blacklist)

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.

How lists combine

  • If the blacklist contains a rule that matches the page, the widget is not shown.
  • If the whitelist is empty, the widget can show on any page that is not blacklisted.
  • If the whitelist has rules, the page must match at least one.
  • A whitelist rule can carry its own settings (devices, delays, throttling) that override the defaults on that page.

Rule types

Rule looks likeBehaviorExample
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 queryEvery query parameter in the rule must be present with the same value. Extra parameters in the page are fine./signup?plan=pro
Path with hashThe page hash must equal the rule hash./docs#install
Full URL or host + pathScheme (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 wildcardA * in the host matches any characters.https://*.example.com/app
Pattern with * and no schemeGlob matched against the full URL, or against host + path.*example.com/blog/*
Regular expressionWritten between slashes. Tested against the full URL. Case is controlled by flags./\/product\/\d+/i

Examples

# 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.

Single-page apps

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.

What URL rules do not cover

  • Notifications are not URL-targeted. Their placement is controlled by variant and appearance settings.
  • The roadmap and status page are separate public pages or embeds you place yourself.