简体   繁体   中英

Can I tell the last website someone visited before my site?

Let's say someone clicks a link for my blog acme.com.

Is it possible to determine the source that they came from? By source I mean, can I tell whether they clicked on this link from Facebook or Google or another blog?

This is operating under the assumption that they had to enter my site from clicking a link.

I'm also assuming that I don't have any trackers on this user and it is their first time visiting my website. And I don't have access to Google Analytics.

You can check the document.referrer . It is meant precisely for this case.

标题中的引用,但我会说除此之外没有。

尝试这个:

console.log(document.referrer);

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