简体   繁体   English

如何获得用户访问页面的次数?

[英]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.

相关问题 如果用户第一次访问网站的任何页面并单击后退按钮,那么如何将用户登陆到主页 - If user visit any page of website first time and click backbutton, then how to land the user on home page 如何在访问时在文本字段中获取并插入用户的电话号码 - How to fetch and insert user's phone number in text field on visit 如果我第二次访问应用程序,如何重定向到第二个页面 - How to redirect to a second page if I visit the application second time 跟踪特定用户访问页面时在每个页面上花费的时间,并在数据库中记录 - Keep track on time spent on each page when a particular user visit a page and keep a record in database 使用vbscript获取页面访问的屏幕宽度 - get screenwidth on page visit with vbscript 测量用户在网站访问期间花费的时间 - Measure time spent by a user during a website visit 使用 Servlet 中的 COOKIES 检查用户是否第一次访问 - To check if user first time visit or not with COOKIES in Servlet 如何在页面上记录访问时间? - How to log visit duration on page? 如何获取用户向下滚动页面的像素数? - How to get the number of pixels a user has scrolled down the page? 如何在Page_Load获取用户本地时间 - How to get user local time at Page_Load
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM