Skip to content

Google Consent Mode v2

Implement Google Consent Mode v2 with Apidly for compliant analytics and ad tracking across all regions.

Google Consent Mode v2 is a framework that allows websites to adjust the behavior of Google tags based on the consent status of their visitors. When a visitor has not granted consent for cookies or tracking, Google tags modify their operation to respect that choice while still providing aggregated, privacy-safe measurement data to the website operator.

Version 2, which Google began enforcing for European Economic Area traffic in March 2024, introduced two new consent signal parameters: ad_user_data and ad_personalization. These parameters give users more granular control over how their data is used for advertising purposes. Any website serving ads to or collecting data from EEA users through Google services must implement Consent Mode v2 to continue receiving full reporting and audience functionality.

Why It Matters

EU Regulatory Requirements

The Digital Markets Act designates Google as a gatekeeper platform, which means Google must obtain verifiable consent signals before processing user data for advertising. Without Consent Mode v2, Google cannot confirm that a website has collected valid consent, and it will restrict the data available in your Google Analytics 4 and Google Ads accounts.

For websites that rely on Google advertising, this means reduced audience signals, limited conversion tracking, and degraded campaign optimization. Consent Mode v2 is the mechanism through which Google verifies that your consent practices meet the DMA's requirements.

Maintaining Data Quality

Without Consent Mode, the only options are to fire all tags regardless of consent, which violates privacy regulations, or to block all tags until consent is granted, which creates significant data gaps. Consent Mode provides a middle path: when consent is denied, Google tags fire in a limited capacity that does not set cookies but still sends anonymous pings. Google then uses machine learning to model the missing conversions, giving you directionally accurate data without compromising user privacy.

This modeling capability means that even with high opt-out rates, your analytics and advertising data remain actionable. Businesses using Consent Mode typically recover 60 to 80 percent of the conversion data that would otherwise be lost to consent barriers.

How It Works

Google Consent Mode operates through a set of consent state parameters that your consent management platform communicates to the Google tag (gtag.js or Google Tag Manager). The key parameters are:

  • analytics_storage: Controls whether analytics cookies such as _ga may be set
  • ad_storage: Controls whether advertising cookies may be set
  • ad_user_data: Controls whether user data may be sent to Google for advertising
  • ad_personalization: Controls whether data may be used for ad personalization

When a visitor loads your page, the default consent state is set before any Google tags fire. If the visitor has not yet made a consent choice, all parameters are typically set to "denied." Once the visitor interacts with the consent banner and grants or withholds consent, the parameters are updated in real time, and Google tags adjust their behavior accordingly.

In the basic implementation, Google tags are blocked entirely until consent is granted. This is simpler but results in complete data loss for visitors who do not consent.

In the advanced implementation, Google tags load with consent parameters set to "denied" by default. Tags fire in a cookieless mode, sending anonymous measurement pings without setting any cookies. When consent is granted, the tags switch to full functionality. This approach enables Google's behavioral modeling and provides significantly better data coverage.

Setup with Apidly

Apidly integrates natively with Google Consent Mode v2. No manual tag configuration or custom code is required.

In your Apidly dashboard, navigate to the integrations section and enable Google Consent Mode v2. Select whether you want the basic or advanced implementation. Apidly recommends the advanced implementation for maximum data recovery.

Apidly automatically maps its consent categories to Google's consent parameters. Analytics consent maps to analytics_storage, marketing consent maps to ad_storage, ad_user_data, and ad_personalization. You can customize these mappings if your consent categories differ from the defaults.

Step 3: Verify the Integration

Use Google Tag Assistant or the browser developer console to verify that consent signals are being sent correctly. Apidly provides a built-in diagnostic tool that shows the current consent state and the signals being forwarded to Google in real time.

Step 4: Monitor in Google Analytics

After implementation, check the consent overview report in Google Analytics 4 to confirm that consent signals are being received. Google will begin modeling conversions for non-consented traffic within a few days of activation.

Apidly eliminates the technical complexity of implementing Google Consent Mode v2. The platform handles default consent states, consent updates, parameter mapping, and signal forwarding automatically. When Google introduces changes to the Consent Mode specification, Apidly updates its integration without requiring any action from your team.

The platform also ensures that your Consent Mode implementation stays synchronized with your broader consent management practices. A single consent choice from the visitor propagates to Google tags, third-party scripts, cookie settings, and your server-side consent records simultaneously, preventing inconsistencies that could create compliance gaps.

For organizations running Google Ads campaigns targeting the EEA, Apidly's Consent Mode integration preserves access to Enhanced Conversions, remarketing audiences, and Smart Bidding signals that would otherwise be unavailable without verified consent signals.

Compatibility and Regional Scope

Apidly's Consent Mode integration works with all Google tag implementations, including gtag.js deployed directly, Google Tag Manager containers, and Google Tag Manager server-side tagging. The integration is also compatible with other tag management systems that support the Google consent API.

While Consent Mode v2 is mandatory for EEA traffic, Apidly applies appropriate consent signals globally based on each visitor's jurisdiction. Visitors from regions without specific consent requirements receive full tag functionality by default, while visitors from regulated regions see the consent interface and have their choices reflected in the tag behavior. This regional approach maximizes data collection where permitted while maintaining strict compliance where required.