Skip to main content
The Activation API is a JavaScript object, Kameleoon.API, that your page code uses to call Kameleoon methods and read Kameleoon data in the visitor’s browser. It comes with the Kameleoon application file, engine.js (previously named kameleoon.js), which you install on your website to use Web Experimentation, or Feature Experimentation in hybrid mode.

What the Activation API does

The Activation API does four things:
  • Runs variations without flicker: The Core module provides methods that implement frontend A/B testing variations without flicker.
  • Sends tracking data: The Goals, Data, and Products modules send conversions, custom data, and product events to Kameleoon. These calls work like the tracking calls you make to analytics tools, such as Google Analytics.
  • Reads real-time visit data: The Visit object holds data that Kameleoon collects during the visit. For example, you can read a visitor’s page views across all previous visits, or how long they stayed on your website during their first visit.
  • Overrides experiment assignment: When Kameleoon assigns a visitor to an experiment, it chooses the variation at random by default. The Experiments module lets you override that assignment and register the visitor in a specific variation.

Why the Activation API is useful

The API is entirely JavaScript-based and runs in the visitor’s browser, which gives you these advantages:
  • Results return immediately: Nearly all methods execute synchronously and return right away. The exceptions are methods that need a server call, such as the product catalog methods in the Products module.
  • No authentication: The API requires no authentication, so your page code doesn’t need credentials to call it.
  • Visitor data stays private to each visitor: Standard browser security rules let a visitor’s page access only that visitor’s data, which Kameleoon stores in Local Storage, and not data from other visitors.
If your servers, rather than the visitor’s browser, need to read or write Kameleoon data, use the Data API instead. The Data API connects to external data sources, remote servers, and data management platforms (DMPs).

Check that the engine has loaded

Before you call the Activation API JavaScript object, verify that the Kameleoon Engine has loaded. Use the Kameleoon Command Queue for delayed command execution when you send tracking data, trigger experiments, or update visitor attributes. If the engine has loaded, passed commands and functions execute immediately. Otherwise, they enter a queue for later execution. For more information, refer to the Command queue documentation.

Modules

Each module page lists its methods with their arguments and return values.

Objects

These objects describe the data that the Activation API methods return. Each object page lists the properties of its objects.