The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

Log

Print execution logic to your browser's console.

Syntax

window["optimizely"].push(log);

Parameters

Parameter and TypeChild AttributeDescription
log
LogObject
N/AAn object with the type field set to log. Required.
type
string
Child attribute of type LogObjectThe argument indicating that you're using the log function. Required.
level
string
Child attribute of type LogObjectOne of the following:
OFF: No logs
ERROR: Errors only
WARN: Warning and above
INFO: Info and above
DEBUG: Debug and above

Example Call

window["optimizely"].push({
  "type": "log",
  "level": "INFO"
});

Description

Tell Optimizely Web Experimentation to output its log to the browser's console log (default is OFF).

You can also do this by using the query parameter optimizely_log={level}.

If you set the level to the currently configured log level, this function has no effect other than generating a warning.