Alle Kollektionen
Website Channels - General
How to Show the Website Survey to a Specified Amount of Audience
How to Show the Website Survey to a Specified Amount of Audience
Decide if you want to show the zenloop survey only to some people.
Verfasst von Felix Schlenther
Vor über einer Woche aktualisiert

It is possible to show the website survey to a specific percentage of people visiting the page using the simple math function showed below.

In the beginning, we specify the audience percentage we want to show the survey.
In this case it is:

min/max, so 1/20 = 5%

Then, if the value has been drawn, the Zenloop.recipient object will be populated and the survey will be shown.

JavaScript example below:

var min = 1,
max = 20,
random = Math.floor(Math.random() * (max - min + 1)) + min;

if (1 === random) {

var script = document.createElement("script");
script.onload = function() {

var Zenloop = window.Zenloop || {};
var date =;
Zenloop.recipient = {
identity: '',
identity_type: 'email',
first_name: 'John',
last_name: 'Doe',
date: date,
properties: {
color: 'red',
height: 100

script.src = "";

script.setAttribute("id", "zl-website-overlay-loader");


SURVEY_HASH_ID has to be replaced by your survey HashID, and the Zenloop.recipient object has to be customised up to your needs.

Hat dies Ihre Frage beantwortet?