This article steps through how Events can be used to trigger a survey to appear. Using Events for targeting a survey can be useful when the URL targeting rules are not enough. Keep in mind that Event-based targeting will override all URL-based targeting, including Excluded URL targets.
Targeting surveys with Events
1. Ensure you've set up Events by implementing the Event API code on your site.
2. Create a new survey.
3. In the 'Targeting' section, select 'Specific pages'.
4. Choose 'Event' from the dropdown menu.
5. Enter the event name in the Event field.
This is the name of the event that, when triggered on your site, will make the survey appear.
Click on 'Add another' if you would like to add another targeting rule. Only alphanumeric characters (a-z, A-Z, 0-9), underscores (_), and dashes (-) can be used in the event name.
6. Click 'Apply', then click 'Save' and ensure the status of your survey is 'Active'.
Your survey will appear when the event you've specified is present on a page.
When using events for Surveys, your behavior rules will still be followed. For example, you can set a survey to open after 10 seconds and use an event for targeting. In this case, the survey will appear 10 seconds after the event has been triggered (not 10 seconds after the page loaded).
Events FAQs
Can I target events based on state changes?
Events were designed to allow Surveys to appear based on events that occur on a webpage. Targeting Events based on state changes rather than events on the page can cause inconsistent performance and is not advised.
How is event targeting prioritized with other targeting options, such as URLs?
If the targeted event is present on a page, it will take priority over other targeting rules present, including URL targeting rules. As events take priority, it will cause the survey to show regardless of any other rules present.
If multiple events are being fired on the same page, and the events are being used to target different surveys, the most recently fired event will be prioritized. This means that one event might trigger Survey A to appear, but then if a different event (targeting Survey B) is fired on the same page, it would trigger Survey B to appear (and cause Survey A to disappear) because Survey B was targeted by the most recently fired event.