Everything you need to install and use KB365Service.
Open the Dashboard, enter your admin key, click + Add Site, enter your site name and domain. You'll get a Site ID.
Paste this inside your <head> tag — replace YOUR_SITE_ID with the ID from step 1:
<script src="https://kb365service.com/tracker.js?id=YOUR_SITE_ID"></script>The script is under 1KB, loads async, collects no cookies, and requires no GDPR consent banner.
| Field | Source | Notes |
|---|---|---|
| Page URL | browser | Full URL of the viewed page |
| Referrer | browser | Where the visitor came from |
| Session ID | sessionStorage | Random ID, cleared when browser tab closes. No cookies. |
| Device type | screen.width | desktop / tablet / mobile |
| Country | Cloudflare header | CF-IPCountry — no IP stored |
| Screen size | screen.width/height | Aggregate display stats only |
We do not store IP addresses, fingerprints, cookies, or any personally identifiable information.
POST /collect
Track a pageview. Open to all origins. Body: {"site_id","url","referrer","session_id","device","screen_w","screen_h"}
GET /api/stats/:siteId/pageviews?days=30
Daily pageview + visitor counts. Max 90 days.
GET /api/stats/:siteId/realtime
Active sessions in the last 5 minutes.
GET /api/stats/:siteId/pages|sources|countries|devices
Top pages, traffic sources, countries, device split.
GET /api/snippet/:siteId
Returns the ready-to-paste HTML snippet for a site.
GET /api/stats/compare Admin key required
All sites side-by-side. Header: X-Admin-Key: your-key
git clone https://github.com/kb-software-llc/kb365service
cd kb365service/worker
npm install
npx wrangler d1 create kb365service
npx wrangler d1 execute kb365service --file=schema.sql
npx wrangler secret put ADMIN_KEY
npx wrangler deploy
cd ..
npx wrangler pages deploy public --project-name=kb365service