コミュニティアチーブメントバーを展開する。

Get ready! An upgraded Experience League Community experience is coming in January.
解決済み

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

Avatar

Level 10

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?

トピック

トピックはコミュニティのコンテンツの分類に役立ち、関連コンテンツを発見する可能性を広げます。

1 受け入れられたソリューション

Avatar

正解者
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.

元の投稿で解決策を見る

6 返信

Avatar

正解者
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 10

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 10

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 10

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