At chatlyn, we aim to make live-chat campaigns on websites as seamless as possible. One important feature is the ability to support wildcard URL patterns. Understanding how to build these patterns correctly ensures your campaigns run smoothly across your desired pages.
General Rules for URL Patterns
In Chatlyn, every URL pattern must begin with either `http://` or `https://`.
Campaigns for Exact URL Matches
If you target a specific URL like `https://chatlyn.com/dashboard`, only that exact URL will trigger your campaign. URLs with additional parameters, hash fragments, or a trailing slash will not be matched.
Examples:
- Matches:
- `https://chatlyn.com/dashboard`
- `https://chatlyn.com/dashboard/?test_param=1`
- Doesn't Match:
- `https://chatlyn.com/dashboard#section1`
- `https://chatlyn.com/dashboard/settings`
Ignoring URL Parameters
To make your campaign ignore parameters like query strings or hash fragments, simply add a trailing slash. For instance, `https://chatlyn.com/dashboard/` will now match several variations.
Examples:
- Matches:
- `https://chatlyn.com/dashboard/`
- `https://chatlyn.com/dashboard`
- `https://chatlyn.com/dashboard?version=2`
- `https://chatlyn.com/dashboard#overview`
Matching All Sub-directories
To match all sub-directories of a website, use the `*` wildcard. This is useful for running campaigns across multiple sections of your site.
For example, `https://chatlyn.com/*` will match:
- `https://chatlyn.com/`
- `https://chatlyn.com/home`
- `https://chatlyn.com/home/support`
Matching Across Subdomains
If you want your campaign to work on subdomains, use the `{*.}?` pattern. For example, `https://{*.}?chatlyn.com/` will match the following URLs:
- `https://chatlyn.com`
- `https://app.chatlyn.com`
- `https://www.chatlyn.com`
By following these URL pattern guidelines, you'll ensure your live-chat campaigns are targeting the correct pages and audiences on your site.