Trigger Content On a Dynamic URL
What is a URL path?
URLs consist of the following parts:
https://staging.userpilot.com/dashboard/mailbox?Id=b3665070 \___/ \_____/\____________/\________________/ \_________/ | | | | | Protocol Subdomain Domain Path Query<br>
URL path comes after the top-level domain (TLD) ' .com' or '.io' or any similar and before the query that starts with
URL path matching
To target content to appear on a specific path, you have a set of options that you can use:
- Starts with — flow will show on paths that start with the sub-string
- Contains — flow will show on paths that contain the input sub-string
- Ends with — flow will show on paths that end with the sub-string
- Equals — flow will show on paths that exactly matches the input string
- Matches regex — flow will show on paths that match the input regular expression
Working with unique URLs
Some cases might involve showing content on pages with dynamically changing URLs. To trigger content on the correct page, you can use 'Matches Regex' and use the Asterix symbol as a wildcard (*) to replace the part that is dynamic/changing
Some apps use dynamic URLs in their path structure, i.e different users would have different URLs even for the same tab.
For example, https://app.example.io/home/1234 where '1234' is a changing variable from one user to the other.
Userpilot gives you a bunch of really easy solutions in order to make sure content is triggered on dynamic URLs.
Go the 'Page' section in the settings tab and you'll find various options to select.
For example, you can select to trigger it on all pages that start with https://app.example.io/home/ ; this way it will automatically ignore the dynamic part of the URL.
You can also use "contains" or the "Matches Regex" option.
For the regex option, substitute all the changing variables in the URL to (*) as shown in the example below.
This will ensure that the Flow will only trigger on that specific URL.