When many people think of statistics, they are limited to Google Analytics, Baidu Statistics, webmaster statistics, etc. These types of statistics are systems developed by third-party companies such as search engines. Naturally, they are useless in terms of functionality and ease of use, but the only One problem is that statistical data is stored on a third-party server, which poses certain risks for some websites with strong confidentiality.
Another problem with using third-party web statistics is insecurity. For example, it has been reported that JS files such as Baidu Statistics and Webmaster Statistics have malware and the statistics server is down. Although there have been no major problems with Google Analytics, Google Analytics is often inaccessible, which seriously affects the loading speed of web pages. This is why I had to give up GA.
Instead of using Google Analytics and Baidu Statistics, we can seek to build our own statistical system. Piwik is a free and open source PHP statistical system with high popularity and reputation. In terms of functionality, Piwik is comparable to Google Analytics. Piwik supports plug-ins. You can use plug-ins to extend Piwik's functions or remove some unnecessary functions, which can basically meet the daily statistical needs of small and medium-sized websites.
Piwik is built using PHP+MysqL, so any web server in LNMP or LAMP environment can run Piwik. This article will share how to install and use Piwik. For more webmaster tools, you may need:
- Summary of Linux system monitoring commands - master CPU, memory, disk IO, etc. to find performance bottlenecks
- Generate and subscribe to RSS tools for any website - realize RSS full text, email and mobile APP reminders
- Three command tools Rsync, SCP, and Tar-quick solution to VPS remote website relocation and data synchronization
PS: Updated on March 3, 2018, Piwik has been renamed Matomo, just a change of name. The installation and use methods are the same as the original Piwik.
1. Piwik installation method
Piwik official website:
- Website: https://matomo.org/
- Website: https://piwik.org/
- Demo: https://demo.piwik.org
1.1 Installation Requirements
Installing Piwik requires that the server meets at least the following conditions:
Supports Apache, Nginx, IIS, etc.
PHP version is at least 5.5.9
MySQL version is at least 5.5 or MariaDB
Enable PHP extension pdo and pdo_mysql, or the mysqli extension.
The official website recommends using PHP 7 or above, MySQL 5.7+ or MariaDB as the database. It is recommended to use Oneinstack or LNMP one-click installation package, which supports one-click installation of the latest versions of PHP, Nginx, MysqL, etc.
1.2 Installation process
Go to the official website to download the latest version of Piwik installation package, and unzip it to the server root directory. Then visit the website with a browser, and you will see the Piwik installation interface. Be sure to switch the language to Chinese first.
3. Piwik setting method
3.1 Install plug-in
Piwik supports third-party plug-in activation, and you can choose to pause or enable different plug-ins.
You can download Piwik plug-ins and themes in the mall options.
3.2 GeoIP Database
If you find that there is a problem with Piwik displaying the geographical location of visitors, it may be that the GeoIP database has not been downloaded or updated. You can download or update it manually.
4. Summary
Piwik is an excellent open source website statistics system. In terms of functions, visitor analysis, source analysis, target analysis, etc. are basically the same as Google Analytics. Our daily Google Analytics statistics are basically these functions. Piwik can basically satisfy us. need.
The only problem when using Piwik is probably to ensure that the server is stable, because if the server used for statistics is unstable, the statistical results may not be very accurate. In addition, Piwik may not be accurate in displaying domestic visitor IP locations. You can manually enable or update MaxMind's IP database.