goatcounter
goatcounter copied to clipboard
Blocked by browser ad plugins and correctly identify user's geographic location
Introduction
Version: v2.5.0
Go: go1.21.5 linux/amd64 (race=false cgo=true)
Database: PostgreSQL 15.6
Uptime: 9h21m19s
I built my own Docker image, and the repository address is: docker-goatcounter. I found some problems during the trial.
When the secondary domain name is different, goatcounter will be intercepted by the ad filtering plugin
Browser version: Chrome, 127.0.6533.100
Ad blocking plugin version: uBlock Origin 1.59.0
Problem description
The access domain name of goatcounter is: stats.22.xyz, and the website that references goatcounter is file.33.info. When I visit file.33.info, I see the uBlock Origin interception information. The log is as follows:
06:45:59
*$ping,3p
--
file.itansuo.info
3
post
ping
https://stats.22.xyz/count?p=file.33.info%2F&t=%E6%96%87%E4%BB%B6%E5%BA%93&s=1440%2C900%2C2&b=0&rnd=kjhl7
Filter rule *$ping,3p
Rule list EasyPrivacy
Context file.33.info
First/third party (3) 33.info ⇒ 22.xyz
Type ping
URL https://stats.22.xyz/count?p=file.33.info%2F&t=%E6%96%87%E4%BB%B6%E5%BA%93&s=1440%2C900%2C2&b=0&rnd=kjhl7
Without any changes, the same secondary domain name can normally use goatcounter to count visitor information. For example, the domain name of goatcounter is stats.22.xyz
, book.22.xyz
can use file.33.info
but file.33.info
cannot be used. I also searched the Internet for some websites that use goatcounter and found that the vast majority of those that were not intercepted used the same secondary domain name. In addition to creating an access goatcounter for each secondary domain name, such as stats.22.xyz
, stats.44.com
, stats.899.info
, is there a solution that only uses stats.22.xyz
?
Goatcounter after nginx can correctly identify visitor geographic location
I use nginx to proxy goatcounter. When goatcounter counts, the visitor's address will be recognized as the nginx address. I did not find any relevant content in goatcounter.
nginx configuration
location / {
proxy_pass https://2334.899.dev;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
proxy_http_version 1.1;
proxy_ssl_name $host;
proxy_ssl_server_name on;
}
How to let goatcounter display the access information of a single website instead of displaying all access information
Goatcounter will display all the information counted by goatcounter on the homepage. I have multiple websites to use goatcounter statistics. In addition to establishing multiple goatcounters or adding multiple domain names, is there any other configuration that can make goatcounter display a single website?