For analytics purposes, I'd like to catch when a user transitions from one page of my site (which will be running the JS) to another within my site, or if they left entirely.
If they transitioned between pages on my site, ie. Page1 -> Click link -> Page 2 , I'd like to catch the URL of the page they are transitioning to (Page 2).
Is this possible by listening to some unloading events or something?