简体   繁体   中英

Detect if website was visited directly..is it possible?

It is possible to detect if my website was visited directly (by user typing in the address as the URL) or if they have visited it by a link they found elsewhere or by a google search result link? Is this even possible?

You can use:

document.referrer

which returns 'A String, representing the URL of the document that loaded the current document. Returns the entire URL, including the protocol (like http://). If the current document was not opened through a link (for example, through a bookmark), an empty string is returned.'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM