Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cevoid.com/llms.txt

Use this file to discover all available pages before exploring further.

This page explains the runtime behavior behind the Cevoid Analytics SDK so you can choose the right setup for your storefront.

Event flow

  1. You initialize the SDK with init() or <CevoidAnalytics />.
  2. A tracking call validates the event name and builds event context.
  3. The SDK emits a browser CustomEvent unless browser events are disabled.
  4. The event is queued until consent is resolved when session tracking is enabled.
  5. The transport flushes events to the telemetry service.

Session tracking is off by default. When you set enableSessionTracking: true, the SDK resolves consent before attaching a Cevoid session ID to events. The SDK checks these consent sources:
  • Shopify Customer Privacy API
  • dataLayer consent entries for analytics_storage
  • window.cevoidTrackingConsent
The SDK only creates a cevoid_sid cookie when all available checks pass. If cookies cannot be written, the SDK falls back to an in-memory session ID for the current page runtime.

Session behavior

  • Cookie name: cevoid_sid
  • Expiration: 30-minute rolling expiry
  • Legacy cleanup: deletes the older ca_session cookie on initialization
  • Cookie scope: uses cookieDomain when you provide one
If you do not enable session tracking, the SDK still sends events. Those events simply do not include a Cevoid session ID.
For the exact cookie-setting rules and per-source consent behavior, see Consent.

Browser events

By default, the SDK emits a browser event for every tracked action. The event name is prefixed with cevoid:. Examples:
  • cevoid:post.click
  • cevoid:sale.complete
window.addEventListener('cevoid:post.click', (event) => {
  console.log(event.detail)
})
Disable browser events by setting emitBrowserEvents: false.

Context enrichment

Every queued event is enriched with runtime context before it is sent:
FieldSource
devicewindow.innerWidth mapped to mobile, tablet, or desktop
languagenavigator.language
page_urlwindow.location.href
refererdocument.referrer, or the current page URL when no referrer exists
If you call identify(), the SDK also adds the current identity payload to later events.

Batching and delivery

The transport keeps an in-memory queue and sends events to POST /events on your configured telemetry host.

Queue behavior

  • Maximum queue size: 100 events
  • Flush batch size: 20 events
  • Flush interval: every 2 seconds
  • Extra flush trigger: when the document becomes hidden
If the queue exceeds 100 events, the oldest events are dropped.

Delivery behavior

  • Uses navigator.sendBeacon() when available
  • Falls back to fetch(..., { keepalive: true })
  • Does not retry failed requests
The default host is https://telemetry.cevoid.com, which you can override with apiHost.

Legacy migration notes

The current widget event names use dotted names such as post.click and gallery.load_more. When moving from older gallery analytics implementations:
  • Use publishableKey for SDK initialization
  • Use the current dotted event names and payload keys from the SDK types