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

推荐订阅源

云风的 BLOG
云风的 BLOG
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
博客园 - 司徒正美
美团技术团队
Last Week in AI
Last Week in AI
月光博客
月光博客
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
U
Unit 42
T
Tailwind CSS Blog
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
H
Help Net Security
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
Netflix TechBlog - Medium
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
Y
Y Combinator Blog
罗磊的独立博客
D
DataBreaches.Net
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园_首页
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
博客园 - Franky
M
MIT News - Artificial intelligence
B
Blog
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
S
SegmentFault 最新的问题
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
Microsoft Security Blog
Microsoft Security Blog

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 Several recommended plugins for WordPress TL-PA500 power cat, deploy wireless LAN cluster Why use a CDN service? The pros and cons of static web pages HTTPS Everywhere is Coming | ZE3kr Withings Activité Pop smartwatch recommendation, sleep tracking, exercise recording, smart alarm clock DELL P2415Q 4K Monitor Recommended Use srcset + sizes attributes and w identifier to solve all responsive image problems Eyefi Mobi makes your camera Wi-Fi ready now Mobile First - Speed | ZE3kr MacID Lets iPhone Unlock Apple's Mac with Touch ID ProCamera – Recommended iPhone camera software Mobile First - Origins | ZE3kr
Using Matomo with WordPress to Build a Powerful Statistics System
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.