Autoprompts

Autoprompts allow you to actively engage users by automatically popping up the NPS® Rating and SmartVote widgets when certain conditions are met.

Enabling Autoprompts

  1. To ensure that users don’t get autoprompted too often, autoprompts will only work if you have identified the user with an email or id using the identify method (learn more).
  2. Select which Autoprompts you want enabled via your account’s Widgets settings.
  3. Call the autoprompt method when you want the user to get autoprompted. When this method is called, it checks to see if any of the enabled conditions are met, verifies that the identified user should be prompted at this time, and then prompts the user for NPS® Rating or SmartVote.
1
UserVoice.push(['autoprompt', {}]);

If you’ve added the default trigger to your page, the autoprompt will appear as a popover targeted to that trigger. If there is no default trigger, then autoprompts will appear as a toast since they do not have a default object to anchor themselves to. However, you can specify your own target HTML element:

1
2
3
4
UserVoice.push(['autoprompt', {
  target: '#elementId',
  position: 'bottom'
}]);

Alternatively, you can specify a particular HTML element the autoprompt will target as a popover by adding the data-uv-autoprompt attribute to the element:

1
<a href="mailto:questions@uservoice.com" data-uv-trigger data-uv-autoprompt>Contact us</a>

Note: If multiple data-uv-autoprompt attributes are found on the page, the last one will be used.

Autoprompting on Javascript-based applications

If you use ajax to update your website rather than page loads, you can call the autoprompt method multiple times. Each time it is called, it checks if there are any new server-side prompts to display. If a new one is found, it will be displayed to the user.

Some examples include prompting after a simple ajax login, prompting after the user scrolls to the bottom of the page, or waiting 10 seconds after the page loads to prompt them.

Related topics