microsurvey

Browser-based survey audience selection

Usage no npm install needed!

<script type="module">
  import microsurvey from 'https://cdn.skypack.dev/microsurvey';
</script>

README

Microsurvey

Lightweight audience selection for survey applications. The researcher and statistician on top of microask's survey builder.

Usage

Set up a survey:

var microsurvey = require('microsurvey');
var survey = microsurvey({
  id: 'my-survey-id',
  multipleResponsesAllowed: false, // can a session respond multiple times?
  promptLimit: 5,                  // how many responses are allowed?
  promptPercentage: 0.8,           // odds that a session will see the survey
});

Now, check whether the survey is available:

if (survey.isAvailable) {
  // ... show survey
}

...and update it when responses are received:

function onSurveyResponse () {
  survey.track();
}

License

MIT