The Full Stack Developer Guide Developer Hub

Welcome to the Full Stack Developer Guide developer hub. You'll find comprehensive guides and documentation to help you start working with the Full Stack Developer Guide as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Print execution logic to your browser's console.

Syntax

window["optimizely"].push(log);
Parameters
Parameter and Type
Child Attribute
Description

log
LogObject

-

An object with the type field set to log. Required.

type
string

Child attribute of type LogObject

The argument indicating that you're using the log function. Required.

level
string

Child attribute of type LogObject

One 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 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.

Updated about a year ago


Log


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.