Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

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

Opt a visitor out of Optimizely Performance Edge tracking.

Opt a visitor out of Optimizely Performance Edge tracking. For example, you may want to opt visitors out of Optimizely Performance Edge 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.

ParameterTypeDescription
optOut
required
objectAn object with the type field set to optOut.

The other fields are the function arguments.
optOut.type
required
stringThe argument indicating that you are using the optOut function.
optOut.isOptOut
optional
booleanIt is possible to opt in a previously opted-out visitor.

📘

Verify opt-out mode is working

Setting isOptOut to true creates a cookie called optimizelyOptOut.

To verify it is working, you can:

  • Check for the existence of the optimizelyOptOut cookie.
  • Append the optimizely_log=DEBUG query parameter. This prints the Optimizely Performance Edge log which shows if opt-out mode is activated.