Commit Graph
9 Commits
Author SHA1 Message Date
mathiaspalmqvist 0a05515d3c Merge pull request 'chore: rename package to mattitja/mattitja-analytics' (#2) from chore/rename-package into main
Reviewed-on: #2
v2.0
2026-11-12 08:10:56 +00:00
mathiaspalmqvist 9dc3dc3d9b chore: rename package to mattitja/mattitja-analytics 2026-11-12 09:10:25 +01:00
mathiaspalmqvist 9d268278a0 Merge pull request 'fix: send pageviews to the analytics API correctly' (#1) from fix/send-to-analytics-api into main
Reviewed-on: #1
2026-11-12 08:08:55 +00:00
mathiaspalmqvist 19f632d652 fix: send pageviews to the analytics API correctly
- Use the correct endpoint (analytics.mattitja.se instead of the
  non-existent .cloud domain)
- Authenticate with the site ingest secret as a Bearer token so the API
  trusts the forwarded visitor IP and user agent
- Forward the visitor Accept-Language header (required by bot detection)
- Only track successful GET requests rendering HTML
- Short timeouts and a file-based circuit breaker that pauses sending
  after connection failures or 5xx responses, so no queue, worker or
  cache is needed and a down API never slows the host site
- Log rejected requests instead of failing silently
2026-11-12 09:08:27 +01:00
mathiaspalmqvist e3911ca12c refactor: use DTO and terminate middleware for better performance
- Add PageviewData readonly DTO class for type safety
- Update AnalyticsClient to accept PageviewData instead of array
- Move analytics sending to terminate() method (runs after response sent)
- Update all tests for new DTO pattern
v1.1.0
2026-01-03 15:09:48 +01:00
mathiaspalmqvist 448ac3e4cf feat: added install script 2026-01-03 15:01:11 +01:00
mathiaspalmqvist 630620e4e6 fix: added logs instead of exception 2026-01-03 14:55:34 +01:00
mathiaspalmqvist f25b67f6f1 framework updates 2026-01-03 14:45:58 +01:00
mathiaspalmqvist 50d66414ea Init v1.0.0 2025-09-30 10:20:29 +02:00