Events & Schema

Every event writes one row to Cloudflare Analytics Engine. The schema uses blob1–blob12 for string fields and double1–double2 for numeric fields.

Built-in events

The tracking script fires these automatically. No configuration required except scroll_depth, which is opt-in.

EventTriggered byData captured
pageview Every page load path, referrer, country, device, browser, UTM params
outbound External link click path, destination URL (blob5)
timing visibilitychange (tab close/switch) path, seconds on page (double2)
scroll_depth 25 / 50 / 75 / 100% scroll milestone path, depth percentage (blob5)

Enable scroll_depth by adding data-scroll-depth="true" to the script tag. It uses IntersectionObserver on four sentinel elements placed at 25/50/75/100% of the page.

Custom events

Call flarelytics.track() anywhere in your JavaScript. The function is available as soon as the script loads.

JavaScript
// Simple event
flarelytics.track('signup')
 
// Event with properties
flarelytics.track('signup', {
props: { plan: 'pro', source: 'pricing-page' }
})
 
// Track a purchase
flarelytics.track('purchase', {
props: { product: 'lifetime', amount: '99' }
})
 
// Track form submission
document.querySelector('form').addEventListener('submit', () => {
flarelytics.track('form_submit', { props: { form: 'contact' } })
})

Properties are stored as pipe-separated values in blob5 and queryable via the custom-events and funnel-by-event queries.

The event name is stored in blob4. Query custom events using ?q=custom-events&period=30d&site=mysite.com.

Analytics Engine schema

All queries must include AND blob10 = '${site}' to scope results to a single site. This is how multi-site support works — one worker, multiple sites, scoped by hostname.

FieldContent
blob1 Page path
blob2 Referrer hostname (direct if none)
blob3 Country code (from CF headers)
blob4 Event name (pageview, timing, scroll_depth, custom)
blob5 Event properties (pipe-separated values)
blob6 utm_source
blob7 utm_medium
blob8 utm_campaign
blob9 Visitor hash (daily-rotating SHA-256)
blob10 Site hostname — required in all WHERE clauses
blob11 Device type (mobile / tablet / desktop)
blob12 Browser name (Chrome / Firefox / Safari / Edge / Other)
double1 Event count (always 1)
double2 Time on page in seconds (timing events only — use AVG)

You can write raw Analytics Engine SQL queries against this schema using the Cloudflare API if you need something the built-in queries don't cover.

Privacy

Flarelytics collects the minimum data needed to produce useful analytics. No personal data is stored.

Collected
  • Page paths
  • Referrer hostnames
  • Country code (from Cloudflare headers)
  • Device type and browser name
  • UTM parameters
  • Daily-rotating visitor hash
Never collected
  • IP addresses
  • Cookies or local storage
  • Fingerprints or persistent identifiers
  • Full URLs (only paths)
  • User agents (only parsed type)
  • Cross-site or cross-day tracking

The visitor hash is a SHA-256 of the IP address, user agent string, and the current date. It resets every midnight UTC, so the same visitor on two different days counts as two unique visitors. The raw hash is never stored — only used to count uniques within a single day.

Was this page helpful?

← API Reference
Edit this page on GitHub