如何计算网站中每个页面的查看次数 [英] How do I count no of views for every page in a website

查看:65
本文介绍了如何计算网站中每个页面的查看次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何计算我网站中每个页面的浏览量,我知道如何计算访问者的总数,但我无法计算单独页面的浏览量



我尝试了什么:



i尝试使用与global.asax的会话并计算no of view并使用xml for没有。观点,但我认为为网站中的每个页面制作xml页面都不好

解决方案

我知道你说你不想使用第三方服务,但这正是Google Analytics等服务的制作方式。它们不仅可以让您获得页数,还可以获得加载速度,浏览器技术,访问者位置以及大量其他有用数据。还有一个插件或预制脚本可用于将代码添加到您的站点,而无需重新发明轮子。


html? php?



例如,如果您的页面是php,则每个页面都会呈现,它可以包含对函数的调用,以增加数据库中的计数。您甚至不需要命名页面,因为页面的信息可以从


_SERVER []数据中获取,这些数据可用于查找数据库中的条目以进行更新。 />


如果做得好,脚本可以为您添加条目,以便在添加新页面时使用基本通用计数脚本进行自我维护。


how do i count no of views in every page in my website i know how to count total no of visitors but i'm unable to count no of views for separate page

What I have tried:

i tried with using session with global.asax and count no of view and i used xml for counting no. of views but i think its not good to make xml page for every page in website

解决方案

I know you say you don;t want to use a third party service, but this is exactly what services like Google Analytics are made for. They not only get you page count, but load speed, browser technology, visitor location, and a whole raft of other useful data. There's also likely to be a plugin or premade script available to add the code to your site without you having to reinvent the wheel.


html? php?

If your pages are php, for example, as each page is rendered it can include a call to a function to increment the count in a database. You don't even need to name the page as the page's info can be gotten from


_SERVER[] data, which can be used to find the entry in the database for update.

If well done, the script could add entries for you so it becomes self-maintaining as you add new pages (with the basic generic counting script).


这篇关于如何计算网站中每个页面的查看次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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