Back to Documentation

Multi-Site Setup

Track multiple websites from a single Once Analytics installation. Choose between shared tracking (simple) or isolated tracking (separate dashboards).

Overview

There are two ways to track multiple sites:

ApproachSetupDataDashboardBest For
SharedSimpleCombined, filterableSingleRelated sites, portfolios
IsolatedPer-site DNSCompletely separatePer-siteUnrelated sites, client work

Option 1: Shared tracking

The simple approach — use one tracking script across all your sites.

How it works

  1. Add additional hostnames in Settings
  2. Use the same tracking script URL on all sites
  3. Data is stored with each site's hostname
  4. Filter by site in the dashboard

Setup

Step 1: Add hostnames in Settings

  1. Go to your dashboard at stats.yoursite.com/dashboard
  2. Click Settings (gear icon)
  3. Find Additional Hostnames
  4. Add each site you want to track (e.g., site-b.com, site-c.com)
  5. Click Save

Note: Your main instance URL (e.g., yoursite.com) is tracked by default. You only need to add additional hostnames.

Step 2: Add tracking script to all sites

Add the same script to all your sites:

html
<!-- On site-a.com (default, no setup needed) -->
<script defer src="https://stats.yoursite.com/script.js"></script>

<!-- On site-b.com (add to Settings first) -->
<script defer src="https://stats.yoursite.com/script.js"></script>

<!-- On site-c.com (add to Settings first) -->
<script defer src="https://stats.yoursite.com/script.js"></script>

Viewing data

  1. Go to your dashboard at stats.yoursite.com/dashboard
  2. Click the Site filter
  3. Select which site to view

You can also view combined data across all sites.

Tip: This is the easiest approach for tracking a portfolio of related sites, side projects, or sites you manage together.

Pros & cons

Pros:

  • Zero additional setup
  • Single dashboard for everything
  • Easy to compare sites

Cons:

  • Shared request/error logs in Cloudflare
  • All sites visible in one dashboard
  • Same authentication for all sites

Option 2: Isolated tracking

The separated approach — each site gets its own subdomain, dashboard, and logs.

How it works

  1. Create a DNS record and route for each site
  2. Each site has its own tracking URL
  3. Completely separate dashboards and data

Setup

For each new site, add a DNS record and Worker route:

Step 1: Add DNS record

  1. Go to Cloudflare Dashboard → DNS
  2. Select the zone for your new site
  3. Add an AAAA record:
    • Name: stats (or your preferred subdomain)
    • IPv6: 100:: (placeholder for Workers)
    • Proxy: On (orange cloud)

Step 2: Add Worker route

  1. Go to Cloudflare Dashboard → Workers & Pages
  2. Select your Once Analytics worker
  3. Go to Settings → Domains & Routes
  4. Click Add → Route
  5. Enter: stats.newsite.com/*
  6. Select your Once Analytics worker

Step 3: Add tracking script

html
<!-- On newsite.com -->
<script defer src="https://stats.newsite.com/script.js"></script>

Step 4: Access dashboard

Visit https://stats.newsite.com/dashboard

Pros & cons

Pros:

  • Completely isolated data
  • Separate Cloudflare logs per site
  • Independent dashboards
  • Can share access to specific sites

Cons:

  • Manual DNS/route setup per site
  • Multiple dashboard URLs to manage
  • Same PIN/Access policy applies to all

Which option to choose

ScenarioRecommendation
Personal projects & side sitesShared — easier to manage
Client websitesIsolated — separate access & logs
Company propertiesShared — unified view
White-label / resellingIsolated — complete separation
Testing & stagingShared — filter by hostname

Note: You can mix both approaches. Use shared tracking for your own sites and isolated tracking for client projects.

Different Cloudflare accounts

If your sites are on different Cloudflare accounts, you'll need separate Once Analytics installations for each account.

Each installation requires:

  • Its own purchase/license
  • Its own Worker and D1 database
  • Its own API token during setup

Tip: If you manage multiple client sites, consider having clients add your Cloudflare account as an administrator to their zone, allowing you to use a single installation.


Questions? Email hello@onceanalytics.com