Reset profile script value on session expiration
Hello All,
I have a scenario where a user journey consists of three pages. When a user visits page one, a value of 1 is set. Likewise, when the user visits page two, the value is set to 2, and the same applies to page three.Based on this value, I will display a particular experience on the home/logout page.
However, if the user remains inactive for more than 30 minutes, or if the current session expires, the value should be reset to '0'.
Here is my current script:
var journeyPage = user.get("journeyDrop");
if (page.url.indexOf('https://example.com/form.html') > -1) {
journeyPage = 1;
}else if (page.url.indexOf('https://example.com/plans.html') > -1) {
journeyPage = 2;
}else if (page.url.indexOf('https://example.com/success.html') > -1) {
journeyPage = 3;
}
return journeyPage
Thanks in advance!