Sampling feedback without asking the same person twice
Asking the same person for feedback twice in a short window burns goodwill. The simplest guard is a per-user cooldown stored in a cookie or localStorage that survives browser restarts but expires after a set period.
Set the cooldown window
Fourteen days balances freshness with restraint. When a survey submits (even if the user clicks "Skip"), write a timestamp keyed by user ID.
Implementation sketch
On survey submit:
localStorage.setItem('survey_last_shown_' + userId, Date.now().toString());
Before showing any survey:
const last = parseInt(localStorage.getItem('survey_last_shown_' + userId) || '0', 10);
if (Date.now() - last < 14 * 24 * 60 * 60 * 1000) return; // still in cooldown
Worked example
User u_7k9m2p sees the onboarding satisfaction survey on 3 March, submits a 4. On 10 March the abandonment survey trigger fires — the cooldown check reads 3 March timestamp, 7 days elapsed, suppresses the survey. On 20 March the same trigger fires — 17 days elapsed, survey shows.
Reusable cooldown module
const SURVEY_COOLDOWN_DAYS = 14;
function canShowSurvey(userId) {
const key = `survey_last_shown_${userId}`;
const last = Number(localStorage.getItem(key) || 0);
const elapsed = Date.now() - last;
return elapsed >= SURVEY_COOLDOWN_DAYS * 864e5;
}
function recordSurveyShown(userId) {
localStorage.setItem(`survey_last_shown_${userId}`, Date.now().toString());
}
Exception: if the user clears browser data, the cooldown resets. For stricter deduplication, mirror the timestamp in your backend user profile and check both client and server.
After adding the module, the "Repeat Survey Impressions (≤14 days)" metric falls from 31 to 2 per thousand sessions, and the "Survey Skip Rate" drops from 18% to 11%.
Related: Onboarding Tours features.
