I'm not trying to return to the previous page. I'm building a database and creating my own analytics based on how people are traversing my site and storing the paths that people are taking.
Why not do this by storing the current path when a page is visited (instead of the previous one)? As long as you have some kind of identifier (like a session or user ID), you can still figure out how people are traversing. As @jlrdw pointed out, there is a helper for retrieving the current path.
As for the previous path, there doesn't seem to be a helper, but you can easily make your own. Just str_replace the base url with an empty string to get the path, e.g.
str_replace(url('/'), '', url()->previous())
Edit: updated the example