> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sprig.com/llms.txt
> Use this file to discover all available pages before exploring further.

# No Code Event URLs

> Fine control over how your studies are triggered.

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:

<img align="center" alt="Image 252" title="urlmenu.png" src="https://mintcdn.com/sprig/IibAYOcivdkTylH0/images/38fc1a5-urlmenu.png?fit=max&auto=format&n=IibAYOcivdkTylH0&q=85&s=0961eb7abd05517d72750c694bd8afd5" width="252" height="375" data-path="images/38fc1a5-urlmenu.png" />

The following table describes the functionality of each menu item:

<br />

| **Menu Item**              | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                              | **Example**                                                                                                                                                                                                                                                                                                                                                       |
| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Exactly matches            | The URL must exactly match the string you entered in the **URL**field.<br /> Identical domains in URLs with different paths do not fire events.                                                                                                                                                                                                                                                                                              | You specify: [<u>www.example.com.</u>](http://www.example.com./)<br />Only page views at [<u>www.example.com</u>](http://www.example.com/) trigger events.<br />Page views at [<u>www.example.com/signup</u>](http://www.example.com/signup) and<br />or example.com do not trigger events.                                                                       |
| Contains                   | This fires an event when the user accesses a URL which includes a specific string.                                                                                                                                                                                                                                                                                                                                                           | You specify: example.<br />Page views at [<u>www.example.com</u>](http://www.example.com/)<br />and [<u>www.example.com/signup</u>](http://www.example.com/signup) trigger events.                                                                                                                                                                                |
| Starts with                | The URL must start with the string you entered in the **URL**field.                                                                                                                                                                                                                                                                                                                                                                          | You specify: exa.<br />Page views at example.com trigger events.<br />Page views at [<u>www.example.com</u>](http://www.example.com/) do not trigger events.                                                                                                                                                                                                      |
| Ends with                  | The URL must end with the string you entered in the **URL**field.                                                                                                                                                                                                                                                                                                                                                                            | You specify: com.<br />Page views at example.com trigger events.<br />Page views at example.net do not trigger events.                                                                                                                                                                                                                                            |
| Does not contain           | This fires an event when the user accesses a URL which DOES NOT include a specific string.                                                                                                                                                                                                                                                                                                                                                   | You specify: net.<br />Page views at example.com trigger events.<br />Page views at example.net do not trigger events.                                                                                                                                                                                                                                            |
| 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: [<u>www.example.com.</u>](http://www.example.com./)<br />Page views at [<u>www.example.net</u>](http://www.example.net/) and example.com trigger events.<br />Page views at [<u>www.example.com</u>](http://www.example.com/) do not trigger events.                                                                                                 |
| Matches regular expression | A regular expression specifies a pattern to be matched on. The string must match the regular expression. <br />The syntax of the regular expression is described [<u>here</u>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Cheatsheet). <br />Note: When using "Matches regular expression", there is a limit of 255 characters per expression.                                                        | You specify: example.com/(login\|signup)<br />Page views at example.com/login and example.com/signup trigger events.<br />Page views at example.com/help do not trigger events. You specify: example.com/(?!login\|signup)<br />Page views at example.com/help trigger events.<br />Page views at example.com/login and example.com/signup do not trigger events. |
| Matches legacy pattern     | If you had been using the Page URL functionality before September 27, 2021 expressions were created with a regular <br />expression pattern that is now referenced as **Matches legacy pattern**. While the legacy functionality will continue to <br />be supported, we recommend you update to the latest, standardized option by editing your Page URL <br />event and updating the event with the **Matches regular expression** option. |                                                                                                                                                                                                                                                                                                                                                                   |

## Wildcards (\*)

Wildcards (\*) are supported for both No Code URL events created from the Events page in addition to inline URL events created from the Targeting card.

For example, exactly matching [www.example.com/\*/dashboard](http://www.example.com/*/dashboard) will include any URL that has zero or more characters in place of \*, but will not include [www.example.com](http://www.example.com)

Note: Note, if you'd like to use a literal asterisk instead of a wildcard, please select "Matches regular expression" and add a backslash before the asterisk like so: "\*"

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

## Page URL Priority

Sprig can only track a single No Code URL event per page. Sprig uses the following priority stack to determine which No Code URL event to track in the case of multiple candidate events for a particular page:

1. Exactly matches
2. Matches regular expression
3. Starts with
4. Ends with
5. Contains
6. Does not contain
7. Does not exactly match
8. Matches legacy pattern

Events used as triggers for *In Progress* studies will always trigger over events not used as a trigger in an *In Progress* study.

For overlapping events - meaning multiple events that could fire on a single page load - Sprig will record events in an equal distribution.

<Tip>
  For more information about no-code events, [see here](/docs/shared-study-foundations/events/no-code-events).
</Tip>
