Analytics

Built-in, privacy-friendly analytics for every deployed site. No third-party scripts required.

Zero setup required. Analytics are automatically enabled for all deployed sites. View your data in the dashboard or via CLI.

What’s Tracked

ZeroDeploy analytics provide comprehensive insights without compromising visitor privacy:

CategoryMetrics
TrafficPage views, unique visitors, requests, real-time current visitors
EngagementBounce rate, session duration, pages per visit
SourcesReferrer hostnames, UTM campaigns
ContentTop pages, entry pages, exit pages, 404 not found pages
GeographyCountries, cities
TechnologyBrowsers, devices, operating systems
Custom EventsTrack any user action with _z.track()
Auto EventsOutbound link clicks, file downloads, form submissions
GoalsConversion tracking for page views and custom events
FunnelsMulti-step funnel analysis with drop-off rates (2-8 steps)

Privacy-Friendly by Design

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

ParameterPurposeExample
utm_sourceTraffic sourcegoogle, newsletter, twitter
utm_mediumMarketing mediumcpc, email, social
utm_campaignCampaign namespring_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

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:

MetricDescription
Bounce RatePercentage of single-page sessions (visitors who left without viewing other pages)
Session DurationAverage time visitors spend on your site
Pages per VisitAverage number of pages viewed per session
Note: Engagement metrics require the analytics script to be loaded on your pages. For static HTML sites, this happens automatically. For SPAs with client-side routing, pageviews are tracked on route changes.

Time Periods

Analytics can be viewed for three time periods:

PeriodCLI FlagUse Case
Last 24 hours--period 24hReal-time monitoring, checking campaign launches
Last 7 days--period 7d (default)Weekly performance review
Last 30 days--period 30dMonthly trends and reporting

Data Retention

Analytics data is retained based on your plan:

PlanRetention
Free24 hours
Pro30 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:

EventTriggerProperty
Outbound Link: ClickVisitor clicks a link to an external domainurl — the destination URL
File DownloadVisitor clicks a link to a downloadable file (.pdf, .zip, .xlsx, .csv, .docx, .mp3, .mp4)url — the file URL
Form SubmitVisitor submits a same-origin formform — 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:

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

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:

Plan limits: Free plan: 1 funnel per site. Pro plan: 10 funnels per site.

Loose funnels: Each step is counted independently within the time period, not as a strict sequential path within a single session. This works well with daily-rotating visitor hashes and provides practical conversion insights.

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.

Privacy note: User identification is opt-in. Only call _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

Analyzing Referrers