Targeting by URL
Many times, URLs have dynamic variables that are specific to a certain user or state. Take this URL for instance:
The structure of this URL is:
- Protocol: In this case, the protocol is https://, which is a standard protocol for websites that have a secure connection.
- Domain: In this case, the domain is
my.appcues.com. Note that you can target content to multiple domains or subdomains.
- Content Type: The content type is
flows, but other options in the Appcues product would be
- Content ID: This is a randomly generated code that will always be different for each experience a customer builds with Appcues.
- Builder Step: The builder step is
settings, but other options in the Appcues product would be
If we targeted the above URL verbatim, it would only show up on this specific step, for this specific flow, for one specific user. Fortunately, Appcues allows you to adjust the URL targeting to ensure it meets your targeting needs.
If you choose Any Page, the Appcue will appear on any URL path where the embed script is installed. If we used that targeting internally, for instance, it would show up on:
... and every other page within the Appcues product. Note this this is certainly true for modals, but for hotspots, coachmarks or tooltips the element you target would have to be present on every page for the Appcues content to actually appear.
If we wanted to match specific keywords in the URL path, we can use the Match URL option. For instance, we could match URLs that contain the word
flows. If we did this, it would match:
Note that this would show the Appcues content on all three builder steps for any contentid. Alternatively, we could match URLs that contain the word
settings to isolate the settings page, no matter the content type. If we did this it would match:
Regex Match URL (Advanced)
The Match URL option is good for very basic keyword matching. However, sometimes we require more advanced targeting. For instance, what if you wanted to only target the design steps of the hotspot builder? Matching URLs that contain
design would each result in too many matches, as illustrated above.
When this is the case, we can use Regular Expression matching. Regular Expressions (or "Regex") is a simple way of representing strings in a URL by patterns in its characters. Two common Regex operators are
., which means any character, and
*, which means 0 or more of. Thus,
.* means 0 or more of any character and
/hotspots/.*/design would be a valid rule to match only the desired pages.
Here are some other common regular expressions that come in handy when using Regex to target specific pages within Appcues:
- Any number:
- Either of two values:
- Any word:
For additional help with Regex, check out this cheat sheet and this Regex tester. And, of course, feel free to shoot us a note at email@example.com and we would be more than happy to help you with your page targeting!