[英]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? 可以检测是否直接访问了我的网站(通过用户输入地址作为URL),或者是否通过他们在其他地方找到的链接或通过Google搜索结果链接访问了我的网站? Is this even possible?
这有可能吗?
You can use: 您可以使用:
document.referrer
which returns 'A String, representing the URL of the document that loaded the current document. 它返回'A String,代表加载当前文档的文档的URL。 Returns the entire URL, including the protocol (like http://).
返回整个URL,包括协议(例如http://)。 If the current document was not opened through a link (for example, through a bookmark), an empty string is returned.'
如果当前文档没有通过链接(例如,通过书签)打开,则返回一个空字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.