Consent Mode v2 + Server-Side Flows: Event Deduplication Patterns

6 minute read

Consent Mode v2 + Server-Side Flows Event Deduplication Patterns

Google Ads 4 (GA4) has fundamentally changed how ecommerce data is tracked. In particular, with its introduction of Consent Mode v2, ecommerce settings are now being enforced across the EU and beyond. 

With that in mind, your business must carefully balance compliance and data collection, a challenge that often lies in avoiding duplicated or missing purchase events when combining client-side and server-side tracking.

The following guide will walk you through the required ecommerce events, as well as how Consent Mode v2 interacts with server-side routing and how you can prevent duplication-related concerns.

The Core GA4 Ecommerce Event Model

To obtain meaningful data in GA4, you must correctly configure these four essential events (and their parameters):

  • View Item: Tracks product detail views
    • Required Parameters: Item ID, item name, item category, and price 
  • Add to Cart: Logs when a product is added to the cart
    • Required Parameters: Item ID, item name, quantity, price, and currency 
  • Begin Checkout: Signals the start of the checkout process
    • Required Parameters: Currency, value, and item
  • Purchase: Tracks completed transactions
    • Required Parameters: Transaction ID, currency, value, and an array of items, along with the corresponding tags 

Correctly naming these events is critical for tracking accuracy; even minor typos will prevent GA4 from recognizing an event for proper ecommerce reporting. 

Consent Mode v2 Ecommerce Behavior 

GA4 Consent Mode already determined how tags behave when a user did not grant consent, but Google has expanded controls over both ad personalization and user data through its shift to Consent Mode v2. Ecommerce developers, therefore, are now required to define defaults and updates. 

Here’s an example setup:

<script>

// Default on page load

gtag('consent', 'default', {

  'ad_storage': 'denied',

  'analytics_storage': 'granted',

  'ad_user_data': 'denied',

  'ad_personalization': 'denied',

  'wait_for_update': 500

});

// On accept

gtag('consent', 'update', {

  'ad_storage': 'granted',

  'ad_user_data': 'granted',

  'ad_personalization': 'granted'

});

</script>

With the above script acting as a guide, you can fine-tune your configuration efforts and get more out of GA4’s analytics capabilities. 

Why GA4 Consent Mode Matters

Without the proper default settings in place, you risk losing tracking for essential events. Misconfigured updates also lead to a lack of visibility into modeled conversions. Server-side flows help you mitigate blocked browser events by sending data directly to GA4 via the Measurement protocol. 

Server-Side Routing and Deduplication Rules

When implementing GA4 ecommerce with server-side GTM or the Measurement Protocol, you’ll often send the same event from both client and server. Without deduplication, however, the process can inflate revenue and transaction counts. 

A correct purchase payload via Measurement Protocol looks like the following:

{

  "client_id": "12345.67890",

  "events": [{

    "name": "purchase",

    "params": {

      "transaction_id": "T12345",

      "currency": "USD",

      "value": 99.95,

      "items": [{

        "item_id": "SKU123",

        "item_name": "Product Name",

        "price": 99.95,

        "quantity": 1

      }]

    }

  }]

}

Once you’ve set up the Measurement Protocol, follow deduplication best practices. Some of the top ones to keep in mind include always passing the same transaction ID for both client and server-side hits, ensuring item arrays are consistent in both payloads, and using GA4 filters to monitor for duplicate hits in DebugView.

Verifying Your Setup With QA

Once Consent Mode v2 and server-side flows are configured, thorough QA is non-negotiable. Luckily, the QA process can be summed up in three key steps: 

Step 1: Google Tag Assistant

Start by using Google Tag Assistant to preview a full purchase journey. You should be able to see the following events take place:

  • Product view
  • Add to cart
  • Checkout
  • Purchase

At the same time, verify that events fire with the correct names and parameters. If any of your tags aren’t firing properly, fix them before moving on. 

Step 2: GA4 DebugView

Confirm that all events are arriving in GA4 in real-time, in addition to checking for duplicate purchases or missing transaction ID values. Addressing duplicates will pave the way for more reliable and complete transaction data. 

GA4 Purchase event in Tag Assistant

Step 3: Client vs. Server Parity Check

Export a sample of your purchase logs from your ecommerce platform and compare their totals against GA4’s event counts. While you may notice a few discrepancies, the goal is to get them as low as possible, namely, at a rate of less than 2%. 

Measurable Outcomes for Consent Mode V2 Ecommerce Optimization

Upon properly setting up server-side deduplication and configuring Consent Mode v2, ecommerce businesses, such as yours, should meet the following criteria:

  • Zero duplicate purchases
  • Accurate revenue reporting
  • Consent compliance
  • No errors or missing parameters in DebugView
  • Reliable client/server parity

Dig deep into your setup during the QA process to uncover any issues before they negatively impact your analytics processes. The goal is to obtain accurate, timely data that guides your decision-making. 

Frequently Asked Questions

What Happens if I Only Send Server-Side Events?

You’ll reduce your reliance on browser content signals, but you may miss out on enhanced reporting features tied to client-side signals. A hybrid setup with deduplication is usually best for most businesses. The goal is to make your data complete and reliable so you can confidently use it to guide decision-making. 

Do I Need to Migrate Existing GTM Tags to Server Side?

Not always; start with high-value events like purchase and phase in server-side routing where accuracy is most critical. 

Will Consent Mode V2 Block All Tracking Without Consent?

GA4 can still collect aggregated, modeled conversions, but you’ll need Consent Mode v2 configured correctly for compliance and accuracy. 

Win at Consent Mode V2 Ecommerce With Net Profit Marketing 

Consent Mode v2 and server-side event flows can be complicated to set up and orchestrate. However, they are invaluable tools for any ecommerce store owner. When you define the correct event model and configure consent signals, you make your reports more accurate and compliant. 

If you’re not sure where to begin, Net Profit Marketing can help you streamline your tracking and avoid costly data gaps with our GA4 knowledge. Contact our team and book an audit today to get started.

Need help with Shopify SEO?

Get a technical review and an action plan tailored to your store.

Ready for accurate analytics?

We will deliver a clean GA4 model and a server-side tagging rollout plan.

Book a Consultation

Leave a Reply

Your email address will not be published. Required fields are marked *