Matching Page URLs
A Page URL event fires when the browser views a page matching the URL that you have defined. However, you may need to further refine how an Event is triggered in your application. Sprig provides a number of different ways to specify how the string matches the URL that you are targeting. When you are adding or editing an event, if you click on the URL menu you will see:


URL Menu
The following table describes the functionality of each menu item:
Menu Item | Description | Example |
---|---|---|
Exactly matches | The URL must exactly match the string you entered in the URL field. Identical domains in URLs with different paths do not fire events. | You specify: www.example.com. |
Contains | This fires an event when the user accesses a URL which includes a specific string. | You specify: example. |
Starts with | The URL must start with the string you entered in the URL field. | You specify: exa. |
Ends with | The URL must end with the string you entered in the URL field. | You specify: com. |
Does not contain | This fires an event when the user accesses a URL which DOES NOT includes a specific string. | You specify: net. |
Does not exactly match | This fires an event when the user accesses a URL which DOES NOT exactly match the string you entered in the URL field. | You specify: www.example.com. |
Matches regular expression | A regular expression is a specification of a pattern to be matched on. The string must match on the regular expression. The syntax of the regular expression is described here. | You specify: example.com/(login|signup) You specify: example.com/(?!login|signup) |
Matches legacy pattern | If you had been using the Page URL functionality prior to September 27, 2021 expressions were created with a regular expression pattern that is now referenced as Matches legacy pattern. While the legacy functionality will continue to be supported, we recommend you update to the latest, standardized option by editing your Page URL event and updating the event with the Matches regular expression option. |
Testing your Matching Pattern
Once you have completed your matching pattern, enter the URL you are trying to match in the Test Your Event field and click Test Match to see if your event's URL pattern matches the URL that you want to be tracked.
Updated 8 months ago