Events
In Sprig, Events are used to Trigger a Study. They cause your Study to be displayed to the user. All Web and Mobile studies require an event as a Trigger. Events can also be employed as an audience Filter, allowing you to refine further who is eligible to respond to the Study.
An Event is an action or occurrence in your website or application that allows you to track your users' behavior. Examples of Events include:
- Visiting a page
- Clicking or interacting with a button
- Scrolling to a specific point on a page
How to determine what kind of event you need?
Sprig offers several different solutions on ways to deploy events in your environment. Deciding what kind of event to implement is dependent on study requirements and technological factors:
- What kind of action is it? Is it in a simple UI action like clicking a button or some higher-level concept like signing up for a new subscription? A No-Code event might support simple UI action but might not support a more complex semantic.
- What platform do you intend to launch your Study? Web studies support No-Code events, but mobile studies do not. Sprig Long Form Surveys and Sharable Link Studies do not support events.
- How good are your coding skills, and do you have access to the code? You may have to rely on a developer to implement your event, or you may have access to GTM or other integration and not depend on a developer.
- Is it an event or an attribute? For example, do you want the Study to be triggered when the visitor completes the new subscription action, or would you like it to occur at a different time and only study those customers who have recently enrolled in a new subscription?
You could use two example workflows to determine what event type you need for Web and Mobile studies.
Where You Can Use Events
Configuring Trigger and Filtering events are supported in the Sprig Application (No-Code), the Web and Mobile SDKs, Google Tag Manager, and Segment. The API only supports events for filtering. CSV Import does not support events.
Event Type | Trigger | Filter |
---|---|---|
Sprig Application (No-Code) | ✅ | ✅ |
Web SDK | ✅ | ✅ |
Google Tag Manager | ✅ | ✅ |
Mobile SDK | ✅ | ✅ |
API | ❌ | ✅ |
Segment Actions | ✅ | ✅ |
Segment Classic | ❌ | ✅ |
Adding Events
Web and Mobile studies require events to track user behavior to display studies at the appropriate moment. Link studies do not require events because they are delivered to respondents asynchronously. You can configure Sprig to listen for or receive events in two ways; either:
- Using the Sprig app, or
- Directly in the Website or App code where you launch your studies.
Events configured through the Sprig app are No-Code events. Events configured in the Website or App where you want to launch your studies are Code events.
The section describes the steps to add a No-Code and Code Event to Sprig
No-Code Event
No-Code events provide a way to configure Sprig to trigger Web studies without having to edit the source code on the server. No-Code events only support deploying Web-based studies. Code events may be used for web and Mobile studies using the appropriate SDK, API, or Integration.
There are two main types of No-Code Events:
- URL Events: Triggers when a user visits a page whose URL matches a defined pattern.
- Interactive Events: Triggers when a user clicks a specific element on the page, identified by a CSS selector or inner text.
Note: All No-Code Events require a URL match- regardless of whether the event is URL-based or interactive. This ensures Sprig knows which page the user will be on when or before the event triggers. This enables customers to create no-code events for common scenarios (for example, pressing a button that says “Finish”) while maintaining governance over exactly where on the website the no-code event should trigger (for example, if there are multiple pages on the website with buttons labeled “Finish”).
URL Events
URL Events trigger studies such as In-Product Surveys, Feedback, Replays, and Heatmaps when a user visits a page that matches a defined URL pattern. Your Sprig SDK must be installed on the same page that you are targeting with the URL.
Note: Some study types, like Heatmaps and Feedback, require a URL Event rather than an Interactive or Code event.
Interactive Events
Interactive events require a user to click on a specific element on a webpage or web application. They are available for In-Product and Replay web studies (alongside Code events and URL events).
You can specify the target element using either inner text or a CSS selector.
For example, to trigger a survey when a user clicks this button:
<button id="fireButton">Click Me</button>
You could use either inner text or a CSS selector, depending on your use case and web architecture:
- CSS selector: #fireButton
- Inner text: Click Me
Note: the presence of the element in the DOM is not sufficient for the event to be triggered; the user must click on the element.
Info
No-Code events are triggered when a specific condition is met (for example, when the current page URL matches a string you have defined). On page load, the system triggers the first event that matches that specific condition. If you have other No-code events with that same trigger condition, the system will not trigger those other events.
Adding No-Code Events:
Prerequisite: choose a page or a button on your website or web application.
- Keep that page open as you navigate to the following steps; you will need to copy information from this page into the Sprig app. You may want to open the browser Inspect window if you intend to use the CSS selection method.
There are two ways to create a No-Code Events from within the Sprig UI. You can either:
- Configure a reusable event in the Sprig dashboard on the Events tab (Select Add Event)
- Create a reusable event during study creation in the Targeting module (Select Add Event or URL)
For a URL Events: you can configure the URL and matching pattern directly within the targeting module by selecting "URL".
- Note that URL events created here won’t begin tracking activity until the study is launched, and the event will appear as a “Draft URL Event” in the study details until launch.
- Once launched, a default naming convention "URL Event 1 for Study XXXXXX" will be applied and the event will appear in the Events tab. The event name can be renamed here and given a description as well.
For Interactive Events: you can configure the event by selecting "Add Event" and then "New Event" from within the event selection dropdown

