Hi David,
My suggestion would be to cookie those visitors on first visit to the experience, and then add an IF/ELSE rule to prevent your code from firing, if the cookie is found, on their second visit.
I am sure there are other more advanced solutions, but this has worked for me in the past
.
Good luck:
CODE:
/* Create Cookie */
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
};
/* Read Cookie */
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
};
$(document).ready(function () {
if (readCookie('cookiename') == 'cookievalue') {
console.log('do nothing')
} else {
// Put the rest of your experience code here //
createCookie('cookiename','cookievalue',90)
console.log(' code was fired and cookie was created');
};
});