Current Release: Version 2.4.0
Current Release: Version 2.4.0
Release Date: August 29, 2026
Status: Stable Release
📈 Version 2.4.0 - Analytics & Visitor Tracking
Released: August 29, 2026
🌟 New Feature
📊 Pluggable Visitor Tracking
docker/php/analytics.php: new partial that emits the correct
<script>snippet based onANALYTICS_PROVIDERumami— self-hosted, cookie-less, works in Chinaga4(aliasgoogle) — Google Analytics 4 via gtag.jsnone(default) — nothing is emitted
auto_prepend_filedirective added to
docker/php/php.ini.tplso the snippet is
injected into every HTML response without touching the tool
pages individually- JSON safety: the snippet is automatically skipped when:
- The request path starts with
/api/ - The
Acceptheader containsapplication/json - The script is invoked from the CLI
- The request path starts with
- Safe HTML: every dynamic value (
UMAMI_SCRIPT_URL,
UMAMI_WEBSITE_ID,GA4_MEASUREMENT_ID) is run through
htmlspecialchars()before being echoed
🐳 Optional Self-Hosted Umami Service
docker-compose.ymlnow ships a commented-out
umami-db+umamiservice block at the bottom (plus the matching
volumes:declaration)- Enable it with one edit to get Umami + PostgreSQL running next to
MyAPIs, accessible onhttp://localhost:${UMAMI_PORT:-3000} - Default login:
admin/umami
⚙️ Configuration Surface (example.env)
ANALYTICS_PROVIDER—none(default),umami,ga4,googleUMAMI_SCRIPT_URL— full URL to the Umami tracker
(http://umami:3000/script.jsworks out of the box when the
compose Umami service is enabled)UMAMI_WEBSITE_ID— UUID from the Umami dashboardGA4_MEASUREMENT_ID—G-XXXXXXXXXXfrom the GA4 admin- Existing Umami infra variables (
UMAMI_PORT,UMAMI_DB_*,
UMAMI_APP_SECRET) preserved and now documented in README
🐳 PHP Container Wiring
docker-compose.ymlforwardsANALYTICS_PROVIDER,
UMAMI_SCRIPT_URL,UMAMI_WEBSITE_ID,GA4_MEASUREMENT_IDto
thephpservice so the partial can read them viagetenv()
📚 Documentation
- New 📈 Analytics / Visitor Tracking section in
README.mdwith:- Provider comparison table
- Step-by-step Umami + GA4 setup instructions
- Tracking-scope clarification (HTML pages vs.
/api/*) - Verification
curlcommands
- README env-vars table extended with every analytics variable
- README Latest Updates bumped to v2.4.0
📁 New / Updated Files
docker/php/analytics.php— new tracking partialdocker/php/php.ini.tpl— addsauto_prepend_filedocker-compose.yml— adds analytics env forwarding + optional
Umami / PostgreSQL service blockexample.env— documentsANALYTICS_PROVIDER,UMAMI_SCRIPT_URL,
UMAMI_WEBSITE_ID,GA4_MEASUREMENT_IDREADME.md— new analytics section, env table, version bannerRELEASE.md— this entry
✅ Verification
php -l docker/php/analytics.phppassesdocker compose configvalidates with the optional Umami block
both commented and uncommented- Manual checks once running:
curl -s http://localhost:8080/ | grep -E 'umami|gtag'→ returns
the matching<script>tag when the provider is enabledcurl -s http://localhost:8080/api/health-calculator/ | grep -E 'umami|gtag'
→ returns nothing (API paths are excluded)
- Switching
ANALYTICS_PROVIDER=noneand restarting removes every
snippet without code changes