Skip to content

ExitPoll

Overview

ExitPoll allows you to directly ask questions to your users. This only requires a few lines and some options on your Cognitive3D dashboard. This page will walk you through the process of enabling and configuring an ExitPoll in your application.

Creating an ExitPoll

ExitPoll Hooks and Question Sets are created on the Cognitive3D Dashboard. A Hook is requested from the application during the experience and receives a Question Set as a response. This allows you to use change which Question Set to display from a Hook without updating your application.

The example here will display a Question Set about performance at the end of the level.

Press the New Question Set button.

new question set

Add your questions. Each question will be displayed as a panel one at a time.

Select Create Question Set. Then select Manage Hooks.

create question set

Select New Hook to open the popup.

hook popup

Assign your Question Set and version for the Hook.

select hook

Displaying Question Set

Then in your project, use the Hook name to request the question set as follow:

auto cog = cognitive::CognitiveVRAnalyticsCore::Instance();

//request a question set by a Hook name
cog->GetExitPoll()->RequestQuestionSet("scene_complete");

//use this to return the set of questions as a string of json
std::string questionSet = cog->GetExitPoll()->GetQuestionSetString();

The ExitPoll questions will be returned as json in the format here: link

Answering Question Sets

To answer an active question simply call addAnswer on exitpoll:

std::string myVoiceResponse = GetMicrophoneResponse(); // Voice responses require a .wav file encoded in base64 format.

cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kBoolean, 1)); //true
cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kHappySad, 1)); //happy
cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kThumbs, 1)); //thumbs up
cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kMultiple, 0)); // select first choice
cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kScale, 0)); // select 0
cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kVoice, myVoiceResponse)); //voice response

cog->GetExitPoll()->SendAllAnswers();

If you want to allow a user to skip answering a question, add an answer with any negative value

cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kBoolean, -32768)); //skip

intercom If you have a question or any feedback about our documentation please use the Intercom button in the lower right corner of any web page.