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

# Study Triggers & User Filters

> This document explains how to add Study Triggers and User Filters to a study in Sprig

<Note>
  Sprig SDK Installation & Event/Attribute Instrumentation Required for Targeting

  In-product Studies like Surveys, Feedback, Replays and Heatmaps require SDK installation and events to be instrumented to properly capture your user's experience. Learn more about [Installation](/docs/Installation/introduction-web/index), [Events](/docs/shared-study-foundations/events/index) and [Attributes](/docs/shared-study-foundations/attributes)
</Note>

This section walks through available study triggers and user filters during study creation, and also applies to user filtering when reviewing study results.

**Table of Contents:**

* [Study Triggers](/docs/shared-study-foundations/main-tasks/study-triggers-user-filters-and-groups-copy#study-triggers)
* [User Filters](/docs/shared-study-foundations/main-tasks/study-triggers-user-filters-and-groups-copy#user-filters---attributes-group-or-event-history-optional) (attributes, events, groups)

# Overview

Targeting unlocks the full potential of Sprig by enabling you to reach the right users at the right time across Surveys, Feedback, Replays, and Heatmaps, using study trigger events and/or URLs, user filters, and other advanced filters.

<img align="center" alt="Example Survey Targeting Card" src="https://mintcdn.com/sprig/_1uWncsTBTa1sJbM/images/eab9568-image.png?fit=max&auto=format&n=_1uWncsTBTa1sJbM&q=85&s=8b96215ddaf2e9baef9e727d748bd9b6" width="500px" data-path="images/eab9568-image.png" />

## Study Triggers

Study triggers consist of [events](/docs/shared-study-foundations/events/index) and/or URLs that initiate Surveys, Feedback, Replays, and Heatmaps, and are required for all in-product studies.

<Warning>
  Events coming from server-side integrations (such as [Rudderstack](/docs/Integrations/data-sources-introduction/rudderstack) or [Segment](/docs/Integrations/data-sources-introduction/segment-classic) as a source rather than a destination) are **not** able to trigger studies. However, they *can* be used in your target users' [event history](/docs/shared-study-foundations/main-tasks/study-triggers-user-filters-and-groups-copy#event-history).
</Warning>

### Steps to add a Study Trigger:

1. **Configure your Survey (for Surveys & Feedback)**
2. **Select a Platform**
3. **Select Trigger Type:**
   * Click *Add event or URL*
     * Heatmaps and Feedback are restricted to inline URL events only
   * (optional) Add additional triggers - Sprig supports up to 10 triggers per in-product study.
4. **Configure Trigger: Event Properties**  (optional)
   * Event properties allow you to more specifically target users, limited to [Code](/docs/shared-study-foundations/events/index#code-event) events
   * Note: You are limited to 10 event properties across all triggers in a study. For example, if your study has 2 triggers, you can have 5 event property filters per trigger.

<Note>
  **Note:** You can use the same event to trigger more than one Study, but if the same study type, your visitors will be evenly sampled to contribute to a study
</Note>

#### Wait Time Filter - Surveys Only (Optional)

Wait times allow you to ensure that you are not interrupting key user flows. Adding a wait time will delay the survey from displaying for some number of seconds.

#### Inline URL Event Triggers

Inline URL Event Triggers work the same under the hood as [No Code Events](/docs/shared-study-foundations/events/matching-page-urls), just with the ability to create a No Code Event directly inline from the Targeting card.

As with all No Code Events, your SDK must first be installed on the same page that you are targeting with a URL.

<img align="center" alt="Example: Inline URL Event alongside Code Event" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/864625c-image.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=d4b5fb854339503620a10a6e61654208" width="500px" data-path="images/864625c-image.png" />

#### Advanced Session Filters

1. Session History - # of visits before triggering
   1. Measured as 12-hour windows in which a visitor has one or more events tracked
2. Page View History - # of web pages seen in a single session (Web studies only)

## User Filters - Attributes, Group or Event History (Optional)

User filters allow you to target specific user segments based on their attributes or behaviors. This helps in personalizing the study to relevant user groups.

There are several types of filters available:

1. [Attributes](/docs/shared-study-foundations/attributes): Enables filtering by properties of your users (e.g. `Plan = Enterprise`)
2. [Groups:](/docs/shared-study-foundations/main-tasks/groups) Enables filtering by groups of users
3. [Event History](/docs/shared-study-foundations/events/index): Enables filtering by previous interactions (e.g. `Dashboard - Sign Up Complete Last Occurred > 60 Days Ago`)
4. Question Types & Logic Statements( e.g. `How would you rate your satisfaction with the following is 4`)
5. [No Code Event URLs](/docs/shared-study-foundations/events/matching-page-urls)
6. [Frustration Signals - Public Beta](/docs/sprig-studies/replays/session-replay-clip-playback/frustration-signals)(e.g. `Rage Clicks = to 5`)

#### Steps to Add a User Filter:

1. Click the Filter button
2. Select one of the available categories, depending on Survey Type, categories and options will vary - see options variables below:

### Survey Filters

| Questions                                                                                               | Operators                                      | Value                                     |
| :------------------------------------------------------------------------------------------------------ | :--------------------------------------------- | :---------------------------------------- |
| Questions created in the survey. *Use to narrow down questions you want to highlight or dig deeper on.* | `Is`, `Is not` , `is submitted` , `is skipped` | Options specific to the question selected |

<img align="center" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/880e3aa36e3600f5da58759f4f1e83300b1478bf5386cf4dbb4671581c543afb-Screenshot_2025-03-31_at_1.54.30_PM.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=484d2d38d79a7aa0ac7d2406374650c6" width="2728" height="804" data-path="images/880e3aa36e3600f5da58759f4f1e83300b1478bf5386cf4dbb4671581c543afb-Screenshot_2025-03-31_at_1.54.30_PM.png" />

| Trigger Events                                                                                           | Operators                                  |
| :------------------------------------------------------------------------------------------------------- | :----------------------------------------- |
| Events that have been triggered in a survey. *Used to filter specific events that triggered the survey.* | `Triggered study`, `Did not trigger study` |

<img align="center" src="https://mintcdn.com/sprig/_ephcOEAcdx-CRO7/images/20c6df36669fdf51c6d73ab3a98750d9728eeff0121e1e5dc900d56b4f7d1b57-Screenshot_2025-03-31_at_1.58.17_PM.png?fit=max&auto=format&n=_ephcOEAcdx-CRO7&q=85&s=b9120fbacd05dcb0712c1e7571d82f53" width="2382" height="926" data-path="images/20c6df36669fdf51c6d73ab3a98750d9728eeff0121e1e5dc900d56b4f7d1b57-Screenshot_2025-03-31_at_1.58.17_PM.png" />

| Trigger Page                                                                                                               | Operators                                                                                                                                                                            | Value                                |
| :------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| Page on which a user was on when the survey was displayed. *Use to target specific survey results when a page was viewed.* | `Exactly matches`, `Contains` , `Starts with` , `is skipped`, `Does not exactly match`, `Does not contain`, `Matches regular expression`, `Matches regular express (case sensitive)` | Name, path, or a URL of desired page |

<img align="center" src="https://mintcdn.com/sprig/_ephcOEAcdx-CRO7/images/140b4ebcd36a9d6fba2f1728a6c792a60e2a93a1c7b98bd24b394b7bf13e9741-Screenshot_2025-03-31_at_2.23.55_PM.png?fit=max&auto=format&n=_ephcOEAcdx-CRO7&q=85&s=fe535ab9af1f9d35094fc8a4790bbc51" width="3212" height="1012" data-path="images/140b4ebcd36a9d6fba2f1728a6c792a60e2a93a1c7b98bd24b394b7bf13e9741-Screenshot_2025-03-31_at_2.23.55_PM.png" />

### Replay Filters

| Pages                                                                                                                      | Operators                                                                                                                                                                            | Value                                |
| :------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------- |
| Page on which a user was on when the survey was recording. *Use to target specific replay results when a page was viewed.* | `Exactly matches`, `Contains` , `Starts with` , `is skipped`, `Does not exactly match`, `Does not contain`, `Matches regular expression`, `Matches regular express (case sensitive)` | Name, path, or a URL of desired page |

<img align="center" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/86f30013ace4d588835e55f93ce148d0e199a5cb20661db1ea4c35657ba6309d-Screenshot_2025-03-31_at_2.36.54_PM.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=7e3bf67372bd01d8e5113fb0d178da2a" width="2724" height="872" data-path="images/86f30013ace4d588835e55f93ce148d0e199a5cb20661db1ea4c35657ba6309d-Screenshot_2025-03-31_at_2.36.54_PM.png" />

| Events                                                                                                                                                                             | Operators                                                                                                                                                     | Value           |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------- |
| Replay Events that are contained within the Replay clips of the study. If an event was never triggered and captured in the Replay study, then it should **not** show on this list. | `= (equal to)`, `≠ (not equal to)` , `< (less than)` , `≤ (less than or equal to)`, `> (greater than)`, `≥ (greater than or equal to)`, `Not tracked in clip` | Numerical value |

<img align="center" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/a0de92478ee6bd9306d27a6688ba7d1964fd2101fc599a18aaae5785ed84b48d-Screenshot_2025-03-31_at_2.54.36_PM.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=c714cf685ffe0fcce4a14eb8e1b2c1b3" width="2722" height="806" data-path="images/a0de92478ee6bd9306d27a6688ba7d1964fd2101fc599a18aaae5785ed84b48d-Screenshot_2025-03-31_at_2.54.36_PM.png" />

| Signals                                                                                                                                     | Operators                                                                                                                                                     | Value           |
| :------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------- |
| Replay Signals are tracked by interactions and frustrations. Clicks, Rage Cicks, and Dead Clicks are three signals we use in Replays today. | `= (equal to)`, `≠ (not equal to)` , `< (less than)` , `≤ (less than or equal to)`, `> (greater than)`, `≥ (greater than or equal to)`, `Not tracked in clip` | Numerical value |

<img align="center" src="https://mintcdn.com/sprig/IibAYOcivdkTylH0/images/4ef1ebef1a5fc37d73cc5a5ad155a254e02bd13c34d6f874ac5ddc009b508326-Screenshot_2025-03-31_at_3.42.15_PM.png?fit=max&auto=format&n=IibAYOcivdkTylH0&q=85&s=718d6560a5eec25c97b10f2d7b4adc55" width="2844" height="892" data-path="images/4ef1ebef1a5fc37d73cc5a5ad155a254e02bd13c34d6f874ac5ddc009b508326-Screenshot_2025-03-31_at_3.42.15_PM.png" />

| Devices                                        | Operators                     |
| :--------------------------------------------- | :---------------------------- |
| Filter the recordings by device that was used. | `is device)`, `is not device` |

<img align="center" src="https://mintcdn.com/sprig/_1uWncsTBTa1sJbM/images/ed223d29a20107f9e304e45588e11b3eea5d666445d953009d4d4520224a1f7d-Screenshot_2025-03-31_at_4.19.39_PM.png?fit=max&auto=format&n=_1uWncsTBTa1sJbM&q=85&s=b071c41ccdf246269cfe0b7405d80319" width="2102" height="870" data-path="images/ed223d29a20107f9e304e45588e11b3eea5d666445d953009d4d4520224a1f7d-Screenshot_2025-03-31_at_4.19.39_PM.png" />

### User Filters

| Attributes                                                      | Operators                                                                                                                                                                                                                  | Property                                                |
| :-------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------ |
| Ideally only showing Attributes of users captured in the study. | `= (equal to)`, `≠ (not equal to)` , `< (less than)` , `≤ (less than or equal to)`, `> (greater than)`, `≥ (greater than or equal to)`, `Contains`, `Does not contain`, `Starts with`, `Ends with`, `Is set`, `Is not set` | Available properties are specific to Attribute selected |

<img align="center" src="https://mintcdn.com/sprig/8rOBJC6NeyY76ru8/images/964f28c8aac1212ecf69a97b7f88705db06d5814d3cae731dc4ad0f20aa6ad23-Screenshot_2025-04-01_at_9.40.29_AM.png?fit=max&auto=format&n=8rOBJC6NeyY76ru8&q=85&s=673b451da895d38bdcc31e9bcc39b69d" width="2350" height="1026" data-path="images/964f28c8aac1212ecf69a97b7f88705db06d5814d3cae731dc4ad0f20aa6ad23-Screenshot_2025-04-01_at_9.40.29_AM.png" />

#### Event History

Event History has sub-filters after selecting an Event specific to your use-case. Use these filters to set parameters around a specific event in your survey.

| Filter        | Operator                                                                                                                                | Value         | Use                                                                                                                                                                        |
| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Tracked       | `= (equal to)`, `≠ (not equal to)`,`\< (less than)`,`≤ (less than or equal to)`, `> (greater than)`, \`\`≥ (greater than or equal to)\` | Numeric value | The `Tracked` operator compares the total number of times an event has been triggered by a visitor, since first being tracked, to the specified value provided by the user |
| First tracked | `Is greater than`, `Is less than` , `is greater than or equal to` , `is less than or equal to` , `is equal to`                          |               | The `First tracked` operator compares the first recorded event trigger and compares to the value specified by the user                                                     |
| Last tracked  | `Is greater than`, `Is less than` , `is greater than or equal to` , `is less than or equal to` , `is equal to`                          |               | The `Last tracked` operator compares the last recorded event trigger and compares to the value specified by the user                                                       |
| Is Set        | `Yes`                                                                                                                                   |               | The `Is Set` operator checks whether or not there is a value stored for the intended event                                                                                 |

<br />
