enableDebug

Enables debug mode, which will output console logs to help verify changes made.

RebuyExperiments.enableDebug()

disableDebug

Disables debug mode, which will silence console logs.

RebuyExperiments.disableDebug()

run

Runs an experiment and applies the provided changes immediately. This method accepts two arguments experiment and useCookie.

RebuyExperiments.run(experiment, useCookie)
ArgumentDescription
experimentRequired. This can be a string identifying an object to enable such as 'smart cart' or '12345'. Alternatively, this can be an object with two mandatory properties (key and settings), where key is a string identifying the object to target such as 'smart cart' or '12345', and settings is an object containing the modifications you would like applied.
useCookieOptional. Boolean flag to use a session based cookie to automatically apply the experiment on subsequent page loads. This defaults to false, however passing in true will automatically run the experiment for the duration of the session. This is useful when keying off ephemeral states, such as utm_campaign URL arguments that are only present upon session start.