Skip to main content

NPS Survey

Launch NPS surveys programmatically via the Kompassify Player API.

Waiting for Kompassify API to be ready​

It is highly recommended to wait for the Kompassify API Script to be fully loaded before calling any of the API functions.

The event KOMPASSIFY_BOOT_LOADER_IS_READY is dispatched when the Kompassify API is ready to be used.

window.addEventListener('message', function (event) {
if (event.data.TYPE === "KOMPASSIFY_BOOT_LOADER_IS_READY") {
// Do your stuff here
}
});

Launching a survey programmatically​

You can launch your survey programmatically with a JavaScript snippet by calling:

window.kompassifyNpsSurvey.startNpsSurvey(surveyUuid);

Parameters​

PropertyTypeDescription
surveyUuidStringThe UUID of the survey you want to start. You can find it in the URL of the dashboard after selecting a survey.