This commit is contained in:
Stefanescu Mihai
2026-03-19 12:21:01 +02:00
parent 9fb575ae70
commit 4390d43acb
9 changed files with 647 additions and 127 deletions
+7 -7
View File
@@ -92,13 +92,13 @@ Allow users to define goals and track conversion rates.
The `CollectController` currently does synchronous DB writes. This won't scale under real traffic.
- [ ] Move ingestion to a queued job (`ProcessTrackingPayload`) dispatched from the controller so the endpoint returns instantly
- [ ] Add rate limiting middleware to `POST /api/collect` (e.g., 60 req/min per IP)
- [ ] Add CORS headers to the collect endpoint so browsers allow cross-origin beacons
- [ ] Validate the incoming `referrer` / `url` against the website's `domain` to reject spoofed traffic
- [ ] Add IP-based geolocation (use MaxMind GeoLite2 via `stevebauman/location` or similar) to populate `country`, `region`, `city` on the `Visitor`
- [ ] Handle bot filtering — skip known bot user agents (use `jaybizzle/crawler-detect`)
- [ ] Add a `tracking_pixel` endpoint (1x1 GIF) as a no-JS fallback
- [x] Move ingestion to a queued job (`ProcessTrackingPayload`) dispatched from the controller so the endpoint returns instantly
- [x] Add rate limiting middleware to `POST /api/collect` (e.g., 120 req/min per IP)
- [x] Add CORS headers to the collect endpoint so browsers allow cross-origin beacons
- [x] Validate the incoming `referrer` / `url` against the website's `domain` to reject spoofed traffic
- [x] Add IP-based geolocation (use MaxMind GeoLite2 via `stevebauman/location`) to populate `country`, `region`, `city` on the `Visitor`
- [x] Handle bot filtering — skip known bot user agents (using `jaybizzle/crawler-detect`)
- [x] Add a `tracking_pixel` endpoint (1x1 GIF) as a no-JS fallback
---