Expand my Community achievements bar.

SOLVED

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 Accepted Solution

Avatar

Correct answer by
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

View solution in original post

1 Reply

Avatar

Correct answer by
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