Skip to content

Error Codes

Trackkit surfaces typed AnalyticsError objects via your onError callback.

CodeWhen it happensTypical action
INIT_FAILEDProvider init failed (invalid config, script blocked, or runtime init error)Inspect error.originalError, verify env/host, check ad blockers
INVALID_CONFIGConfiguration failed validation before initFix configuration (wrong provider, missing site/measurementId, etc.)
INVALID_ENVIRONMENTEnvironment unsupported (e.g., non-browser where provider requires DOM APIs)Avoid calling analytics in unsupported contexts or guard usage
PROVIDER_ERRORProvider method threw while sendingLog & optionally retry
NETWORK_ERRORTransport failed due to network issues (after retries/backoff)Log; consider surfacing degraded analytics state to monitoring
POLICY_BLOCKEDEvent blocked by policy (DNT, localhost policy, domain/exclude rules, denied consent)Adjust config or handle gracefully (may be expected)
CONSENT_REQUIREDOperation requires consent that has not been grantedPrompt user again or avoid calling until consent is known
QUEUE_OVERFLOWIn-memory queue exceeded queueSizeIncrease queue or reduce pre-consent volume
READY_TIMEOUTProvider did not become ready within the expected timeInvestigate provider loading, CSP, or blocker interference
TIMEOUTGeneric timeout from an internal async operationLog & investigate; should be rare
UNKNOWNFallback for unexpected errorsLog full error; consider reporting to Trackkit maintainers

Each error includes:

ts
{ 
    name: 'AnalyticsError',
    code,
    message,
    provider?,
    timestamp,
    originalError?,
}