Expand my Community achievements bar.

Join us for our second AMA on experimentation and personalization strategies with Target, occurring on June 3rd!
SOLVED

make audience with people who view xyz.com page three days ago

Avatar

Level 9

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?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 2

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.

View solution in original post

6 Replies

Avatar

Correct answer by
Level 2

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.

Avatar

Level 9

Thanks!

Where is the URL with the list of all of these variables? 

lastVisitPageX

 lts not here... 

https://experienceleague.adobe.com/en/docs/target/using/audiences/visitor-profiles/variables-profile...

Avatar

Level 2

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.

Avatar

Level 9

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?

Avatar

Level 2

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.

Avatar

Level 9

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());
  }
}