<p>Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer.</p>

<p>I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 sites ago? </p>

[{'answer_id': 48809, 'author': 'UnkwnTech', 'author_id': 115, 'author_profile': 'https://Stackoverflow.com/users/115', 'pm_score': 6, 'selected': True, 'text': '<p>Javascript this should get you started: <a href="http://www.dicabrio.com/javascript/steal-history.php" rel="noreferrer">http://www.dicabrio.com/javascript/steal-history.php</a><br />\nThere are more nefarius means to: <a href="http://ha.ckers.org/blog/20070228/steal-browser-history-without-javascript/" rel="noreferrer">http://ha.ckers.org/blog/20070228/steal-browser-history-without-javascript/</a> <br />\nEdit:I wanted to add that although this works it is a sleazy marketing teqnique and an invasion of privacy.</p>\n'}, {'answer_id': 48813, 'author': 'Andrei', 'author_id': 2718, 'author_profile': 'https://Stackoverflow.com/users/2718', 'pm_score': 2, 'selected': False, 'text': "<p>You can't access the values for the entries in browser history (neither client side nor server side). All you can do is to send the browser back or forward a number of steps. The entries of the history are otherwise hidden from programmatic access.</p>\n\n<p>Also note that HTTP_REFERER won't be there if the user typed the address in the URL bar instead of following a link to your page. </p>\n"}, {'answer_id': 48853, 'author': 'Andrew Johnson', 'author_id': 5109, 'author_profile': 'https://Stackoverflow.com/users/5109', 'pm_score': 1, 'selected': False, 'text': '<p>The browser history can\'t be directly accessed, but you can compare a list of sites with the user\'s history.  This can be done because the browser attributes a different CSS style to a link that hasn\'t been visited and one that has.</p>\n\n<p>Using this style difference you can change the content of you pages using pure CSS, but in general javascript is used.  There is a good article here about using this trick to improve the user experience by displaying only the RSS aggregator or social bookmarking links that the user actually uses:  <a href="http://www.niallkennedy.com/blog/2008/02/browser-history-sniff.html" rel="nofollow noreferrer">http://www.niallkennedy.com/blog/2008/02/browser-history-sniff.html</a></p>\n'}, {'answer_id': 5494272, 'author': 'heymatthew', 'author_id': 81271, 'author_profile': 'https://Stackoverflow.com/users/81271', 'pm_score': 3, 'selected': False, 'text': "<p>Unrelated but relevant, if you only want to look one page back and you can't get to the headers of a page, then <code>document.referrer</code> gives you the place a visitor came from.</p>\n"}]
['https://Stackoverflow.com/questions/48805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2757/']