I would like to get the ID (or permalink) of the page the visitor visited just before visiting the current page - in other words the ID of the last page in the browser history.
Can this be done? Any idea how to do it?
Break this down into two parts:
First, we create a variable that stores that last-visited page URL, like this:
I haven't tested this but it should work - let me know how it does! Good luck ;)