Audience profile script - (visit-based)

Avatar

Avatar
Validate 1
Level 2
simonb23491113
Level 2

Likes

13 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
simonb23491113
Level 2

Likes

13 likes

Total Posts

13 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
simonb23491113
Level 2

02-08-2019

Hi

I want to create an audience profile script - and asking for someones help and expertise please!

In Target I can get the out-of-the-box "previous page" audience rules, but instead of just being their immediate previous page' I want this to apply for their full visit/session i.e. user has browsed through "<url>" within current visit.

Could someone please help me share or write a profile script rule that will do this?

Thanks

Replies

Avatar

Avatar
Contributor
Level 4
rajneesh_gautam
Level 4

Likes

65 likes

Total Posts

68 posts

Correct reply

12 solutions
Top badges earned
Contributor
Ignite 5
Ignite 3
Ignite 1
Validate 1
View profile

Avatar
Contributor
Level 4
rajneesh_gautam
Level 4

Likes

65 likes

Total Posts

68 posts

Correct reply

12 solutions
Top badges earned
Contributor
Ignite 5
Ignite 3
Ignite 1
Validate 1
View profile
rajneesh_gautam
Level 4

07-08-2019

Hi simonb23491113​,

Since Adobe Target doesnt have any notion of Visits, you can use proxy of 30 mins since  your target page visited. In that case, following code can help:

if (page.url != "") {

     if (page.url.indexOf("<provide some rule here>") >-1) {

           user.setLocal('last_time_page_visited', new Date().getTime()); //Reset the time when your target page is visited

      }

}

var minutesInMillis = 1000 * 60

var last_time_page_visited = user.getLocal('last_time_page_visited');

if (last_time_page_visited) {

     var time_since_last_visit = ((new Date()).getTime()-last_time_page_visited)/dayInMillis; // This gives number of minutes since your target page visited.

     if (time_since_last_visit < 30) {

          return "true"; //Return true if target page is being visited in the same visit

     }

     else

     {

          return "false"

     }

    

}