Debugging
Add data-debug to the script tag, or ?evx_debug=1 to the page's address, and the SDK sends every batch with debug: true and logs the answer to the console: for each call, which activities it became and the processor's verdict on each, or why it became nothing.
started_session -> accepted
page -> viewed_page -> accepted
track Video Played -> raw only (no rule for this name)
track subscribed_newsletter -> accepted
The same answers come from the API with debug: true on /v1/batch; the tracking calls page has a live form.
What to check when nothing arrives
- Consent. Nothing is sent before
evx.consent({ analytics: true }), except banner-exempt actions. Check the banner calls it on every page load. - The key. A
401in the network tab is a wrong or revoked key; a403is a server key used from a browser. - The configuration. Calls wait 1.5 seconds for
/v1/config; if it never answers, banner-exempt actions are not sent before consent, because the SDK knows no names of its own. - The origin. A service on another origin needs CORS for the site (
ADD_CORS,CORS_ALLOW_ORIGINSon the service).
Delivery
Batches go every 2 seconds or 20 calls, as a beacon when the page is hidden, with a retry queue and backoff, so going offline does not lose the session. The queue lives in localStorage with consent and in memory without, keeps the newest 200 calls, and sends in batches of 20. Any 2xx counts as delivered; message ids are made at call time, so a retried batch stores nothing twice.