US privacy (CCPA)
For a visitor under a US state privacy law, OptSens shows the "Your Privacy Choices" opt-out instead of the GDPR banner, and writes the GPP and US Privacy strings to the device. Which visitors this applies to is decided automatically by geolocation: you do not detect the region yourself, and the default strings are written for you.
Unlike GDPR, a US opt-out does not interrupt the visitor at launch, so there is no banner to show at startup. The visitor reaches the opt-out through a persistent control:
- On phone and tablet, the floating button is that control, and it routes a US visitor straight to the "Your Privacy Choices" panel. No extra code.
- On TV, or if you have turned the floating button off, place your own
always-available entry (a Settings row, a footer link), gate it on
OptSens.isDoNotSellApplicable(), and wire it to the geo-aware reopen path (Showing the banner).
On the web, OptSens shows the official "Your Privacy Choices" opt-out icon automatically. In an app you place your own entry point, so add the same icon next to your label. It is the standard California opt-out icon and its colors are fixed by the regulation; use it as-is:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" width="30" height="14">
<path fill="#fff" fill-rule="evenodd" clip-rule="evenodd" d="M7.4 12.8h6.8l3.1-11.6H7.4C4.2 1.2 1.6 3.8 1.6 7s2.6 5.8 5.8 5.8z"/>
<path fill="#06f" fill-rule="evenodd" clip-rule="evenodd" d="M22.6 0H7.4C3.5 0 .4 3.1.4 7s3.1 7 7 7h15.2c3.9 0 7-3.1 7-7s-3.1-7-7-7zM1.6 7c0-3.2 2.6-5.8 5.8-5.8h9.9l-3.1 11.6H7.4C4.2 12.8 1.6 10.2 1.6 7z"/>
<path fill="#fff" d="M24.6 4c.2.2.2.6 0 .8L22.5 7l2.2 2.2c.2.2.2.6 0 .8-.2.2-.6.2-.8 0l-2.2-2.2L19.5 10c-.2.2-.6.2-.8 0-.2-.2-.2-.6 0-.8L20.8 7l-2.2-2.2c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0l2.2 2.2L23.8 4c.2-.2.6-.2.8 0z"/>
<path fill="#06f" d="M12.7 4.1c.2.2.3.6.1.8L8.6 9.8c-.1.1-.2.2-.3.2-.2.1-.5.1-.7-.1L5.4 7.7c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0L8 8.6l3.8-4.5c.2-.2.6-.2.9 0z"/>
</svg>
Add it to your opt-out control as a vector asset (Android) or an image (iOS).
To build a fully custom opt-out screen, apply the choice directly:
- Android
- iOS / tvOS
OptSens.applyUsPrivacy(saleOptOut = true)
Open the panel with OptSensBanner.showPrivacyChoices(activity).
OptSens.applyUsPrivacy(saleOptOut: true)
OptSensReconsentView shows the panel automatically for a US visitor.
applyUsPrivacy writes the GPP and legacy US Privacy keys and records the choice;
the built-in panel calls it for you; you call it directly only when you build
your own opt-out UI. Use OptSens.isDoNotSellApplicable() to decide whether to
show a "Do Not Sell" link in your own UI.