Utilizing features targeting is important to specifically capture the activity of the feature on specific locations in your app.
In many cases, you might want to install the Userpilot code snippet on different environments. This can be very helpful when you want to test the experience locally or on a staging domain before deploying it to production.
You can control tracking the activity of the selected feature on any domain or subdomain where you've installed your Userpilot snippet.
All domains ( Default): Capture the activity of this feature anywhere the Userpilot script is installed
Specific domains: Capture the activity of this feature if the domain exactly matches the input string
Use wildcards to match dynamic domains
In many cases, your domain might have dynamic parts that change from user to user. A common use of a wildcard domain is with applications that use a personalized subdomain for each user or account.
You can easily use the Asterix symbol as a wildcard (*) to replace the part that is dynamic/changing. For example, to capture the activity of the feature on ' name.userpilot.com' where the part 'name' is dynamic. You can set the domain to be the following:
Userpilot provides a wide set of operators to utilize the page targeting settings of your features. This limits the activity of the feature to only be tracked on the correct URL within your application based on where the user is located.
Any page ( Default): Capture the activity of this feature on any location a user is in within your application
Specific page: Capture the activity of this feature on a particular page(s) within your application depending on the URL path
Pro tip: Any page can be very useful for elements that appear across your whole app such as navigation menus.
What is a URL path?
URLs consist of the following parts:
https://staging.userpilot.com/dashboard/mailbox?Id=b3665070 \___/ \_____/\____________/\________________/ \_________/ | | | | | Protocol Subdomain Domain Path Query
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 track a feature activity on a specific path, you have a set of options that you can use:
- Starts with — Feature will be tracked on paths that start with the sub-string
- Contains — Feature will be tracked on paths that contain the input sub-string
- Ends with — Feature will be tracked on paths that end with the sub-string
- Equals — Feature will be tracked on paths that exactly matches the input string
- Matches regex — Feature will be tracked on paths that match the input regular expression
Working with unique URLs
Some cases might involve having features on pages with dynamically changing URLs. To track the feature activity 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 ( you can learn more about it here).
Next Steps: Detecting the right element