Using Wildcard URL Patterns

How to use wildcard URL patterns to target groups of pages on your website.

When configuring Spara features that target specific pages on your website (like preview messages), you don't need to add every URL individually. Wildcard patterns let you target entire sections of your site with a single entry.

How wildcards work

Add /* to the end of a URL path to match that path and all pages beneath it. Spara uses simple path prefix matching, not regular expressions.

Pattern
What it matches

/blog/*

/blog, /blog/my-post, /blog/2026/april/update

/products/*

/products, /products/enterprise, /products/pricing/details

/docs/*

/docs, /docs/getting-started, /docs/api/reference

/*

Every page on your site

/pricing

Only /pricing (exact match, no wildcard)

You can also include the full domain to restrict matching to a specific subdomain:

Pattern
What it matches

https://www.example.com/blog/*

Only blog pages on www.example.com

https://docs.example.com/*

All pages on docs.example.com

Trailing slashes are ignored when matching. /blog and /blog/ are treated as the same path.

Where wildcards are used

Preview messages

Preview messages (the pop-up message that appears when a lead visits a page) can be targeted to specific URLs using the criteria field. Set the criteria variable to current_url and the value to a wildcard pattern like /blog/* to show a customized preview message on all blog pages.

For more on preview messages, see https://docs.spara.com/agents/chat-agents.

Example: Different previews for different sections

You might configure three previews for your Navigator chat agent:

  1. Product pages (/products/*) — "Want to see how this works for your team? Let's chat."

  2. Blog pages (/blog/*) — "Have questions about this topic? I can help."

  3. Default (no criteria) — "Hi there! How can I help you today?"

Spara evaluates previews in order. The first preview whose criteria matches the lead's current URL is shown. The default preview (with no criteria) acts as a catch-all for pages that don't match any other pattern.

Last updated