I want so show intercept survey only when user visit the page 10th time meaning if i logged in today it is my first visit. ….8th time is 8th visit. only when i visit 10th time I should get popup.
How can i do this?
I want so show intercept survey only when user visit the page 10th time meaning if i logged in today it is my first visit. ….8th time is 8th visit. only when i visit 10th time I should get popup.
How can i do this?
Best answer by PeeyushBansal
Update, Qualtrics chat assistant was very helpful here and we implemnted as suggested by Qualtrics
Place this code snippet on every page where you want to track visits:
function getCookie(name) {
let match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
return match ? parseInt(match[2], 10) : null;
}
function setCookie(name, value, days) {
let expires = "";
if (days) {
let date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + value + expires + "; path=/";
}
// Increment visit count
let visitCount = getCookie('visitCount');
if (visitCount) {
visitCount += 1;
} else {
visitCount = 1;
}
setCookie('visitCount', visitCount, 365); // Cookie lasts 1 yearIn your Qualtrics intercept logic, add a Cookie condition:
visitCount10This will ensure the intercept only displays on the 10th visit.
Enable Repeated Display Prevention in your intercept settings so the popup does not show again after the 10th visit.
visitCount—you can change this if needed.Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.