Wrong endpoint:analytics.mattitja.cloud has no DNS record. The correct host is analytics.mattitja.se.
No ingest secret: without Authorization: Bearer <ingest_secret> the API ignores the forwarded ip/ua and uses the server's own. That is a datacenter IP, so the API rejects it as a bot (401).
Missing Accept-Language: the API's bot detection rejects requests without the header (401).
New MATTITJA_ANALYTICS_INGEST_SECRET, sent as a Bearer token. Nothing is sent without it, and a warning is logged at boot.
Forwards the visitor's Accept-Language
Tracks only successful GET requests rendering HTML (skips POST, redirects, JSON and Livewire)
Timeouts: 0.5 s connect, 1 s total
File-based circuit breaker (storage/framework/mattitja-analytics.paused): after a connection failure or 5xx, sending pauses for 60 s. No queue, worker or cache is required, and a down API never slows the host site.
Catches Throwable, and logs non-2xx responses instead of failing silently
mattitja:install adds MATTITJA_ANALYTICS_INGEST_SECRET= to .env, and the README is updated
Breaking
Sites must set MATTITJA_ANALYTICS_INGEST_SECRET, from Site → Install in Mattitja Analytics. Until it is set, nothing is tracked.
Testing
vendor/bin/pest: 30 tests pass
Live test against production with the byblos site key: 201, and the pageview showed up in the dashboard
## Problem
No pageviews reached Mattitja Analytics:
1. **Wrong endpoint:** `analytics.mattitja.cloud` has no DNS record. The correct host is `analytics.mattitja.se`.
2. **No ingest secret:** without `Authorization: Bearer <ingest_secret>` the API ignores the forwarded `ip`/`ua` and uses the server's own. That is a datacenter IP, so the API rejects it as a bot (401).
3. **Missing `Accept-Language`:** the API's bot detection rejects requests without the header (401).
## Changes
- Hardcoded endpoint `https://analytics.mattitja.se/api/send`
- New `MATTITJA_ANALYTICS_INGEST_SECRET`, sent as a Bearer token. Nothing is sent without it, and a warning is logged at boot.
- Forwards the visitor's `Accept-Language`
- Tracks only successful `GET` requests rendering HTML (skips POST, redirects, JSON and Livewire)
- Timeouts: 0.5 s connect, 1 s total
- File-based circuit breaker (`storage/framework/mattitja-analytics.paused`): after a connection failure or 5xx, sending pauses for 60 s. No queue, worker or cache is required, and a down API never slows the host site.
- Catches `Throwable`, and logs non-2xx responses instead of failing silently
- `mattitja:install` adds `MATTITJA_ANALYTICS_INGEST_SECRET=` to `.env`, and the README is updated
## Breaking
Sites must set `MATTITJA_ANALYTICS_INGEST_SECRET`, from Site → Install in Mattitja Analytics. Until it is set, nothing is tracked.
## Testing
- `vendor/bin/pest`: 30 tests pass
- Live test against production with the byblos site key: 201, and the pageview showed up in the dashboard
- 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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
No pageviews reached Mattitja Analytics:
analytics.mattitja.cloudhas no DNS record. The correct host isanalytics.mattitja.se.Authorization: Bearer <ingest_secret>the API ignores the forwardedip/uaand uses the server's own. That is a datacenter IP, so the API rejects it as a bot (401).Accept-Language: the API's bot detection rejects requests without the header (401).Changes
https://analytics.mattitja.se/api/sendMATTITJA_ANALYTICS_INGEST_SECRET, sent as a Bearer token. Nothing is sent without it, and a warning is logged at boot.Accept-LanguageGETrequests rendering HTML (skips POST, redirects, JSON and Livewire)storage/framework/mattitja-analytics.paused): after a connection failure or 5xx, sending pauses for 60 s. No queue, worker or cache is required, and a down API never slows the host site.Throwable, and logs non-2xx responses instead of failing silentlymattitja:installaddsMATTITJA_ANALYTICS_INGEST_SECRET=to.env, and the README is updatedBreaking
Sites must set
MATTITJA_ANALYTICS_INGEST_SECRET, from Site → Install in Mattitja Analytics. Until it is set, nothing is tracked.Testing
vendor/bin/pest: 30 tests pass