If you use a good logging analyzer, like Analog or something similar, it's not too difficult to figure out where the clicks to your site are coming from and which pages have been viewed.
But if you want to stop a running report, you have to take a different route
About six months ago, I was importing Apache log files into a SQL database and then running It does a special query.
Unfortunately, this requires me to manually extract these log files one by one, twist the format a little, and then output. I want something better. - Something that can be continuously updated and give me information about what content is viewed, browser and platform statistics, and trends over time.
The solution version of this article can help me a lot It's been working well for several years. I raised the importance of it when we built SourceForge via the SourceForge system, all records and traces through the SourceForge.net website pipeline, including web visitors at this URL and every page in the 1200 project Viewers.
Basically, every logging action I have to do is add a column to a database table (in this case it's web visitors, but you can log banner ads from other URLs Increased viewers, number of clicks, individual clicks, etc.)
This is the data table structure I am using on SourceForge:
create table activity_log (
day integer DEFAULT 0 NOT NULL,
hour integer DEFAULT 0 NOT NULL,
group_id integer DEFAULT 0 NOT NULL,
browser varchar(8) DEFAULT OTHER NOT NULL,
ver float(10) DEFAULT 0.00 NOT NULL ,
platform varchar(8) DEFAULT OTHER NOT NULL,
time integer DEFAULT 0 NOT NULL,
page text,
type integer DEFAULT 0 NOT NULL
);
If you are trying to record multiple URLs, the group_id field can be used. Just assign a different group_id to each URL and pass it in the URL address (shown below).
type is not used in these examples, but you can use it to track different types of behavior, such as the number of clicks on ads, the number of clicks from other URLs, etc.
Browser, ver, platform can all be sent from your browser to the website server. One step is to transfer the data into the data table. If everything in the box is available through PHP and all other different websites , that's a perfect world. Unfortunately, I have a lot of servers scattered across the country, and I have to collect every page browsing information from every server 24 hours a day.
So I A little trick is necessary to use a 1x1 pixel GIF. I have a GIF on each server page that looks like this:
There are four elements in this graphic
Remote web server
Web browser (user who visits the website)
Central logging server
Central database server
So when the user visits the website, they get a web page to use, The browser asks the server center to see a 1x1 gif image. The server center records that information to make product reporting easier.
Reports
Just write some simple SQL Generate all the data
Use the ShowResults() function to display it. You can also use graphs to represent it (refer to the prior article)
Now I can execute my statistical report at any time
Sample SQL to run reports
Page Views By Day
SELECT day, count(*)
FROM activity_log
WHERE type=0 GROUP BY day
Page Views By Browser
SELECT browser, count(*)
FROM activity_log
WHERE type=0 GROUP BY browser
Page Views By Browser Version
SELECT browser, ver, count (*)
FROM activity_log
WHERE type=0 GROUP BY browser, ver
Page Views By Platform
SELECT platform, count(*)
FROM activity_log
WHERE type=0 GROUP BY platform
Here.zip contains browser detection and database abstraction libraries.

Django框架是一种用于Web应用程序的Python框架,它提供了一个简单而强大的方式来创建Web应用程序。事实上,Django已经成为当前最受欢迎的PythonWeb开发框架之一,也成为很多公司的首选,包括Instagram和Pinterest。本文将深入探讨Django框架是什么,包括基础概念和重要组件,以及具体代码示例。Django基础概念Djan

作为一个流行的PHP框架,Laravel提供了许多便捷的请求方法来处理不同类型的HTTP请求。其中,Head请求方法是一个比较特殊且常被忽视的方法。在本文中,我们将深入探讨Laravel中Head请求方法的作用、用法和示例代码。什么是Head请求方法?Head请求方法是HTTP协议中定义的一种请求方法,在发送Head请求时,服务器将仅返回请求头信息,而不会返

Go语言是一门由Google开发的编程语言,具有高效、简洁、并发性强等特点。它在语法结构、包管理、高级特性等方面都有很大的优势,因此备受程序员青睐。然而,在实际开发中,很多项目会涉及到与传统的编程语言C进行交互,因此Go语言与C语言的兼容性就显得尤为重要。首先,我们来谈谈Go语言与C语言的兼容性。在Go语言中,可以通过CGo将Go语言与C语言进行交互。CGo

Go语言作为一种现代化的编程语言,以其简洁高效的特性在近年来受到越来越多开发者的喜爱和青睐。其中一个让人独特的地方就是其单线程特性。在传统的多线程编程语言中,开发者通常需要手动管理线程之间的同步和互斥,而在Go语言中,借助其独特的协程(Goroutine)和通信机制(channel),可以方便且高效地实现并发编程。一、Goroutine与单线程:Go语言中的

Golang是一种由谷歌开发的编程语言,其出色的性能和并发特性使其在各种领域中得到了广泛的应用,包括网络编程、大数据处理等。然而,对于一些需要直接操作硬件的领域,比如驱动程序开发,人们可能会开始思考:Golang是否适合用于编写驱动程序呢?本文将深入探讨这个问题,并通过具体的代码示例来展示Golang在驱动程序开发中的应用。首先,让我们来了解一下什么是驱动程

Golang的本质是脚本语言还是编译语言?探讨Golang,也被称为Go语言,是一种由Google开发的静态类型编程语言。自诞生以来,Golang一直备受开发者关注,其优秀的并发性能、简洁的语法和跨平台特性使其在各个领域得到广泛应用。然而,关于Golang到底是脚本语言还是编译语言,却一直存在着争议。脚本语言和编译语言在运行时的不同方式给人们留下了深刻的印象

Linux操作系统作为一种常用的开源操作系统,具有强大的可定制性和灵活性。在使用Linux系统时,我们经常会遇到各种特殊字符的处理。这些特殊字符在命令行中具有特殊的含义,能够实现很多高级功能。本文将深入探讨Linux中常见的特殊字符,并结合具体的代码示例来详细介绍它们的用法。通配符:通配符是用来匹配文件名的特殊字符,常见的通配符包括*、?、[]等。下面是几种

MyBatis(又称为iBatis)是一个流行的Java持久层框架,其设计理念是以SQL为核心,在实现SQL和Java对象的映射过程中提供了方便灵活的操作接口。MyBatis通过XML或注解方式配置SQL语句,并提供了丰富的查询方式,使得开发者可以更加直观地编写数据库操作的代码。本文将深入探讨MyBatis的作用和特点,以及提供具体的代码示例加以说明。作用和


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),