确定已访问网页的次数 [英] Determine how many times webpage has been accessed

查看:89
本文介绍了确定已访问网页的次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以确定在服务器上访问特定网页的次数。如果可能的话,我想通过cPanel进行此操作,因为该网站是在Wordpress中创建的,但是有问题的页面是我从头开始制作的,只是将其上传到另一个目录中。因此,我不能依靠插件(对吗?),并且我不了解足够的PHP或JavaScript来与Web服务器通信并在其上存储该信息...

I was wondering if there is a way to determine how many times a specific webpage has been accessed on the server. If possible, I would like to do this via cPanel, since the website is made in Wordpress, but the page in question I made from scratch and just uploaded it in another directory. So, I can't rely on plugins (right?) and I don't know enough PHP or JavaScript to communicate with web server and store that info on it...

推荐答案

您的服务器已经在执行此操作,它称为日志文件。如果在给定的页面上添加grep并计算日志输入的数量,则将有查看该页面的访问者数量。

Your server is already doing that, it is called the log file. If you grep it for the given page and count the number of log enteries, you will have the number of vistors who viewed that page. This, however, is inefficient and doesn't "work with CPanel".

接下来,您可以编写一个简单的脚本来插入一个条目每当有人访问该页面时,都将其存储到数据库中。然后,您可以通过添加到CPanel的自定义PHP查询您的答案。

Next, you could write a simple script to insert an entry to a database every time someone visits that page. Then your answer could be queried by custom PHP you add to CPanel. This is more effiecient, but would be reinventing the wheel.

但是,真正的答案是获得分析软件。有很多产品可以为您做到这一点:

But, the real answer is get analytics software. There are a number of products that can do this for you:


  • Google Analytics -这是一种Google产品,该产品可以收集大量不同类型的用户信息,生成功能强大的报告,并且可以在线免费获得。将数据提供给Google的弊端-因此,如果您有隐私权政策,则希望专门调出您正在执行的Google Analytics(分析)跟踪。

  • Google Analytics - This is a Google Product that collects lots of different types of user information, generates powerful reports, and is freely available online. It has the downside of giving that data to google - so if you have a privacy policy, you'd want to specifically call out the Google Analytics tracking you're doing.

Piwik -您可以托管在云上,也可以自己托管。它是一款免费的开源软件,可完成Google Analytics(分析)的大部分工作。您将拥有自己的数据,并且该数据将驻留在服务器上,某些小部件可以嵌入到页面中,因此可以将某些工作集成到CPanel中。这些报告看起来不像Google Analytics(分析)那样精细,但这可能值得权衡。

Piwik - This you can either get cloud-hosted, or host it yourself. It's free open-source software that does most of what Google Analytics does. You'd own your data and that data would reside on your server, there are widgets that could be embedded on pages so with some work could be integrated into CPanel. The reports are not as polished looking as Google Analytics, but that might be worth the trade-off.

这篇关于确定已访问网页的次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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