How to get users browsing history

N

Noodle

Hi All,

I know that document.referrer can be used to get the last page the user
visited, but how can I get the page visited before that? Can this be
done in JS?

TIA
 
R

RobG

Noodle said:
Hi All,

I know that document.referrer can be used to get the last page the user
visited,

You might think that gives you the last page visited, but it is very
unreliable.

If whatever UA I am using decides to give you a referrer, it might be
the page that linked to your site or it could be whatever I told the UA
to send you. If I have copied the link and pasted it, you'll get no
referrer at all.

but how can I get the page visited before that? Can this be
done in JS?

No. You can't access the browser history, all you can do is attempt to
send the user backward or forward some count of links based on the
history of the window or tab that the page has been opened in - which
might not be the window that was used to navigate to the page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top