Matching Page URLs

Fine control over how your surveys are launched.

A Page URL event fires when the browser views a page matching the URL that you have defined. However, you may need to refine further how an Event is triggered in your application. Sprig provides several 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:

252252

URL Menu

The following table describes the functionality of each menu item:

Menu ItemDescriptionExample
Exactly matchesThe 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.
Only page views at www.example.com trigger events.
Page views at www.example.com/signup and
or example.com do not trigger events.
ContainsThis fires an event when the user accesses a URL which includes a specific string.You specify: example.
Page views at www.example.com and www.example.com/signup trigger events.
Starts withThe URL must start with the string you entered in the URL field.You specify: exa.
Page views at example.com trigger events.
Page views at www.example.com do not trigger events.
Ends withThe URL must end with the string you entered in the URL field.You specify: com.
Page views at example.com trigger events.
Page views at example.net do not trigger events.
Does not containThis fires an event when the user accesses a URL which DOES NOT include a specific string.You specify: net.
Page views at example.com trigger events.
Page views at example.net do not trigger events.
Does not exactly matchThis 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.
Page views at www.example.net and example.com trigger events.
Page views at www.example.com do not trigger events.
Matches regular expressionA regular expression specifies a pattern to be matched on. The string must match the regular expression. The syntax of the regular expression is described here.You specify: example.com/(login|signup)
Page views at example.com/login and example.com/signup trigger events.
Page views at example.com/help do not trigger events.

You specify: example.com/(?!login|signup)
Page views at example.com/help trigger events.
Page views at example.com/login and example.com/signup do not trigger events.
Matches legacy patternIf you had been using the Page URL functionality before 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.