Opt-out feature¶
If you would like to disable tracking and showing web messages, please use the opt-out feature. When in the opted-out state, the SDK will behave as below.
Sessions won't start.
No data will be send to the Repro servers.
Web messages won't be presented.
Note
Opt-out setting is not bound to a user account but instead bound to the browser. If one user accesses the same site on multiple browsers, he/she will have to opt-out on all browsers.
Please set the user profile and event tracking after opting-in. These values will be ignored while in the opt-out state.
Warning
The opt-out feature is only available on Version 2 of the Web SDK.
Setting the initial state of opt-in/opt-out¶
To set the default state when a user first accesses your site, please set the opt_out_by_default
property in the options when calling setup
. By default, this is set as false
, i.e. the default state will be opted-in. If you would like to set the default state as opted-out, please set the property value to true
.
You can set the default state by:
reproio("setup", "YOUR_REPRO_SDK_TOKEN", { opt_out_by_default: true });
Opting-in¶
To switch from an opted-out state to an opted-in state, please call the optIn
API.
reproio('optIn');
Note
A session will start when the state switches from the opted-out state to opted-in state.
Warning
After calling the optIn API, be sure to call
reproio("setup", "YOUR_REPRO_SDK_TOKEN");
.If you would like to also set an user ID, after calling the optIn API, please call
setUserID
followed bysetup
.
Opting-out¶
To switch from an opted-in state to an opted-out state, please call the optOut
API.
reproio('optOut');
Checking the current opt-in/opt-out state¶
You can check the current state of the client by called the isOptedIn
API. This will return a boolean value true
if the client is in the opted-in state and false
if in the opted-out state.
reproio('isOptedIn');