Since there is only one thread of execution in a JavaScript environment, events triggered in a continuous synchronous block of execution are received simultaneously. Callback listeners execute after the complete Kameleoon code block finishes, rather than the exact moment the code triggers the event. For example,
Kameleoon::Loaded and Kameleoon::Started can be received simultaneously if local storage load is implemented synchronously (the typical case, except in a cross-domain setup when the current URL is not on the main domain). Kameleoon::Started and Kameleoon::ExperimentTriggered are also simultaneous for experiments where targeting can be evaluated immediately.List of events
Kameleoon::Loaded
Data available in the event
Kameleoon::Aborted
- BROWSER: The browser is not supported.
- PRERENDER: This is a prerender request (e.g., Chrome optimization), not a webpage viewed by a human. Kameleoon does not run to avoid false statistics.
- STORAGE: Technical prerequisites for normal operations, such as Local Storage writes, cannot be met.
- TIMEOUT: File loading time exceeded the allowed amount, and the configuration requires abortion.
- DISABLED: Kameleoon was disabled via the back-office application. All front-end Kameleoon loads immediately abort when this status is active.
- PARAMETER: A special parameter in the URL (e.g.,
kameleoonDisabled=true) causes the engine to stop execution for debugging or verification. - SCRIPT: A custom abort script returned true for the current load.
Data available in the event
Kameleoon::Started
Kameleoon.API is readable, though some data (such as geolocation data obtained via subsequent asynchronous calls) may be unavailable. The event data indicates if initialization generated a new visitorCode.
Data available in the event
Kameleoon::DataGathered
Kameleoon::RemoteSynchronizationPerformed
Kameleoon.API.Data.performRemoteSynchronization() method. This occurs during cross-device history reconciliation, Intelligent Tracking Prevention, or custom data updates.
Read more about SSCs here.
Data available in the event
Kameleoon::LegalConsentUpdated
Kameleoon.API.Core.enableLegalConsent()) or denial (Kameleoon.API.Core.disableLegalConsent()) for the AB Testing or Personalization modules. Access the updated status via Kameleoon.API.Visitor.experimentLegalConsent or Kameleoon.API.Visitor.personalizationLegalConsent; the event object contains the update details.