HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Print execution logic to your browser's console.

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 emitting a warning.

πŸ“˜

Note

Only affects tracking snippet logs, not edge-decider/microsnippet which only can be delivered via ?optimizely_log.

window.optimizelyEdge.push(log);
window.optimizelyEdge.push({
  "type": "log",
  "level": "INFO"
});

Parameters

This table provides general information about required and optional parameters.

Parameter

Type

Description

Log
required

object

An object with the type field set to log.

Log.type
required

string

The argument indicating that you are using the log function.

Log.level
optional

string

One of the following:

  • OFF: No logs
  • ERROR: Errors only
  • WARN: Warning and above
  • INFO: Info and above
  • DEBUG: Debug and above