What you’ll accomplish
Deploy Sparklytics
- Docker Compose (Recommended)
- Docker Run
Download the docker-compose configuration and start Sparklytics:Sparklytics will be available at
http://your-server-ip:3000.If you’re running Sparklytics locally over plain HTTP (not HTTPS), set
SPARKLYTICS_HTTPS=false in your environment variables. See HTTPS Setup for production deployment.Complete first-run setup
- Open
http://your-server-ip:3000in your browser - You’ll be redirected to the setup page
- Create your admin account:
- Email: Your admin email
- Password: Choose a strong password (min 8 characters)
- Click Create Account
Add your first website
Fill in website details
- Name: A friendly name (e.g., “My Blog”)
- Domain: Your website domain (e.g.,
myblog.com) - Timezone: Your preferred timezone for date ranges
Install tracking
Choose the integration method that fits your stack:- HTML Snippet
- Next.js SDK
Add this script tag before the closing Replace:
</body> tag on every page you want to track:your-analytics-domain.comwith your Sparklytics instance domainsite_XXXXXXXXXXwith your actual Website ID from step 3
Verify tracking is working
Visit your website
Open your website in a browser (in a different tab/window from your Sparklytics dashboard).
Check the dashboard
Return to your Sparklytics dashboard. Within a few seconds, you should see:
- 1 active visitor in the real-time panel
- 1 pageview in the stats overview
- Your recent pageview in the “Recent Events” list
Track custom events
Beyond pageviews, you can track custom user actions:- HTML Snippet
- Next.js SDK
What’s next?
Custom Events
Track user actions beyond pageviews
Funnels
Measure conversion rates through multi-step journeys
Retention
Analyze cohort retention over time
API Reference
Explore the analytics API
Troubleshooting
No events appearing in dashboard
No events appearing in dashboard
Check these common issues:
-
Verify the tracking script is loaded
- Open browser DevTools → Network tab
- Look for a request to
/s.js - Check for a POST request to
/api/collect
-
Check the Website ID
- Ensure
data-website-idmatches your actual Website ID from the dashboard - Website IDs start with
site_
- Ensure
-
CORS / Mixed Content
- If your site is HTTPS, your analytics server must also be HTTPS
- Check browser console for CORS or mixed content errors
-
Ad blockers
- Some ad blockers block analytics scripts
- Test in an incognito window or with ad blockers disabled
Setup page keeps redirecting
Setup page keeps redirecting
If you’re stuck in a redirect loop:
- Check that
SPARKLYTICS_AUTH=localis set - Delete the data volume and restart:
- Access the setup page at
http://your-server-ip:3000/setup
Can't login after setup
Can't login after setup
Common issues:
-
HTTPS cookie issues
- If running locally over HTTP, set
SPARKLYTICS_HTTPS=false - The Secure cookie flag requires HTTPS in production
- If running locally over HTTP, set
-
Wrong auth mode
- Verify
SPARKLYTICS_AUTH=localin your environment - If using
passwordmode, useSPARKLYTICS_PASSWORDinstead
- Verify
-
Clear browser data
- Clear cookies for the Sparklytics domain
- Try in an incognito window
For more detailed installation options, see the Installation Guide. For production deployments, review the Docker Deployment and HTTPS Setup guides.