Code Events
Code Events
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.
Updated about 4 hours ago