In this article
You can throttle, or limit, the number of completed surveys that are allowed by a program in a specific time-frame. This allows you to control the through-put of completed interviews for a particular survey in the program. Note that a counter applies to a specified survey, so if for example your program has three surveys that will open under different circumstances, then each survey can have its own counters that can have different limits.
The time-frames you can set limits for are hour, day or week. For example for one survey you could set a limit of maximum 50 completes per hour, with 500 per day and 2000 per week, and for another survey in the same program you could set a limit of maximum 100 completes per hour, with 1000 per day and no upper limit for a week. Once the limit is reached for a time-frame, the invitation (if used) or the survey will not be displayed again until the start of the next time-frame. Note that the counters register completed surveys, so if several visitors are responding to a survey simultaneously then you can exceed the counter limits.
The counters are based on the time used by the server that is running your Digital Feedback application, with the new week starting on the Monday.
Note that you can set up the counters using scripting or by Creating a Scenario Template.
Counters are loaded asynchronously on-demand (i.e. only if needed).
The syntax to be used is: api().loadCountersAsync().then(onCountersLoaded);
“loadCountersAsync” begins loading counters from the server.
“loadCountersAsync” returns standard javascript Promise, so it must be chained with continuation function (in example above “onCountersLoaded”).
Once counters are ready, the continuation function will be called and the api instance (in example above “ctx”) with loaded counters will be passed in as an argument.
Below is an example of the script to set up an hourly quota for completes:
function onCountersLoaded(ctx) {
var hourlyQuota = 50;
var counters = ctx.scenarioCounters('p0000001');
if (counters.completesCurrentHour > hourlyQuota)
return;
ctx
.invite('My invite')
.container('My container')
.survey('p0000001')
.show();
}
api()
.loadCountersAsync()
.then(onCountersLoaded);