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

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}/profile

Will successfully match all of the following URLs:

https://example.com/user/3523/profile
https://example.com/user/2345/profile
https://example.com/user/6345/profile

This variable will only match a single path segment ie the following URLs will not be matched

https://example.com/user/admin/2344/profile

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#admin

Will successfully match the following URL:

https://example.com/home#admin

But will not match:

https://example.com/home

Matching advanced

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/checkout
https://example.com/shop/settings
https://example.com/shop/settings/currency

But will not match:

https://example.com/other/settings

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/checkout
https://example.com/shop/settings
https://example.com/shop/settings/currency

But will not match:

https://example.com/shop/

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/settings
https://example.com/settings/currency

But will not match more than one segment:

https://example.com/settings/currency/edit

Matching different domains

Any domain

URL Matchers starting with a single slash / will match against any domain.
For example:

/shop/checkout

Will successfully match all of the following URLs:

https://example.com/shop/checkout
https://app.example.com/shop/checkout
https://mysite.com/shop/checkout

Specific domain

URL Matchers starting with a double slash // will match against specific domains.
For example:

//www.example.com/shop/checkout

Will only match the same domain:

https://www.example.com/shop/checkout

But will not other domains:

https://app.example.com/shop/checkout
https://mysite.com/shop/checkout