GuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Opt a visitor out of Optimizely tracking.

Description

Opt a visitor out of Optimizely tracking. For example, you may want to opt visitors out of Optimizely tracking as part of your site's broader opt-out preferences.

📘

Note

On the first page load on which the microsnippet executes, this will only affect tracking (logx), and not experiment activation or evaluation. On subsequent payloads, the user will not get bucketed into any experiments.

If the Dynamic Websites project setting is on, using this API may also affect some experiment activation and evaluation on the first page load.

window.optimizelyEdge.push(optOut);
window.optimizelyEdge.push({
  "type": "optOut",
  "isOptOut": true
});

Parameters

This table provides general information about required and optional parameters.

Parameter

Type

Description

optOut
required

object

An object with the type field set to optOut.

The other fields are the function arguments.

optOut.type
required

string

The argument indicating that you are using the optOut function.

optOut.isOptOut
optional

boolean

It is possible to opt in a previously opted-out visitor.