Avatar

Correct answer by
Community Advisor

hi @avez  - gave this scenario some thought and came up with a possible solution:

1. Create a profile script which captures the Target-session id whenever xyz.com/mobile.html is visited. Let's call it mobilepage_sessionid. This can be done by using user.sessionId in the profile script. 
if (page.url != "") {
var url = "" + page.url.toLowerCase();
if (url.indexOf("xyz.com/mobile.html") >-1 {
return user.sessionId
}
}

2. Create another profile script which captures the session-id when home page is visited. In this one, compare the current session-id with the mobilepage_sessionid and return true when both session-ids are different.  For the same visit - this profile script will return false otherwise true. Use this profile script as your audience.

var a = user.get('mobilepage_sessionid');
if(a && a !== user.sessionId){
return true; // different visit after mobile.html page was visited
}

else {

return false; // same visit

}

View solution in original post