3.7 KiB
Analytics Graph Fix - No Data Displayed
Problem
The analytics graph in the admin panel shows no data or is completely empty.
Root Cause
The UMAMI_WEBSITE_ID environment variable is empty in your .env file. Without a valid website ID, the backend cannot fetch analytics data from Umami.
Solution
Option 1: Auto-detect Website ID (Recommended)
The system will automatically detect the first available website from your Umami instance:
- Ensure Umami is running and accessible at the URL specified in
UMAMI_URL - Restart your backend server (the system will auto-detect on the first analytics request)
- Check the logs for messages like:
[INFO] Attempting to get default Umami website ID from https://umami.tdvorak.dev [INFO] Found default Umami website: ID=xxxxx, Name=MyWebsite, Domain=example.com [INFO] Using Umami website ID: xxxxx
Option 2: Manually Set Website ID
If you know your Umami website ID:
- Log in to your Umami dashboard at
https://umami.tdvorak.dev - Navigate to Settings > Websites
- Copy the Website ID (usually a UUID like
12345678-1234-1234-1234-123456789abc) - Update your
.envfile:UMAMI_WEBSITE_ID=12345678-1234-1234-1234-123456789abc - Restart your backend server
Option 3: Create a New Website in Umami
If no websites exist in your Umami instance:
- Log in to Umami at
https://umami.tdvorak.dev - Create a new website with:
- Name: Your club name (e.g., "Fotbal Club")
- Domain: Your website domain (e.g., "example.com")
- Follow Option 1 or Option 2 above
Verification
After applying the fix:
-
Check Backend Logs for successful connection messages:
[INFO] Successfully authenticated with Umami at https://umami.tdvorak.dev [INFO] Successfully fetched Umami stats for websiteID=xxxxx (days=7) [INFO] Successfully fetched 10 Umami metrics (websiteID=xxxxx, type=url, days=7) -
Refresh the Analytics Page in the admin panel (
/admin/analytika) -
You should see:
- Statistics cards with visitor counts
- A graph showing page views over time
- Country flags showing visitor locations
- Tables with top pages, browsers, etc.
Troubleshooting
Issue: "No websites found in Umami instance"
Solution: Create a website in your Umami dashboard first
Issue: "Authentication failed"
Solution: Check UMAMI_USERNAME and UMAMI_PASSWORD in .env
Issue: "Failed to send list websites request"
Solution: Ensure UMAMI_URL is correct and Umami is accessible
Issue: Graph shows but with "Žádná data pro zobrazení"
Cause: No traffic has been recorded yet Solution:
- Visit your website to generate some traffic
- Check that the Umami tracking script is loaded on your frontend
- Wait a few minutes for data to appear
Enhanced Error Display
The analytics page now shows:
- Orange warning banner when Umami is not configured or has no data
- Empty state message in the graph when no pageviews are recorded
- Detailed error messages explaining the issue
- Console logging for debugging (check browser dev tools)
Configuration Summary
Required .env variables:
UMAMI_URL=https://umami.tdvorak.dev # ✓ Configured
UMAMI_USERNAME=admin # ✓ Configured
UMAMI_PASSWORD=eevRQ6h3G@!c#y4A1T # ✓ Configured
UMAMI_WEBSITE_ID= # ✗ Empty (will auto-detect)
Next Steps
- Restart your backend:
docker-compose restart backendormake run - Open admin panel:
http://localhost:3000/admin/analytika - Check if data appears
- If not, check backend logs for error messages
- Verify Umami is accessible at
https://umami.tdvorak.dev