View as Markdown

US State Privacy (GPP)

Overview

In addition to GDPR support, the Ezoic CMP handles US state privacy laws (such as the California CCPA/CPRA) using the IAB Global Privacy Platform (GPP).

When a visitor is located in a US state where a privacy law applies, the CMP automatically:

  • Provides the IAB GPP API (window.__gpp) on the page
  • Displays a consent banner with Consent and Do Not Sell My Information options
  • Stores the visitor's choice and passes it to advertising partners via the GPP consent string

This works out of the box with the standard CMP installation described in GDPR Compliance — no additional configuration is required.

Add a visible link with the class ez-do-not-sell, usually in the footer next to your privacy policy:

<a href="/privacy">Privacy Policy</a>
<a href="#ez-do-not-sell" class="ez-do-not-sell">Do Not Sell My Information</a>

The class is required. You can change the link text. "Do Not Sell or Share My Personal Information" is also fine.

When that element is visible on the page:

  • The Privacy Preferences banner is not shown.
  • Clicking the link opens the same opt-out dialog as the banner's Do Not Sell My Information button.

If the page has no visible element with that class, the banner is shown as usual. A link that is visibility: hidden, zero-size, inside a hidden parent, or sitting fully left or right of the viewport does not replace the banner. A footer link below the fold still counts as visible.

To keep the link off the page until a US state privacy law applies, leave it in the footer with display: none:

<a href="#ez-do-not-sell" class="ez-do-not-sell" style="display: none">Do Not Sell or Share My Personal Information</a>

The privacy script runs only for visitors in those states. It removes that display: none from the link, shows it, and skips the banner. Other visitors never receive that script, so the link stays hidden.

Suppressing the banner yourself

Warning: Use this only when you need to open the opt-out dialog from your own JavaScript. If you hide the banner, visitors still need a working way to opt out. A visible ez-do-not-sell link above is enough on its own and does not need this attribute.

To hide the banner without using the ez-do-not-sell class, add data-ez-gpp-suppress-banner="true" to the CMP script tag:

<script data-cfasync="false" data-ez-gpp-suppress-banner="true" src="https://cmp.gatekeeperconsent.com/min.js"></script>
<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>

The GPP API (window.__gpp) is still provided and stored choices are still honored. Open the same dialog from your own link by calling window.ezGPPOpenModal():

<a href="#" onclick="window.ezGPPOpenModal(); return false;">Do Not Sell or Share My Personal Information</a>

Hiding the link with style="display: none" is enough. The CMP also sets window.ezGPPEnabled = true when the visitor is in a jurisdiction where a US state privacy law applies. If you would rather add the link from your own script, check this flag and put ez-do-not-sell on the element you add. A link that becomes visible after the banner has already appeared removes the banner.

if (window.ezGPPEnabled === true) {
    // Render your "Do Not Sell or Share My Personal Information" link
}

Because the CMP script loads asynchronously, run this check after the page has finished loading (for example, in a window load event handler) rather than immediately when your own script is parsed.