惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
博客园 - 聂微东
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
D
Docker
B
Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
月光博客
月光博客
F
Fortinet All Blogs
爱范儿
爱范儿
H
Help Net Security
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
The Cloudflare Blog
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
U
Unit 42

James Guo’s Portfolio (@ZE3kr)

Hertz Rental Debt Collection and How I Sued the Debt Collector macOS on iPad? (with Jump Desktop) Vision Pro Initial Experience | ZE3kr The Downtime of Alibaba Cloud Hong Kong Region How Fast is mmWave 5G? 2000Mbps! See if Your iPhone Supports mmWave Magic Keyboard for iPad Pro Experience Self-built PowerDNS Advanced: GeoDNS, dnsdist, Lua Records SSD USB, Windows To Go and Mac WordPress 5.0 Update is Available, New Editor, New Theme Azure DNS, NS1, Constellix, Comparison of Three International GeoDNS Service Providers Recommendations for Some Exquisite and Useful Software on Mac Talk About Data Backup | ZE3kr Introduction to DNSSEC, How Signatures Work Cloudflare Argo And Railgun Comparison Test, The technology of CDN Acceleration Recommendations For Several Free Server Monitoring Services Comparison of Several Full-Site CDNs 2017, Another Look at SSL and HTTPS Some suggestions on website construction and service purchase Detailed Explanation of DNS Domain Name Resolution System - Basics Build Blazing Fast Mobile Pages With AMP Cloudflare's new feature experience - Load Balancing, Rate Limiting Back to WordPress' Built-In Comment System Implementing ECDSA/RSA Dual Certificate with Free Let's Encrypt How to configure for pure IPv6-Only network access Self-built PowerDNS GeoDNS Server | ZE3kr Install GitLab on Your Own Server Instead of GitHub! A Few WordPress Optimization Suggestions Comprehensive Comparison of DNS Services such as CloudXNS, Route 53, and Alibaba Cloud DNS Talk about the streaming of video on the Internet Canon Announces New APS-C Model EOS 80D, Powerful Video Recording, New Focus System and CMOS
Using Matomo with WordPress to Build a Powerful Statistic...
2016-01-23 · via James Guo’s Portfolio (@ZE3kr)

Before it can be used together, Matomo (formerly Piwik) needs to be installed first. Go to Matomo’s official website to download the package, and then extract it to the server. Of course, it is better if your server supports one-click installation of Matomo. A PHP environment and MySQL database are required. Just follow the steps to install. It is best to install it under the same host as WordPress, which is more convenient to use.

Geolocation Function

Go to the Geolocation page in Settings and select Download a GeoIP database in the lower left corner of the page. After downloading, you can use GeoIP (Php), however this is slow. I recommend you to use GeoIP (PECL), if you are using cPanel, then you can enable GeoIP module directly in Select PHP Version page, then go to php.ini to add or Edit this line:

1
geoip.custom_directory = /Matomo/misc

Then OK, select GeoIP (PECL) and that’s it!

Working with WordPress

First, you need to install Matomo Analytics under WordPress (perfectly supports multi-site), and then go to settings. If you have both WordPress and Matomo installed on one site, choose the PHP API, otherwise choose the HTTP API. Fill in the Matomo path and Auth Token (which can be found in Matomo’s backend), then open Enable Tracking and select the default tracking. In Show Statistics, you can choose which statistics are displayed in which places, which is very convenient.

When you choose Show per post stats, you can see the visitor information of this article on the edit page of each article, which is very nice.

Working with CloudFlare

First, in order to correctly identify the user IP, you need to add the following line of code to config/config.ini.php.

1
proxy_client_headers[] = "HTTP_CF_CONNECTING_IP"

If your CloudFlare has IP Geolocation enabled, then you don’t actually need to enable GeoIP on the host. Just create a .htaccess file in the root directory and add the following lines of code:

1
2
3
RewriteEngine On
RewriteBase /
RewriteRule ^ - [E=GEOIP_COUNTRY_CODE:%{HTTP:CF-IPCountry}]

Then go to the geographic location option of Matomo statistics. Now, your geographic location option can choose the third GeoIP (Apache), which is the fastest.