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 ;)
I've done this trick like this to allow me to also check if it is one of my pages :
//Get the last page link from history
//Check if not null and if it contains my blog url