View as Markdown

GCM Control Module

Overview

This module enforces Google Consent Mode v2 signals through Prebid.js activity controls, as the TCF Control and GPP Control modules do for their frameworks. It complements the Google Consent Mode consent management module, which reads the Consent Mode state from the page.

When a signal is 'denied', the activities it maps to are denied. A signal that is 'granted', or that nothing set, denies nothing.

While the consent management module is still waiting for Consent Mode (see its timeouts), the state isn’t known, and every signal is taken as denied, as TCF Control assumes no consent until the CMP answers. Once the wait is over and no Consent Mode signal was found, the module does nothing, unless defaultWhenAbsent is 'denied'.

Prebid functionality created to address regulatory requirements does not replace each party’s responsibility to determine its own legal obligations and comply with all applicable laws. We recommend consulting with your legal counsel before determining how to utilize these features in support of your overall privacy approach.

Default activity mapping

Signal denied Activities denied
ad_storage accessDevice for bidders and user ID modules (no cookies or local storage)
analytics_storage reportAnalytics, and accessDevice for analytics adapters
ad_user_data transmitEids, transmitUfpd and transmitPreciseGeo: user data sent to bidders
ad_personalization transmitUfpd and enrichEids

Working with other frameworks

The stricter framework wins. GCM Control adds its own activity rules, and an activity is denied if any framework’s rule denies it. For example, with TCF and Consent Mode both on the page, a bidder can write cookies only if TCF gives it a legal basis for purpose 1 and ad_storage is granted.

These rules have the priority of other module rules, 10. Publisher rules set through allowActivities with a higher priority (a lower number, 1 by default) can still override them, as they can for TCF Control.

Page Integration

This module activates when consentManagement.gcm is configured and the consentManagementGcm module is in the build. See that module’s documentation for its parameters. The mapping can be changed per signal:

Param Type Description Example
gcm.rules Object Map from Consent Mode signal to the list of activities it denies. A signal listed here replaces its default mapping; signals not listed keep theirs. An empty list makes a signal deny nothing. Signals other than the four Consent Mode v2 ones, such as functionality_storage, can be mapped too. A value that isn’t a list is ignored, with a warning. {ad_personalization: ['transmitUfpd']}
gcm.rules.<signal>[] string or Object An activity name, which denies it to every component, or {activity, componentTypes}, which denies it only to the listed component types ('bidder', 'userId', 'analytics', 'rtd', 'prebid'). {activity: 'accessDevice', componentTypes: ['bidder']}

Examples

Example 1: ad_personalization denies only transmitUfpd, so user IDs still enrich requests. Some publishers want contextual ads, still with user IDs, when personalization is denied.

pbjs.setConfig({
  consentManagement: {
    gcm: {
      rules: {
        ad_personalization: ['transmitUfpd']
      }
    }
  }
});

Example 2: ad_storage also stops user syncs and storage by RTD modules.

pbjs.setConfig({
  consentManagement: {
    gcm: {
      rules: {
        ad_storage: [
          { activity: 'accessDevice', componentTypes: ['bidder', 'userId', 'rtd'] },
          'syncUser'
        ]
      }
    }
  }
});

Limitations

  • The module enforces the state that the consent management module resolved, with its limitations. Where the page doesn’t say enough, as with region-scoped defaults and no known region, that state errs towards denied.
  • An update that denies a signal applies to bidding from the next auction. Revoking analytics_storage mid-session disables enabled analytics adapters through their disableAnalytics() method, as for any consent change that denies reportAnalytics. Adapters that don’t implement disableAnalytics() stay enabled, and Prebid.js logs a warning.
  • url_passthrough and ads_data_redaction aren’t consent signals and aren’t enforced.

Build the Package

Follow the basic build instructions in the GitHub Prebid.js repo’s main README. To include the consent management module and this module, add them to the gulp build command:

gulp build --modules=consentManagementGcm,gcmControl,bidAdapter1,bidAdapter2

You can also use the Prebid.js Download page.

Further Reading