Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Previous Page URL profile script

Avatar

Level 2

Would this be the correct way to construct a script that would show the visitor's previous page?

 

var lastCurrentPage = user.getLocal('currentPage') || "";
user.setLocal('currentPage', page.url);
return lastCurrentPage;

1 Reply

Avatar

Level 2

Does it make more sense to use the out of the box audience setting provided by Target? you can find the current page url and previous page url with the value you want.

Screenshot 2022-04-08 at 3.47.43 PM.png