URL matching
The tours you create are only triggered when the user visits a page matching the URL you specify in the first step of a tour. HelpHero’s powerful URL matching engine allows you to match against dynamic URLs, different domains, wildcards and more.
Matching a dynamic URL
Section titled “Matching a dynamic URL”URLs can often contain dynamic parts such as generated IDs, user names, categories, etc. We can introduce a variable to represent these dynamic segments of a URL.
For example:
/user/{user_id}/profileWill successfully match all of the following URLs:
https://example.com/user/3523/profilehttps://example.com/user/2345/profilehttps://example.com/user/6345/profileThis variable will only match a single path segment ie the following URLs will not be matched
https://example.com/user/admin/2344/profileMatching the hash portion of URL
Section titled “Matching the hash portion of URL”Some frontend frameworks such AngularJS use hash URLs for navigation. You can also use hashes for more advanced matching without having to use the JavaScript API. For example if you only wanted to show a tour for certain types of users you could change a link to include a special hash if a user is logged with a particular role.
/home#adminWill successfully match the following URL:
https://example.com/home#adminBut will not match:
https://example.com/homeMatching advanced
Section titled “Matching advanced”Wildcards (*)
Section titled “Wildcards (*)”You can use a * modifier on a variable, to allow a variable to match zero or more path segments
For example:
/shop/{*any}Will successfully match all of the following URLs:
https://example.com/shop/https://example.com/shop/checkouthttps://example.com/shop/settingshttps://example.com/shop/settings/currencyBut will not match:
https://example.com/other/settingsOne or more (+)
Section titled “One or more (+)”You can use a + modifier on a variable, to allow a variable to match one or more path segments
For example:
/shop/{+any}Will successfully match all of the following URLs:
https://example.com/shop/checkouthttps://example.com/shop/settingshttps://example.com/shop/settings/currencyBut will not match:
https://example.com/shop/Optional (?)
Section titled “Optional (?)”You can use a ? modifier on a variable, to specify that the path segment is optional
For example:
/settings/{?page}Will successfully match both of the following URLs:
https://example.com/settingshttps://example.com/settings/currencyBut will not match more than one segment:
https://example.com/settings/currency/editMatching different domains
Section titled “Matching different domains”Any domain
Section titled “Any domain”URL matchers starting with a single slash / will match against any domain.
For example:
/shop/checkoutWill successfully match all of the following URLs:
https://example.com/shop/checkouthttps://app.example.com/shop/checkouthttps://mysite.com/shop/checkoutSpecific domain
Section titled “Specific domain”URL matchers starting with a double slash // will match against specific domains.
For example:
//www.example.com/shop/checkoutWill only match the same domain:
https://www.example.com/shop/checkoutBut will not other domains:
https://app.example.com/shop/checkouthttps://mysite.com/shop/checkout