public interface

OptimizelyEventListener

com.optimizely.integration.OptimizelyEventListener
Known Indirect Subclasses

Class Overview

Interface for clients which want notifications when various Optimizely events occur. Listeners are weakly held, so you may need to re-register your listeners if you don't hold onto them.

Summary

Public Methods
abstract void onGoalTriggered(String description, List<OptimizelyExperimentData> affectedExperiments)
Notification that a goal has been triggered.
abstract void onMessage(String source, String messageType, Bundle payload)
Called whenever a core component or plugin sends a message that is not covered by the functions above.
abstract void onOptimizelyDataFileLoaded()
Notification that will fire whenever Optimizely loads a new configuration file.
abstract void onOptimizelyEditorEnabled()
Notification that Optimizely is now running in edit mode (though not necessarily connected to the online editor)
abstract void onOptimizelyExperimentVisited(OptimizelyExperimentData experimentState)
Notification that is fired whenever the user's experience has been affected by an experiment.
abstract void onOptimizelyFailedToStart(String errorMessage)
Notification that Optimizely was unable to initialize along with a debugging message.
abstract void onOptimizelyRestarting(OptimizelyRunningMode currentRunningMode, OptimizelyRunningMode nextRunningMode)
Called whenever Optimizely is restarting A restart occurs when entering edit mode, entering preview mode, and when changing preview configuration.
abstract void onOptimizelyStarted()
Notification that Optimizely has successfully initialized and is now running.

Public Methods

public abstract void onGoalTriggered (String description, List<OptimizelyExperimentData> affectedExperiments)

Notification that a goal has been triggered.

Parameters
description A description of the goal event
affectedExperiments the experiments that are active and tracking this goal

public abstract void onMessage (String source, String messageType, Bundle payload)

Called whenever a core component or plugin sends a message that is not covered by the functions above.

Parameters
source ID of the plugin or core component that sent the message
messageType type of the message
payload payload of extras bundled into the message

public abstract void onOptimizelyDataFileLoaded ()

Notification that will fire whenever Optimizely loads a new configuration file.

public abstract void onOptimizelyEditorEnabled ()

Notification that Optimizely is now running in edit mode (though not necessarily connected to the online editor)

public abstract void onOptimizelyExperimentVisited (OptimizelyExperimentData experimentState)

Notification that is fired whenever the user's experience has been affected by an experiment. This means that: a live variable has been evaluated, a code block has been evaluated, or a visual change has been seen by the user.

Parameters
experimentState the current running state of the experiment.

public abstract void onOptimizelyFailedToStart (String errorMessage)

Notification that Optimizely was unable to initialize along with a debugging message. This notification will be sent to new listeners as they register if Optimizely has already failed to start.

Parameters
errorMessage the cause of the failure to start.

public abstract void onOptimizelyRestarting (OptimizelyRunningMode currentRunningMode, OptimizelyRunningMode nextRunningMode)

Called whenever Optimizely is restarting A restart occurs when entering edit mode, entering preview mode, and when changing preview configuration. This gives users a chance to do things such as restarting services that rely on the values of live variables.

Parameters
currentRunningMode the running mode Optimizely is currently in.
nextRunningMode the next running mode Optimizely will be in.

public abstract void onOptimizelyStarted ()

Notification that Optimizely has successfully initialized and is now running. This notification will be sent to new listeners as they register if Optimizely is already running.