https://github.com/flatypus/pixel
A simple pixel view tracker. Created with elysia + bun + react + drizzle + postgresql
https://github.com/flatypus/pixel
analytics google-analytics pixel pixel-track pixel-tracker views
Last synced: about 1 month ago
JSON representation
A simple pixel view tracker. Created with elysia + bun + react + drizzle + postgresql
- Host: GitHub
- URL: https://github.com/flatypus/pixel
- Owner: flatypus
- Created: 2023-11-20T07:37:20.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-24T13:50:58.000Z (11 months ago)
- Last Synced: 2025-04-08T21:08:00.669Z (2 months ago)
- Topics: analytics, google-analytics, pixel, pixel-track, pixel-tracker, views
- Language: TypeScript
- Homepage: https://view.flatypus.me
- Size: 1.15 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pixel
[A simple pixel view tracker.](https://view.flatypus.me)
## How it works
When a website is visited, the browser needs to request media from outside sources. This project serves a 1x1 transparent pixel image at a specific route, such that when the browser requests the image, the server can log the request and track the view. By using a unique id in the route, the server can track views for different pages:
Embed `
` to start tracking that id. You could also embed `` in a .md to track on markdown pages, such as this one.
To view statistics, go to `https://view.flatypus.me/[id]` to view stats.
But how would you know who or what website is requesting the image? Simple: on each request, it includes a `Referer` header, which tells the server where the request is coming from. I log that site, and allows you to sort the stats by the route.
You could even go a step further! By specifically adding `
` to your page, you'll also be able to get the specific full URL, including sorting by paths, of the page that requested the image.

