Pass programmatic events to UserLeap for advanced survey targeting
Once you've installed UserLeap, you can track events for any user behavior in your product, then create triggers to send surveys based on the desired behaviors.
There are two types of events you can add and use to trigger surveys: Programmatic Events and Page URL Events. Programmatic events include user actions such as logging in or abandoning a cart, while Page URL Events allow you to target web surveys based on the pages users visit.
This article is focused on Programmatic Events. Please refer to our article on setting up Page URL Events for information on Page URLs.
Before you can use a programmatic event to trigger a survey using a programmatic event, it needs to be created in UserLeap and integrated in your product.
There are a few different ways to add custom events:
- Google Tag Manager: If you have installed UserLeap using Google Tag Manager, additional events can be tracked with a few clicks, by following these instructions.
1. Navigate to the Events tab in the left sidebar
To create an event, log in to your UserLeap dashboard and navigate to the Events tab in the left sidebar. Click on the Add button and a new modal will pop up.
2. Add a new Event
Upon clicking the Add button in the Events page, the following modal will appear. The default Event Type selected is Programmatic Event:
The Event Name is what you’ll look for when setting up an individual survey, so name it something easy to remember.
The Event Description describes what is happening for the event and will be added as a comment above the code snippet installed in your product.
For example, if you want to track when a user logs into your website:
- Event Name: Login
- Event Description: Track when a user logs into the website.
Once finished with entering in the information for your new Trigger, hit save and it will appear in the table on the Events page.
3. Get the code
To see the code for your new event, click on the event you just added in the table on the Events page. A modal will appear with all the detail about this event, including the code snippet that needs to be added for UserLeap to begin tracking the event.
4. Install the Code Snippet
Additional technical documentation about tracking events can be found here.
5. Confirm your Events are being captured
UserLeap provides Event Diagnostics to provide insight into your captured events. The Monthly Usage column in the Events table shows how many times UserLeap recorded the event in the past month, along with a pulse icon. Events which UserLeap has not seen will have a count of zero, along with a grey pulse. Events with a count of more than 1 will have a green pulse.
Note that you can also hover your mouse over the pulse icon to show the event counts over the past hour, day, and week for the Web, Android, and iOS platforms:
6. Use your Events
Once your events have been installed on your website, you are ready to use them to trigger UserLeap surveys. Go here for guidance on how to use events!