Hi, I am currently using the "Site Pages: Landing page URL" + "Visitor Profile: Not first page of session" to target an audience of users who started on a specific page during their session. I would like to change this from landing page to the user having visited at any point in the session - how would I achieve this? I suspect this would require a profile script but am not well-versed in how to write those. Thanks in advance
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @madhuraj87 ,
As I understand it, you need to create an audience of visitors who visited a particular URL on your website during a given session. To achieve this you can create the following profile script (page_visited):
var desired_url = 'https://abc.com'; //enter your desired page URL
var sessionIdcur = user.getLocal('sessionIdcur') || null; //get the current sessionId
//retrieve the value stored in your profile script, default value is 'false'
var page_visited = user.get('page_visited') || false;
// check if the user starts a new session using the current sessionID stored
if (sessionIdcur !== user.sessionId) {
//set the new session ID value
user.setLocal('sessionIdcur', user.sessionId);
page_visited = false; // Reset page visit for a new session
}
if (page.url == desired_url) {
page_visited = true; // Set to true if the user visits the page
}
return page_visited;
Let me know if that solves your issue 🙂
Hi @madhuraj87 ,
As I understand it, you need to create an audience of visitors who visited a particular URL on your website during a given session. To achieve this you can create the following profile script (page_visited):
var desired_url = 'https://abc.com'; //enter your desired page URL
var sessionIdcur = user.getLocal('sessionIdcur') || null; //get the current sessionId
//retrieve the value stored in your profile script, default value is 'false'
var page_visited = user.get('page_visited') || false;
// check if the user starts a new session using the current sessionID stored
if (sessionIdcur !== user.sessionId) {
//set the new session ID value
user.setLocal('sessionIdcur', user.sessionId);
page_visited = false; // Reset page visit for a new session
}
if (page.url == desired_url) {
page_visited = true; // Set to true if the user visits the page
}
return page_visited;
Let me know if that solves your issue 🙂
Also please note that according to Adobe Target, by default a session expires after 30 minutes of inactivity - https://experienceleague.adobe.com/en/docs/core-services/interface/data-collection/cookies/target
Views
Replies
Total Likes
Thank you! When creating an audience using this profile script, should I be selecting "parameter present" or "parameter value is present"?
Views
Replies
Total Likes
You should select equals (true or false).