Analytics
Built-in, privacy-friendly analytics for every deployed site. No third-party scripts required.
What’s Tracked
ZeroDeploy analytics provide comprehensive insights without compromising visitor privacy:
| Category | Metrics |
|---|---|
| Traffic | Page views, unique visitors, requests, real-time current visitors |
| Engagement | Bounce rate, session duration, pages per visit |
| Sources | Referrer hostnames, UTM campaigns |
| Content | Top pages, entry pages, exit pages, 404 not found pages |
| Geography | Countries, cities |
| Technology | Browsers, devices, operating systems |
| Custom Events | Track any user action with _z.track() |
| Auto Events | Outbound link clicks, file downloads, form submissions |
| Goals | Conversion tracking for page views and custom events |
| Funnels | Multi-step funnel analysis with drop-off rates (2-8 steps) |
Privacy-Friendly by Design
- No cookies — Uses privacy-preserving techniques instead of tracking cookies
- No personal data — IP addresses are not stored
- GDPR compliant — No consent banner required
- First-party only — Data never leaves ZeroDeploy infrastructure
Viewing Analytics
Via Dashboard
Navigate to your site in the dashboard and click the “Analytics” tab to see interactive charts and metrics.
Via CLI
Use the site stats command to view analytics from your terminal:
# View last 7 days (default)
zerodeploy site stats
# View last 24 hours
zerodeploy site stats --period 24h
# View last 30 days
zerodeploy site stats --period 30d
# Get JSON output for scripts
zerodeploy site stats --json
# Or specify the site explicitly
zerodeploy site stats my-site
Via API
Fetch analytics programmatically using the REST API:
curl -H "Authorization: Bearer $TOKEN" \
"https://api.zerodeploy.dev/sites/my-site/analytics?period=7d"
UTM Campaign Tracking
ZeroDeploy automatically tracks UTM parameters when visitors arrive at your site. Use these to measure the effectiveness of your marketing campaigns.
Supported Parameters
| Parameter | Purpose | Example |
|---|---|---|
utm_source | Traffic source | google, newsletter, twitter |
utm_medium | Marketing medium | cpc, email, social |
utm_campaign | Campaign name | spring_sale, launch_2024 |
Example Campaign URL
https://my-site.zerodeploy.app/?utm_source=twitter&utm_medium=social&utm_campaign=product_launch
UTM parameters are captured on the visitor’s first pageview and associated with their entire session.
Viewing Campaign Data
Campaign data appears in the analytics response under the campaigns array:
{
"campaigns": [
{ "source": "twitter", "medium": "social", "campaign": "product_launch", "requests": 1250 },
{ "source": "google", "medium": "cpc", "campaign": "brand_terms", "requests": 890 },
{ "source": "newsletter", "medium": "email", "campaign": "weekly_digest", "requests": 456 }
]
}
Referrer Tracking
See where your traffic comes from. Referrers are automatically captured and aggregated by hostname.
How It Works
- The HTTP
Refererheader is captured on each request - Referrers are aggregated by hostname (e.g., “google.com” not full URLs)
- Self-referrals (your own domain) are automatically filtered out
- Direct traffic (no referrer) is tracked separately
Example Referrer Data
{
"referrers": [
{ "referrer": "google.com", "requests": 2340 },
{ "referrer": "twitter.com", "requests": 890 },
{ "referrer": "github.com", "requests": 567 },
{ "referrer": "reddit.com", "requests": 234 },
{ "referrer": "(direct)", "requests": 1890 }
]
}
Engagement Metrics
Understand how visitors interact with your site:
| Metric | Description |
|---|---|
| Bounce Rate | Percentage of single-page sessions (visitors who left without viewing other pages) |
| Session Duration | Average time visitors spend on your site |
| Pages per Visit | Average number of pages viewed per session |
Time Periods
Analytics can be viewed for three time periods:
| Period | CLI Flag | Use Case |
|---|---|---|
| Last 24 hours | --period 24h | Real-time monitoring, checking campaign launches |
| Last 7 days | --period 7d (default) | Weekly performance review |
| Last 30 days | --period 30d | Monthly trends and reporting |
Data Retention
Analytics data is retained based on your plan:
| Plan | Retention |
|---|---|
| Free | 24 hours |
| Pro | 30 days |
Custom Events
Track any user action on your site with _z.track(). Custom events appear in the Events card on your analytics dashboard.
Basic Usage
<button onclick="_z.track('Signup')">Sign Up</button>
With Properties
You can pass one property as a key-value pair:
<button onclick="_z.track('Signup', { plan: 'pro' })">
Sign Up for Pro
</button>
With Monetary Value
Use the special _value property to track revenue (in cents):
_z.track('Purchase', { _value: 2900 }) // $29.00
SPA Integration
For React, Vue, or other SPA frameworks, call _z.track() in your event handlers:
function handleSignup(plan) {
// ... your signup logic
_z.track('Signup', { plan: plan })
}
Event Data in the API
Custom events appear in the analytics API response under the events array:
{
"events": [
{ "event_name": "Signup", "completions": 142, "unique_completions": 130, "total_value": 0 },
{ "event_name": "Purchase", "completions": 28, "unique_completions": 28, "total_value": 81200 }
]
}
Auto-Tracked Events
ZeroDeploy automatically tracks these events without any code changes:
| Event | Trigger | Property |
|---|---|---|
| Outbound Link: Click | Visitor clicks a link to an external domain | url — the destination URL |
| File Download | Visitor clicks a link to a downloadable file (.pdf, .zip, .xlsx, .csv, .docx, .mp3, .mp4) | url — the file URL |
| Form Submit | Visitor submits a same-origin form | form — the form name or action path |
These appear alongside your custom events in the Events card.
Goals
Goals track conversions for specific page views or custom events. Create them in the dashboard under Analytics > Goals.
Each goal has:
- Name — A descriptive label (e.g., “Pricing page visit”)
- Type —
pageview(matches a URL path) orevent(matches a custom event name) - Match value — The exact path or event name to match
Goal metrics include total completions, unique completions, and conversion rate (unique completions / unique visitors).
Plan limits: Free plan: 3 goals per site. Pro plan: 20 goals per site.
Tips
- Use your Top Pages data to pick high-value paths for pageview goals
- Form submissions are tracked as pageviews with path
/_forms/{name}— use this as a goal match value - Event goals match the name passed to
_z.track()(e.g.,Signup,Purchase)
Funnels
Funnels show how visitors progress through a multi-step flow. Create them in the dashboard under Analytics > Funnels.
Each funnel has 2-8 steps. Each step is either a pageview (URL path) or a custom event. The funnel visualization shows:
- Visitor count at each step
- Conversion rate from the previous step
- Drop-off percentage between steps
- Overall conversion rate (first step to last step)
Plan limits: Free plan: 1 funnel per site. Pro plan: 10 funnels per site.
User Identification
If your site has signed-in users, you can identify them to track per-user activity:
_z.identify('user-123')
Once called, the user ID is attached to all subsequent events (pageviews, custom events, etc.) for the remainder of the session.
_z.identify() for your own signed-in users. The user ID is stored in Analytics Engine alongside the same privacy-preserving infrastructure — no cookies, no personal data beyond what you explicitly pass.
Best Practices
Campaign Tracking
- Use consistent naming conventions for UTM parameters (lowercase, underscores)
- Always include
utm_sourceandutm_mediumat minimum - Use
utm_campaignto identify specific initiatives - Create a UTM tracking spreadsheet to maintain consistency across your team
Analyzing Referrers
- High traffic from a referrer with high bounce rate may indicate mismatched expectations
- Monitor for unexpected referrers that might indicate content being shared
- Use referrer data to identify partnership or guest posting opportunities