Is it possible to make in Target an audience which consists of people who visited specfic page view days ago? Using Profile Scripts? Or I need to buy CDP / Analytics in enable to track previous behaviour of the user?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @Michael_Soprano,
It is possible using profile scripts. You don't need CDP/ Analytics for this.
Step-1: Configure a profile script for setting the timestamp of the required page view and calculate the no. of days since last page view.
if (mbox.name === "your-mbox"){
if (page.url.toLowerCase() === "target page url"){
user.setLocal('lastVisitPageX', new Date().getTime());
}
}
var lastVisit = user.getLocal('lastVisitPageX');
if (lastVisit){
return (new Date().getTime() - lastVisit) / (1000 * 60 * 60 * 24); // Convert to days
}
}
Step-2: Activate the profile script and enable response token for debugging.
Step-3: Create an audience based on your requirement using the "no. of days since last page view" profile attribute.
Hi @Michael_Soprano,
It is possible using profile scripts. You don't need CDP/ Analytics for this.
Step-1: Configure a profile script for setting the timestamp of the required page view and calculate the no. of days since last page view.
if (mbox.name === "your-mbox"){
if (page.url.toLowerCase() === "target page url"){
user.setLocal('lastVisitPageX', new Date().getTime());
}
}
var lastVisit = user.getLocal('lastVisitPageX');
if (lastVisit){
return (new Date().getTime() - lastVisit) / (1000 * 60 * 60 * 24); // Convert to days
}
}
Step-2: Activate the profile script and enable response token for debugging.
Step-3: Create an audience based on your requirement using the "no. of days since last page view" profile attribute.
Thanks!
Where is the URL with the list of all of these variables?
lastVisitPageX
lts not here...
Views
Replies
Total Likes
The link you shared contains the built-in profile and mbox parameters that Adobe provides.
The "lastVisitPageX" is a custom persisted profile value that you create for storing the timestamp for the last page view.
Views
Replies
Total Likes
Thanks!
But where is explained in documentation that page.url is connected to previous URL visited by the user not the URL of the current page which user is on?
Views
Replies
Total Likes
It is mentioned in the URL variables in the document. (page.url gives the url of the current page that the user is on.)
page.url is analogous to the window.location.href function. For a more detailed explanation on the set up of profile scripts watch this video.
Views
Replies
Total Likes
So how can I use this page.url var if its connected with window.location.href function??
Or in that part I create variable for the user which is then follow-uped during multiple sessions? Could you give me more detailed explanation of your solution?
if (mbox.name === "your-mbox"){ if (page.url.toLowerCase() === "target page url"){ user.setLocal('lastVisitPageX', new Date().getTime()); } }
Views
Replies
Total Likes
Views
Likes
Replies