Adding No-Code Events while building a study:

No-Code Event Creation Window
When creating a new No-Code Event, a URL is crucial to assure proper event instrumentation. Sprig supports several different ways to match URLs. For more information on page URL matching click here.
After you have added in the URL and/or Interactive element- you can add additional context to the event to help users understand how the event functions:
- Display Name field, to enter the Event name
- Description field, to enter the Event description
Finally, you can test your no-code event to assure proper instrumentation.
- Once you have entered the URL string, enter the URL you are trying to match in the Test Your Event field and click Test Event to test if the string you entered matches the URL.
- Open your browser's JavaScript console in your browser and make sure you are on the correct page.
- Paste the code snippet into the console and hit Enter.
- If successful, the element information will be displayed in the console.
Testing the Event
- In your browser, perform the user behavior to generate the event.
- Click
Browser Reload to refresh the Events page contents.
- In the Events page, hold the pointer over Daily Usage. You should see that an event has been received.
Code Event
Code events may only be used for Web and Mobile applications. There are two ways to add events to Sprig: create the Code Event in the Sprig app, or have your developer send an event from the SDK.
Proactive
If you use the Sprig app to create a Code event, a code snippet is generated with the matching SDK parameter that you can give to your developer to incorporate into their code.
- In the Navigation Pane, click Events.
- Click Add Event.
- Click Create Code Event.
- In the Key field, enter the Event name. The Event name must match the same SDK parameter you are using to track the event.
- Click Use Key as display name. to use a different string to describe the event instead of the Key label.
- In the Description field, enter the event description.
- Click Add Event. You’ll be directed to the Events page.
- Locate and Select the Event you just created.
- Click Configure to Toggle between JavaScript, iOS, or Android to see the snippet that your engineers will need depending on which study delivery platform you’re planning to use the Event on and share that snippet with engineering. Direct them to the Integrations section of the docs for more information on that specific platform, as well as how to locate the Environment ID.
Reactive
- Once your engineering team has sent a new event to Sprig, you will need to approve the request. You should see a banner similar to the following:

- In the Navigation Pane, click Events.
- Click Manage Requests.
- Click the check box next to the event(s) and click Approve.
- Click X to close the window.
Info
You must Approve of an Event Request before it can trigger a study.
If you Deny an Event Request, it will be removed from the Event Request list. However, if Sprig subsequently detects that same Event Request, it will re-appear in the list.If you do not see an Event Request for an event you expect, perform the user behavior to generate the event in your application, and then reload the Events page and return to Manage Requests to approve it.
Legacy Events do not have to be Approved.
Editing and More Info
- In the Navigation Pane, click Events.
- Click on the Event that you want to view.
- The Display Name and Description may be changed.
- For No-Code event, the trigger interaction can be toggled between Page URL, InnerText and CSS. The Page URL pattern can also be edited.
- For Code event, the Key cannot be modified as an external source generates it.
The Display Name updates the event label throughout Sprig; you can use it to provide a more readable label than Key.
Archiving
Archiving an event stops the Event, triggering studies. Events cannot be archived when associated with an in progress study. You will need to pause, archive, or complete the study related to that Event to archive the Event. You can unarchive a previously archived study.
Info
Unlike pausing a Study, archiving an Event also halts the MTU count.
- In the Navigation Pane, click Events
- Make sure the filter is set to Active Events.
- Click the check box next to the Event.
- Click Archive.
- Click Archive a second time when prompted.
Unarchiving
Similarly, if you want to restart using an event, you can unarchive a previously archived event.
- In the Navigation Pane, click Events
- Make sure the filter is set to Archived Events.
- Click the check box next to the Event.
- Click Unarchive.
Sorting
- In the Navigation Pane, click Events
- Click on the column header to sort the Events
- Click on the column header a second time to reorganize the sorting order of the Events
Filtering and Searching
- In the Navigation Pane, click Events
- Click All Sources and select the source to view.
- Click Active or Archived to select which events to view.
Info
If you select Web No Code Events as a source to view, if present, events from Segment Web and Google Tag Manager sources will also be included.
Inspecting and Diagnosing
- In the Navigation Pane, click Events.
- To learn more about how often the event is firing, hold the pointer over
diagnostics in Usage.
- If the diagnostics is grey
, your event is either not added correctly or has been turned off from your website, web application, or mobile application.
- If the diagnostics is green
, your event is being tracked and is available for triggering or filtering a study.
- The following tooltip will be displayed:

Diagnostics Tooltip
If you are using other platforms, for example Segment, they will also be displayed in the tooltip.
Updated 1 day ago