Search code examples
javascriptjquerybrowser-history

Possible to get last 2, or even 3 URLS back from the user? similar to document.referrer


So, I am basically just trying to grab the previous URL of my new user (to discover how they got there), but it's a little more complicated because I have a redirect, etc. So, the below actually pulls in the redirect.. so my question: In a similar method as below, is there a way to get 2, or even 3 URLs back?

  var referrer = document.referrer;

Solution

  • Nope.

    If you want to record that information, you'll need to store it yourself when they hit your first redirect. If you want history before that, you're out of luck; that's private.