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:
| Approach | Setup | Data | Dashboard | Best For |
|---|---|---|---|---|
| Shared | Simple | Combined, filterable | Single | Related sites, portfolios |
| Isolated | Per-site DNS | Completely separate | Per-site | Unrelated sites, client work |
Option 1: Shared tracking
The simple approach — use one tracking script across all your sites.
How it works
- Add additional hostnames in Settings
- Use the same tracking script URL on all sites
- Data is stored with each site's hostname
- Filter by site in the dashboard
Setup
Step 1: Add hostnames in Settings
- Go to your dashboard at
stats.yoursite.com/dashboard - Click Settings (gear icon)
- Find Additional Hostnames
- Add each site you want to track (e.g.,
site-b.com,site-c.com) - 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:
<!-- 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
- Go to your dashboard at
stats.yoursite.com/dashboard - Click the Site filter
- 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
- Create a DNS record and route for each site
- Each site has its own tracking URL
- Completely separate dashboards and data
Setup
For each new site, add a DNS record and Worker route:
Step 1: Add DNS record
- Go to Cloudflare Dashboard → DNS
- Select the zone for your new site
- Add an AAAA record:
- Name:
stats(or your preferred subdomain) - IPv6:
100::(placeholder for Workers) - Proxy: On (orange cloud)
- Name:
Step 2: Add Worker route
- Go to Cloudflare Dashboard → Workers & Pages
- Select your Once Analytics worker
- Go to Settings → Domains & Routes
- Click Add → Route
- Enter:
stats.newsite.com/* - Select your Once Analytics worker
Step 3: Add tracking script
<!-- 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
| Scenario | Recommendation |
|---|---|
| Personal projects & side sites | Shared — easier to manage |
| Client websites | Isolated — separate access & logs |
| Company properties | Shared — unified view |
| White-label / reselling | Isolated — complete separation |
| Testing & staging | Shared — 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