HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center
These docs are for v8.1. Click to read the latest docs for v12.0.0.

Targeting Surveys

Detailed here is how you can have your surveys target specific users as well as some related APIs.

You can choose criteria that your users have to meet in order for the surveys to appear in different ways. This can be done through both automatic and manual targeting.

Auto Targeting Surveys

After choosing the survey type, you can target different audience using custom conditions. When you create an auto targeting you pick the criteria for the users who should receive the survey. The users matching the conditions will see the survey automatically. You can set the criteria to be custom user attributes or user events you created.

2160

Controlling the Auto Targeting Surveys

You can have auto targeting surveys show automatically at the start of a session or show it manually.

Showing Automatically

By default, a survey will be presented as soon as the criteria set from the dashboard are met. Surveys that meet the auto targeting criteria will automatically be shown within 10 seconds of the application being opened. In the case of multiple surveys having their criteria met, they will be shown one by one.

Showing Manually

You can show auto targeting surveys at any time if there are available surveys that meet the criteria. To do this, first disable the automatic showing using the following API.

//iOS
IBGSurveys.AutoShowingEnabled = false;

//Android
Surveys.SetAutoShowingEnabled(false);

Then present surveys manually at an appropriate time.

//iOS
IBGSurveys.ShowSurveyIfAvailable();

//Android
Surveys.ShowSurveyIfAvailable();

Manual Targeting Surveys

After choosing the survey type, you can target different audience using manual targeting. You can manually control when a manual targeting survey should show up. Each created survey has a unique token that you can refer to in your code as explained in the following section. Once you publish a manual targeting survey, you can use the unique token that was generated in your application.

2160

Controlling the Manual Targeting Surveys

Sometimes, it's you'd like to show only specific users surveys, like users who opt-in to take these surveys. For these users, it's a better idea to show a manually targeted survey. You can use the following API to show a survey with a specific token. Manual targeting surveys can be displayed to the user any number of times.

//iOS
IBGSurveys.ShowSurveyWithToken("TOKEN");

//Android
Surveys.ShowSurvey("TOKEN");

You can also check if the current user has responded to a specific survey before or not through the following API.

//iOS
bool hasResponded = IBGSurveys.HasRespondedToSurveyWithToken("TOKEN");

//Android
bool hasResponded = Surveys.HasRespondToSurvey("TOKEN");

The above API is particularly useful since you can manually show a survey multiple times to the same user. More information can be found here regarding reshowing already shown surveys.


What’s Next

Your survey is now targeting specific users so check out how to customize some behavioral elements of the survey.