A lightweight, open-source website analytics dashboard powered by Cloudflare Pages + Analytics Engine
Demo · Deployment · Deployment Guide (Chinese)
Iris Analytics is a website analytics tool rebuilt from HanAnalytics, offering a clearer and more intuitive data overview with an improved user experience.
No database required — fully powered by the Cloudflare ecosystem:
- Pages — Hosts the frontend and API (Pages Functions)
- Workers Analytics Engine — Time-series database for storing analytics data
- Log in to Cloudflare
- Cloudflare Account ID (available on the Workers & Pages page)
- Cloudflare API Token with Account Analytics Read permission
- Create a dataset in Analytics Engine with binding name
AnalyticsBindingand dataset nameAnalyticsDataset
- Fork this repository or use it as a template
- Create a Cloudflare Pages project, select your forked repo, choose Vue framework, fill in the environment variables, and deploy
- In your Pages project Settings > Bindings, add an Analytics Engine binding with variable name
AnalyticsBindingand datasetAnalyticsDataset, then redeploy - Visit
https://your-project.pages.devto access the analytics dashboard - Go to Settings > Integration to get the tracking script and add it to your site
- Return to the dashboard and wait for visit data.
| Variable | Description | Required |
|---|---|---|
CLOUDFLARE_ACCOUNT_ID |
Cloudflare Account ID | Yes |
CLOUDFLARE_API_TOKEN |
Cloudflare API Token (Account Analytics Read permission) | Yes |
CLOUDFLARE_WEBSITE_PWD |
Dashboard access password (leave empty for no password) | No |
CLOUDFLARE_WEBSITE_WHITELIST |
Analytics whitelist — format: WebsiteID | domain, newline- or comma-separated |
No |
# Binding name
AnalyticsBinding
# Dataset name
AnalyticsDatasetInsert the following code at the bottom of your website to integrate analytics:
<script defer src="https://your-project.pages.dev/tracker.min.js" data-website-id="your-unique-site-id"></script>By default, the analytics API is public — any site can send data to the dataset. The whitelist provides two-way verification of both the site ID and domain to prevent data pollution.
# Recommended: comma-separated (single line) — avoids the Cloudflare env var UI stripping newlines
CLOUDFLARE_WEBSITE_WHITELIST = website-id | domain.com, iris | iris.exi.softwareNewline-separated rules are also supported (one rule per line, or a mixed format with each line ending in a comma). However, since Cloudflare's page may change and newlines could be lost, making the config hard to edit later, this configuration style is not recommended. If you do use it, it's recommended to end each rule with a comma.
# Format: WebsiteID | domain, newline-separated
CLOUDFLARE_WEBSITE_WHITELIST =
website-id | domain.com
iris | iris.exi.software
...
# Format: WebsiteID | domain, mixed newline-separated with trailing commas
CLOUDFLARE_WEBSITE_WHITELIST =
website-id | domain.com,
iris | iris.exi.software,
...The whitelist validates both the unique site ID and domain, ensuring only authorized websites can report data.
Set the CLOUDFLARE_WEBSITE_PWD environment variable to require a password for dashboard access. The login session lasts for 7 days and auto-renews on active visits.
# Set a password to protect the dashboard (no password by default)
CLOUDFLARE_WEBSITE_PWD = your_passwordThe project is licensed under the MIT.
