E-Commerce Analytics and Privacy Guide
Google Consent Mode v2 is an important part of managing how Google Analytics 4 (GA4), Google Ads, and other supported Google tags behave according to visitors’ consent choices. For e-commerce businesses, the implementation affects analytics data collection, advertising measurement, remarketing, and conversion reporting.
This guide explains Google Consent Mode v2, the difference between Basic and Advanced Consent Mode, how to implement consent signals with Google Tag Manager or gtag.js, and what Shopify, WooCommerce, and custom e-commerce websites should check before going live.
Consent Mode communicates consent choices to supported Google tags. It does not replace a consent banner, independently collect valid consent, or guarantee that a website complies with every applicable privacy law.
1. What Is Google Consent Mode v2?
Google Consent Mode is a framework that allows supported Google tags
to adjust their behavior according to the consent status communicated
by a website or app. Version 2 introduced two additional advertising
consent signals: ad_user_data and
ad_personalization.
These signals work alongside ad_storage and
analytics_storage to communicate choices related to
advertising cookies, analytics storage, the use of data for
advertising, and personalized advertising.
For an online store, this matters because the same website may use GA4 to analyze shopping behavior, Google Ads to measure campaign performance, and remarketing features to reach eligible audiences. Consent Mode helps supported Google products respond to the relevant consent signals instead of treating every visitor identically.
What Consent Mode v2 does
- Communicates consent states to supported Google tags.
- Controls certain tag behaviors according to consent choices.
- Supports measurement approaches that can use modeling where eligible.
- Helps coordinate analytics and advertising consent signals.
What Consent Mode v2 does not do
- Automatically create a complete cookie consent banner.
- Decide which privacy laws apply to your business.
- Guarantee that all third-party scripts honor user preferences.
- Guarantee complete conversion measurement or recovered data.
- Replace a privacy policy, consent records, or legal review.
The distinction is important: your store remains responsible for obtaining and managing consent where required, communicating the correct status, and making sure its tracking setup respects those choices.
2. The Four Consent Mode v2 Signals Explained
The four main consent signals have different purposes. They should not be treated as interchangeable switches because permission for analytics storage does not automatically mean permission for advertising data use or personalized advertising.
| Consent signal | What it controls | E-commerce example |
|---|---|---|
analytics_storage |
Analytics-related storage, such as cookies used to understand website activity. | Whether supported analytics tags can use analytics storage according to the consent state. |
ad_storage |
Storage related to advertising, including relevant advertising cookies. | Whether supported advertising tags can access advertising-related storage. |
ad_user_data |
Consent for sending user data to Google for online advertising purposes. | Controls eligible advertising use cases involving user-provided data or enhanced conversions. |
ad_personalization |
Consent for personalized advertising. | Controls eligible personalized advertising and remarketing functionality. |
Each signal can generally be set to granted or
denied. Your CMP or custom consent implementation
should map a visitor’s actual choices to the appropriate signals.
What happens when a visitor rejects consent?
The result depends on the consent type and implementation mode.
For example, when analytics_storage is denied,
supported Google Analytics tags do not read or write analytics
cookies. Under Advanced Consent Mode, eligible tags may still
send limited, cookieless measurement signals. Under Basic Consent
Mode, Google tags remain blocked until the relevant consent is
granted.
If ad_personalization is denied, personalized advertising
features are disabled for the affected traffic. If
ad_user_data is denied, the use of user data for
Google’s online advertising purposes is restricted.
granted
simply to maximize analytics coverage.
3. Why E-Commerce Stores Need Consent Mode v2
Online stores depend on measurement to understand acquisition costs, conversion rates, product demand, and advertising profitability. Consent requirements can affect which data is available for these purposes.
Improve advertising measurement where eligible
Google Ads and other supported Google services can use consent signals to determine how eligible tags behave. Depending on the implementation and applicable eligibility requirements, Consent Mode can also support conversion modeling when some direct measurement is unavailable.
Manage remarketing and personalized advertising
E-commerce businesses often build audiences based on product views, shopping cart activity, or other interactions. Consent signals help communicate whether relevant advertising data use and personalization are permitted for the visitor.
Understand the limits of GA4 reporting
When analytics storage is denied, the available data may differ from data collected when consent is granted. Advanced Consent Mode can provide limited signals for eligible modeling, but it does not guarantee complete user journeys or exact reconstruction of every missing transaction.
Prepare for privacy requirements in different markets
Stores that serve customers in multiple countries may face different rules regarding cookies, analytics, advertising, and personal data. A consent management solution can help apply appropriate choices and regional defaults, but the configuration must match the business’s actual legal and operational requirements.
Google has specific consent requirements for certain advertising features and traffic from the European Economic Area. Other jurisdictions may impose different obligations, so do not assume that a single banner configuration is appropriate everywhere.
4. Basic vs. Advanced Consent Mode
Google supports two main Consent Mode implementation approaches. The key difference is what happens to Google tags before a visitor grants consent.
Basic Consent Mode
Google tags are blocked until the visitor interacts with the consent banner and grants the relevant consent.
- No Google tag data is sent before consent.
- Denied visitors do not send Consent Mode pings.
- Measurement depends on data available after consent.
- Google Ads modeling, where eligible, uses a general model.
Advanced Consent Mode
Google tags load with default consent states. When consent is denied, supported tags can send limited cookieless signals.
- Tags can communicate denied consent states.
- Some limited measurement signals may be sent.
- Full measurement behavior depends on consent granted.
- More detailed modeling may be available when eligible.
| Feature | Basic | Advanced |
|---|---|---|
| Google tags before consent | Blocked | Load with configured defaults |
| Signals when consent is denied | None from blocked Google tags | Limited cookieless signals may be sent |
| Modeling opportunities | May use a general model where eligible | May support more detailed advertiser-specific modeling |
| Implementation needs | Correct blocking and consent-based tag release | Correct default states, consent updates, and tag behavior |
Neither approach should be selected solely to maximize tracking. Choose an implementation that fits your privacy obligations, consent policy, platform capabilities, and measurement requirements.
Advanced Consent Mode is not a way to bypass consent. It changes the behavior of supported Google tags when consent is denied; it does not independently establish a legal basis for collecting or transmitting data.
5. Choose a Consent Management Platform
A consent management platform, or CMP, displays privacy choices, records preferences, and communicates those choices to integrated services. Many CMPs offer integrations with Google Tag Manager and Google Consent Mode.
What to look for in a CMP
- Support for Consent Mode v2 and the four main consent signals.
- Compatibility with your e-commerce platform and analytics setup.
- Clear accept, reject, and preference-management options.
- Support for changing or withdrawing consent later.
- Regional consent rules and configurable banner behavior.
- Documentation for Google Tag Manager and Google tag integration.
- Appropriate consent records and preference persistence.
Should you use a CMP or build your own banner?
A supported CMP is often the simpler option for stores that use several analytics and advertising services. It can reduce the amount of custom consent code required, although its configuration still needs to be tested.
A custom banner can work when the development team can reliably manage consent defaults, updates, persistence, regional rules, and tag behavior. A visual banner alone is not sufficient if the tags ignore the visitor’s choices.
6. How to Implement Consent Mode v2 Step by Step
Step 1: Audit your tracking tools
List all services that collect analytics or advertising data. Include GA4, Google Ads conversion tracking, remarketing tags, Google Tag Manager, e-commerce plugins, and any third-party scripts that process visitor information.
Step 2: Review your consent banner
Check whether visitors can make the choices appropriate for your legal requirements. The interface should communicate the relevant categories clearly and allow users to manage or change their preferences.
Step 3: Configure default consent states
Set the appropriate defaults before Google tags send measurement
data. Where consent is required and has not yet been given, the
relevant signals commonly default to denied.
Apply regional settings only when they reflect your actual policy.
Step 4: Connect the CMP to Google tags
Use the CMP’s supported integration or configure the consent mechanism in Google Tag Manager. Map the visitor’s selections to the correct consent signals rather than granting every permission when any single option is accepted.
Step 5: Update consent after user interaction
When visitors accept, reject, or customize their choices, update the consent state promptly. If a user later withdraws consent, the new state must also be communicated and respected.
Step 6: Persist preferences appropriately
Save the visitor’s choices through the CMP or your consent management mechanism. On subsequent pages, restore the appropriate state before measurement tags act. Consent Mode itself does not store the user’s preference for you.
Step 7: Test all consent scenarios
Verify the behavior for a first-time visitor, a visitor who accepts, a visitor who rejects, a visitor who customizes preferences, and a visitor who later changes their mind.
7. Consent Mode v2 Implementation Code Example
The following example illustrates the Google tag consent API. It assumes that gtag.js is already installed and initialized correctly. Replace the placeholder tag ID and connect the update functions to a real consent management interface.
Do not paste this example alongside another conflicting consent implementation. If you use a CMP or Google Tag Manager consent template, follow that integration’s documented method instead.
Example A: Set default consent states
// Initialize the data layer and gtag function.
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
// Set defaults before sending measurement data.
// These are illustrative defaults, not universal legal advice.
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
});
// Initialize the Google tag after consent defaults.
// Use your actual Google tag ID.
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
The ordering is important: the default consent state must be established before commands that send measurement data. Your actual integration must also load the Google tag library correctly.
Example B: Update consent after the visitor accepts all categories
function onAcceptAllConsent() {
gtag('consent', 'update', {
'analytics_storage': 'granted',
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted'
});
}
Connect this function only to a valid action in your consent interface. The example represents a visitor who has actually accepted all relevant categories; it must not be triggered automatically when the page loads.
Example C: Update consent after the visitor rejects optional categories
function onRejectOptionalConsent() {
gtag('consent', 'update', {
'analytics_storage': 'denied',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
});
}
This example assumes that all four optional categories are rejected. A real implementation should map the visitor’s choices to each signal independently, based on the CMP configuration and applicable requirements.
Example D: Accept analytics but reject advertising
function onAnalyticsOnlyConsent() {
gtag('consent', 'update', {
'analytics_storage': 'granted',
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
});
}
This illustrates why the signals are separate. A visitor may allow analytics while declining advertising-related storage and advertising data use, depending on the options presented and the applicable consent rules.
setDefaultConsentState and
updateConsentState. Do not substitute ordinary
gtag consent commands for these APIs inside a custom GTM template.
Official implementation reference: Google Consent Mode setup documentation .
8. What Shopify, WooCommerce, and Custom Stores Need to Do
Shopify
Shopify merchants should review the platform’s customer privacy configuration, installed consent solution, Google integration, and any additional marketing apps. Verify that consent choices reach the relevant Google tags and that checkout-related tracking respects the configured consent behavior.
Do not assume that installing a cookie banner automatically configures every Google tag. Check the actual implementation, including any custom pixels, third-party checkout components, and overlapping analytics apps.
WooCommerce
WooCommerce stores commonly use WordPress consent plugins, Google Tag Manager, GA4 plugins, and marketing integrations. Review which component manages consent and which component sends analytics events.
Ensure that the CMP updates the correct consent signals before tracking occurs, that optional tags respect the consent state, and that changing preferences updates subsequent tag behavior.
Custom e-commerce websites
Custom stores need a coordinated implementation between the consent interface, front-end scripts, tag manager, and any server-side tracking. Developers should document the default state, consent updates, preference persistence, regional behavior, and tag-level requirements.
Server-side tracking does not remove the need to consider consent and applicable privacy requirements. Review both browser-side and server-side data flows.
9. How to Test Google Consent Mode v2
A banner that looks correct does not prove that Consent Mode is working. Test both the visible consent interface and the actual behavior of Google tags.
- Open Tag Assistant: Connect to your website and inspect the Google tags and consent information.
- Inspect the initial state: Before a visitor interacts with the banner, confirm that the intended default consent values are applied.
- Accept optional categories: Verify that the consent signals update according to the visitor’s choices.
- Reject optional categories: Check that denied storage and advertising permissions are respected.
- Change preferences: Confirm that updated choices are communicated without requiring an unrelated tracking action.
- Reload and navigate: Confirm that saved preferences are restored and defaults do not temporarily grant unauthorized access.
- Inspect network requests: Where appropriate, verify tag behavior and whether optional third-party requests occur in each scenario.
In Advanced Consent Mode, some cookieless requests can be expected when consent is denied. In Basic Consent Mode, blocked Google tags should not send those pre-consent signals. Interpret the results according to the chosen implementation rather than assuming that every network request is a failure.
Interactive Consent Mode v2 checklist
10. Common Consent Mode v2 Implementation Mistakes
Loading tracking tags before setting consent defaults
If Google tags process measurement commands before the correct consent defaults are established, the initial behavior may not match your intended policy. Configure defaults before measurement commands and test the initial page load.
Installing two conflicting consent solutions
Multiple banners, plugins, or tag manager templates can overwrite consent values or produce inconsistent behavior. Choose a primary consent mechanism and document how other integrations receive the resulting state.
Granting all signals when only analytics is accepted
Consent for analytics does not automatically grant consent for advertising storage, user data use, or personalized advertising. Map each category to the appropriate signal.
Assuming Consent Mode replaces a cookie banner
Consent Mode communicates states; it does not independently obtain a visitor’s choice. Implement an appropriate consent interface and apply the rules relevant to your visitors.
Failing to support consent withdrawal
Visitors may change their preferences after the first visit. Your implementation should update the consent state promptly and make sure subsequent tag behavior reflects the new choices.
Assuming Advanced Consent Mode means no data is sent
Advanced Consent Mode can send cookieless measurement signals when consent is denied. If your requirements call for Google tags to send no data before consent, evaluate Basic Consent Mode and configure blocking appropriately.
Expecting perfect conversion recovery
Modeling can help estimate some measurement gaps when eligibility and data thresholds are met. It does not recover every missing event or guarantee exact revenue figures.
11. What E-Commerce Stores Should Do Next
If your store already uses GA4 or Google Ads, begin with an audit instead of immediately installing another plugin.
- Identify the CMP, Google tag, GTM container, and existing integrations.
- Confirm whether Consent Mode v2 is configured and which implementation mode is used.
- Check the four main consent signals and the initial page-load behavior.
- Verify that each visitor choice is correctly reflected in tag behavior.
- Test checkout, purchase tracking, and any server-side integrations.
- Review regional requirements and document the final configuration.
- Retest after major changes to themes, apps, tags, or checkout flows.
Prioritize correct consent handling over simply increasing the number of events recorded. Reliable measurement depends on accurate consent states, well-configured tags, and clear data governance.
12. Frequently Asked Questions
What is Google Consent Mode v2?
Google Consent Mode v2 lets supported Google tags adjust their
behavior according to user consent. It includes four principal
signals: analytics_storage, ad_storage,
ad_user_data, and ad_personalization.
Is Consent Mode v2 the same as a cookie consent banner?
No. A consent banner or CMP collects and manages visitor choices. Consent Mode communicates those choices to supported Google tags so they can respond appropriately.
Is Consent Mode v2 mandatory for every website?
Requirements depend on the website’s location, audience, applicable law, and use of Google services. Google has specific consent requirements for certain advertising features and traffic from the European Economic Area. Check the requirements relevant to your business and integrations.
Does Consent Mode v2 work with GA4?
Yes. Supported Google Analytics tags can adjust data collection based on the communicated consent states. The available data and reporting behavior depend on the consent configuration.
What is the difference between Basic and Advanced Consent Mode?
Basic Consent Mode blocks Google tags until the visitor grants the relevant consent. Advanced Consent Mode loads tags with configured defaults and may send limited cookieless signals when consent is denied.
Does Consent Mode v2 improve conversion tracking?
It can support conversion modeling where Google product requirements and data thresholds are met. Results vary, and modeling does not guarantee that every missing conversion will be recovered.
Can WooCommerce and Shopify use Consent Mode v2?
Yes. Both can use compatible consent integrations or custom implementations. The exact configuration depends on the installed apps, checkout architecture, Google tags, and consent management solution.
Can I implement Consent Mode v2 with Google Tag Manager?
Yes. Use a compatible CMP integration or an appropriate consent template. Custom templates should use the documented Tag Manager consent APIs and be tested before publication.
Does Consent Mode v2 guarantee GDPR compliance?
No. Consent Mode is a technical framework, not a legal compliance certification. Websites must separately assess their applicable legal obligations, consent interface, data processing, and third-party integrations.
Conclusion: Get Consent Mode v2 Right for Your Online Store
Google Consent Mode v2 helps e-commerce businesses communicate consent choices to supported analytics and advertising tags. By configuring the four main consent signals, choosing an appropriate implementation mode, and testing actual tag behavior, store owners can build a more reliable measurement setup.
Start by auditing your existing consent banner and tracking integrations. Configure defaults correctly, map visitor choices to the right signals, support preference changes, and validate the result with Tag Assistant. Review the setup again whenever you add a new analytics tool, advertising integration, or checkout feature.
The goal is not to collect the maximum amount of data at any cost. It is to measure performance responsibly while respecting visitor choices and maintaining the accuracy of your e-commerce analytics.
Official resources: Consent Mode overview and Consent Mode implementation guide.
