是否可以跟踪离开或寻呼到其他站点的访问者? [英] Is it possible to track visitor that leave or page to another sites?

查看:81
本文介绍了是否可以跟踪离开或寻呼到其他站点的访问者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以跟踪离开或寻呼到其他站点的访问者, 仅在他们想移至其他网站或其他域名时才问问题?我写这段代码

Is it possible to track visitor that leave or page to another sites, like ask question only when they want move to another sites or other domain name? I write this code

<script language="JavaScript">
  window.onbeforeunload = confirmExit;
  function confirmExit()
  {
    return "leave?";
  }
</script>

但是,即使在我自己的页面上,此代码也始终有效.我想让此代码仅在访问者通过提示URL(而不是通过链接)转到另一个域时运行.是否有可能?谢谢

But this code work everytime even on my own pages. I want to make this code to run just if visitors go to another domain by tiping URL (Not by links). Is it possible? Thanks

推荐答案

我认为这是浏览器插件的任务,而不是页面脚本. JS无法知道用户在页面外的操作.

I think this is a task for a browser plugin, not a page script. It's not possible for JS to know what the user does outside the page.

如果可能的话,那将是一个全新的安全问题,一个隐私问题,我将不会访问您的网站.

If this were possible, that would be a whole new security problem, a privacy issue, and I won't visit your site.

这篇关于是否可以跟踪离开或寻呼到其他站点的访问者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