[英]How to get the number of time a user visit a page?
Does anyone have any idea about how to get the number of time a user visit a particular site? 有谁知道如何获得用户访问特定站点的时间? For instance, if you do a search on google and there's a link that you clicked already, google will tell you how many times you have visited that particular link. 例如,如果您在Google上进行搜索,并且已经单击了一个链接,则google会告诉您访问该特定链接的次数。 Any ideas on how to code something like that using javascript? 关于如何使用javascript编写代码的任何想法?
Thanks. 谢谢。
In Google's case they can track that you have clicked on a link. 在Google的情况下,他们可以跟踪您是否单击了链接。 Its a specific action that they can attach a javascript listener to. 他们可以将javascript侦听器附加到的特定操作。 If you want to do the same thing on your own site, you can add some javascript that does something similar, and anytime a link is clicked an AJAX call can be made that will allow you to track that it was clicked. 如果您想在自己的网站上做同样的事情,则可以添加一些功能类似的javascript,并且每当单击链接时,都可以进行AJAX调用,以跟踪该链接。
However, if you are just looking to get some basic stats about pages on your site you can add Google Analytics to it, and it will gather a large amount of useful data for you. 但是,如果您只是想获取有关网站页面的一些基本统计信息,则可以向其中添加Google Analytics(分析),它将为您收集大量有用的数据。
http://www.google.com/analytics/ http://www.google.com/analytics/
If you want to know how many people are visiting your page, you probably want to check out something like Google Analytics rather than making it yourself. 如果您想知道有多少人正在访问您的页面,则可能要签出Google Analytics(分析)之类的东西,而不是自己制作。 It will give you a lot of data that you'd have to make a lot of effort to gather yourself. 它将为您提供大量数据,您需要付出很多努力才能收集自己的数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.