Skip to main content
This module provides methods to access live experiments.
This module is only available with Kameleoon Web Experimentation solution.

assignVariation

The assignVariation() method forces the association of a specific variation for an experiment, which overrides the standard allocation algorithm. If you call this before the experiment triggers, the engine pre-allocates the variation for later activation. If the experiment has already triggered, set the override argument to true to replace the existing association.
Arguments

block

The block() method prevents an experiment from triggering or activating, including manual calls through trigger(). The block applies to the current page by default until the next Kameleoon.API.Core.load(). Set the visit argument to true to block the experiment for the entire visit.
Arguments

getAll

The getAll() method returns all live experiments (running, not draft/paused/stopped).
Return value

getActive

The getActive() method returns active experiments for the current visit and page. An experiment is active if its variation code has executed in the current session context. To retrieve experiments that you activated on other URLs during the visit, use getActivatedInVisit().
Return value

getById

The getById() method returns the experiment for the specified ID.
Arguments Return value

getByName

The getByName() method returns the experiment for the specified name.
Arguments Return value

getTriggeredInVisit

The getTriggeredInVisit() method returns all experiments triggered during the current visit.
Return value

getActivatedInVisit

The getActivatedInVisit() method returns all experiments activated during the current visit.
Return value

trigger

The trigger() method forces an experiment to trigger, bypassing targeting segment conditions. This action initiates the experiment but might not activate it.
Arguments