简体   繁体   English

我可以告诉在我的网站之前有人访问过的最后一个网站吗?

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

Let's say someone clicks a link for my blog acme.com.假设有人点击了我的博客 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?我的意思是,我的意思是,我能告诉他们他们是从 Facebook、谷歌还是其他博客点击了这个链接吗?

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.而且我无权访问 Google Analytics。

You can check the document.referrer .您可以查看document.referrer It is meant precisely for this case.它正好适用于这种情况。

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

尝试这个:

console.log(document.referrer);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我该如何存储访问我网站的最近100个IP地址? - how can i store last 100 ip addresses who visited my website? 如何知道有人在使用 socket.io 之前是否访问过网站 - How to know if someone visited website before using socket.io 我能否检测我的 PWA 是作为应用程序启动还是作为网站访问? - Can I detect if my PWA is launched as an app or visited as a website? 如果他们以前从未访问过该站点,我如何重定向到其他 URL - How can I redirect to a different URL if they have never visited the site before 使用 javascript 确定最后访问的页面是否是我的网站 - Use javascript to determine if last page visited was my site 如何使用jQuery告诉网站访问者之前是否访问过该网站? - How, with jQuery do I tell if a website visitor has been to the site before? 根据上次访问的网站进行重定向 - Redirect based on last visited website 如何确定我的网站是否导致浏览器崩溃并烧毁? - How can I tell if my website is causing the browser to crash and burn? 有人能告诉我,我对HTML / JS代码的解释是否正确? - Can someone tell me if I am right in my explanation of HTML/JS code? 有人能告诉我为什么当我的链接下面有一个 div 时我的链接不可点击吗? - Can someone tell me why my links aren't clickable when I have a div under it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM