igrigorik / ga-beacon

Google Analytics collector-as-a-service (using GA measurement protocol).
MIT License
3.54k stars 357 forks source link

Are you sure it's unusable with Github? #75

Open josephernest opened 3 years ago

josephernest commented 3 years ago

I see you removed Github from the possible applications: https://github.com/igrigorik/ga-beacon/commit/6acd8627bb7be36f24f5516e9873c92719a50e55

Probably because README.md images are agressively "cached".

But they surely is a solution: many repos have "badge" images, that are frequently updated. So with the appropriate caching setting, couldn't it be possible to track with a pixel the page views? See @bkeepers 's comment https://github.com/github/markup/issues/224#issuecomment-48532178:

We're pretty confident that the image caching works. If you're having issues with something like a CI badge, make sure the image has the Cache-Control: no-cache header, and either Expires, Last-Modified or Etag. See the Fastly documentation for more info. If you're still having issues, contact support@github.com

Yrobot commented 3 years ago

I think some part of ga-beacon is unusable now, such as UV. This is the ga-beacon server logs whan i refresh my repo homepage, you can see cid is different, because the img is requested by the https://camo.githubusercontent.com/ server but client browser. cookie.cid is not working. image At least PV works fine.

Yrobot commented 3 years ago

I think some part of ga-beacon is unusable now, such as UV. This is the ga-beacon server logs whan i refresh my repo homepage, you can see cid is different, because the img is requested by the https://camo.githubusercontent.com/ server but client browser. cookie.cid is not working. image At least PV works fine.

which means only Cache-Control, Expires, Last-Modified and Etag will work on github img

sionsmith commented 2 years ago

Has anyone managed to get this working recently? Or am I just completely wasting my time?!