Octa Engineering Notes Christian Elías Request for Comments: OCTA-6 octa.page Category: Informational May 2026 av.js — self-hosted analytics embed Abstract API reference for av.js: the minimal analytics snippet for Avelor-hosted projects. Covers the embed pattern, the pageview payload structure, custom event API, session ID strategy, and implementation constraints like keepalive fetches and localhost filtering. Status of This Memo This memo documents notes notes for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited. The canonical version lives at https://octa.page/doc/av-js-analytics-embed/ and the machine-readable source at https://octa.page/doc/av-js-analytics-embed.md "av.js" is a minimal analytics snippet that reports pageviews and custom events to "analytics.avelor.es/collect". Drop a " "data-project" is required — without it the script exits immediately. Requests from "localhost", "127.0.0.1", and "::1" are also silently skipped. 2. What it sends on load A "POST /collect" with: { "project_id": "project-slug", "url": "/path?query", "referrer": "https://example.com", "session_id": "lxk3r2abc9d" } "session_id" is generated once per tab and stored in "sessionStorage" under "_av_sid". It survives navigation within the tab but not across tabs or sessions. 3. Custom events window.avelor.track('event-name', { key: 'value' }); Event name is truncated to 100 chars. "properties" is a free-form object or "null". Full payload: { "type": "event", "project_id": "project-slug", "session_id": "lxk3r2abc9d", "name": "click-cta", "url": "/", "properties": { "variant": "A" } } 4. Implementation notes o "keepalive: true" on the fetch call — the request survives page navigation, so events sent just before a redirect are not lost. o "credentials: 'omit'" — no cookies or auth headers sent to the collector. o Network errors are swallowed — a dead collector does not break the host page. Christian Elías Informational [Page 1]