How do I add an opt out privacy button on my website?

You can link users to the Lucky Orange privacy page which includes a button to opt out globally from sites using Lucky Orange. Or, if you'd like to do this on your site directly, the Lucky Orange code exposes a few API calls to help with this.

Lucky Orange API Functions:

LO.is_opted_out(); // returns true if they are opted out, or false if tracking
LO.opt_out(); // marks a 1st party cookie to opt out of tracking
LO.opt_in(); // removes the cookie to allow tracking again</strong>

Sample Code:Here is some sample code to help you create a toggleable Opt Out button. The code waits for Lucky Orange to load and then shows the opt in/out buttons according to the status of the current user. Paste it where you want the button to appear.