Since a JavaScript environment has only one thread of execution, callback listeners receive events triggered within the same synchronous block of execution simultaneously. Callback listeners execute after the complete Kameleoon code block finishes, rather than at the exact moment the code triggers the event. For example,
Kameleoon::Loaded and Kameleoon::Started can arrive simultaneously if the browser loads local storage synchronously (the typical case, except in a cross-domain setup when the current URL isn’t on the main domain). Kameleoon::Started and Kameleoon::ExperimentTriggered also arrive simultaneously for experiments where the engine can evaluate targeting immediately.List of events
Kameleoon::Loaded
Data available in the event
Kameleoon::Aborted
- BROWSER: The browser isn’t supported.
- PRERENDER: A prerender request, such as a Chrome optimization, triggered the load instead of an actual visit from a person. Kameleoon doesn’t run, to avoid generating false statistics.
- STORAGE: The browser can’t meet technical prerequisites for normal operations, such as Local Storage writes.
- TIMEOUT: File loading time exceeded the allowed amount, and the configuration requires abortion.
- DISABLED: A user turned Kameleoon off in the back-office app. All frontend Kameleoon loads immediately stop when this status is active.
- PARAMETER: A special parameter in the URL (for example,
kameleoonDisabled=true) causes the engine to stop execution for debugging or verification. - SCRIPT: A custom script returned true, signaling Kameleoon to stop 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::FeatureFlagFileLoaded
Kameleoon::Started.
Listen for this event when your code depends on feature flag rules and must not run before the engine knows about them. The event fires only when your site loads feature flag rules from a separate file and that file contains rules.
Kameleoon::RemoteSynchronizationPerformed
Kameleoon.API.Data.performRemoteSynchronization() method. This synchronization occurs during cross-device history reconciliation, Intelligent Tracking Prevention, or custom data updates.
See the performRemoteSynchronization() reference for more information about SSCs.
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.