Intercept show on 10th visit | XM Community
Skip to main content
Solved

Intercept show on 10th visit

  • November 10, 2025
  • 6 replies
  • 50 views

PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+43

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

 

Step 1: Add JavaScript to Track Visit Count

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 year

Step 2: Qualtrics Intercept Logic

In your Qualtrics intercept logic, add a Cookie condition:

  • Cookie Name: visitCount
  • Condition: Equal To
  • Value: 10

This will ensure the intercept only displays on the 10th visit.

 

 

Step 3: Prevent Repeated Display

Enable Repeated Display Prevention in your intercept settings so the popup does not show again after the 10th visit.

Additional Notes

  • Make sure this code runs on every page you want to count as a visit.
  • The cookie is named visitCount—you can change this if needed.
  • If you want to reset the count (for testing), clear the cookie in your browser.

6 replies

gPandey_715
Level 3 ●●●
Forum|alt.badge.img+8
  • Level 3 ●●●
  • 45 replies
  • November 11, 2025

I am interested to know about this if you found a solution.


vgayraud
QPN Level 6 ●●●●●●
Forum|alt.badge.img+58
  • QPN Level 6 ●●●●●●
  • 549 replies
  • November 11, 2025

Your could probably integrate Google Analytics and pass a session counter used in your sampling logic.


Sachin Nandikol
QPN Level 6 ●●●●●●
Forum|alt.badge.img+44
  • QPN Level 6 ●●●●●●
  • 531 replies
  • November 11, 2025

Hello ​@PeeyushBansal,

Did you tried setting up condition as ‘Browsing Session and then Page Count, Choose Total Pages Visited (or Unique Pages Visited if you want to count only unique pages), Set the condition to Greater than to 7’ as shown in below screenshot.

 

Let me know if this works.


PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+43
  • Author
  • Level 6 ●●●●●●
  • 1171 replies
  • November 12, 2025

@Sachin Nandikol this is not about the page counts it is 10 different logins.


vgayraud
QPN Level 6 ●●●●●●
Forum|alt.badge.img+58
  • QPN Level 6 ●●●●●●
  • 549 replies
  • November 12, 2025

As far as I know, Qualtrics doesn’t store natively the number of sessions, that’s why you need an external tool like Google Analytics or Adobe Analytics, or to be able to pass a variable from your website.


PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+43
  • Author
  • Level 6 ●●●●●●
  • 1171 replies
  • Answer
  • November 12, 2025

Update, Qualtrics chat assistant was very helpful here and we implemnted as suggested by Qualtrics

 

Step 1: Add JavaScript to Track Visit Count

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 year

Step 2: Qualtrics Intercept Logic

In your Qualtrics intercept logic, add a Cookie condition:

  • Cookie Name: visitCount
  • Condition: Equal To
  • Value: 10

This will ensure the intercept only displays on the 10th visit.

 

 

Step 3: Prevent Repeated Display

Enable Repeated Display Prevention in your intercept settings so the popup does not show again after the 10th visit.

Additional Notes

  • Make sure this code runs on every page you want to count as a visit.
  • The cookie is named visitCount—you can change this if needed.
  • If you want to reset the count (for testing), clear the cookie in your browser.