Skip to content

Commit

Permalink
chore: Add support for wildcard URLs (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrajs committed Dec 10, 2022
1 parent 6c64828 commit 30da04a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/product/features/campaigns/ongoing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ These are the inputs required to create the campaign:

</div>


The URLs in the campaign supports the wildcard patterns. See [this guide](/docs/product/features/campaigns/wild-card-url-in-campaigns) to learn more about building a wildcard pattern.

**Step 3**. Visit the URL specified in the campaign and wait for the time configured in the campaign.

![add-a-campaign](../images/campaign-message.png)
35 changes: 35 additions & 0 deletions docs/product/features/campaigns/wild-card-url-in-campaigns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "Wildcard URL support in website live-chat campaigns"
---

The website live-chat campaigns support wild card URL patterns. While building a URL pattern, consider the following behavior in mind.

In Chatwoot, every URL pattern should start with `http://` or `https://`.

### Running the campaign on the exact URL

If you add an exact URL like `https://chatwoot.com/app`, then the URLs with trailing slashes or the URL params or the hash params would not match.
- `https://chatwoot.com/app`
- `https://chatwoot.com/app?test_param=test_value`

### Running the campaign ignoring the URL parameters

To ignore the URL params or hash params, you can add a trailing slash in the URL. For eg: `[https://chatwoot.com/app/](https://chatwoot.com/app/)` would match all the following URLs.
- `https://chatwoot.com/app/`
- `https://chatwoot.com/app`
- `https://chatwoot.com/app/?test=1`
- `https://chatwoot.com/app/#test`

### Running the campaign in all sub-directories

You can use the `*` character in the URL if you want to match all the sub-directories. For eg: `https://chatwoot.com/*` would match to the following URLs
- `https://chatwoot.com/`
- `https://chatwoot.com/app`
- `https://chatwoot.com/app/subdirectory`

### Running the campaign in all subdomains

To match the current domain and subdomains, you can use the pattern `{*.}?` in the URL. For eg: `https://{*.}?chatwoot.com/` would match to the following URLs
- `https://chatwoot.com`
- `https://app.chatwoot.com`
- `https://www.chatwoot.com`

0 comments on commit 30da04a

Please sign in to comment.