Skip to main content
Drupal Commerce → Google AdsIntegration guide

Connecting Drupal Commerce to Google Ads

Drupal Commerce is self-hosted commerce inside a CMS built for complex content, which means the store is one part of a much larger site you fully control. Google Ads knows what you spent and which click it came from, and nothing at all about what happened afterwards. The join between them succeeds or fails on one thing: whether the GCLID reaches the Drupal Commerce order before the conversion happens, because Google Ads can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Drupal Commerce to Google Ads: GCLID that survives the CDN

Capture gclid, gbraid and wbraid in JavaScript into a first-party cookie, since Varnish or CDNs may strip them, and copy them onto an order field. A scheduled job uploads orders in the agreed revenue state, under 90 days old, to an import-type action with the order number as order ID. Use adjustments for refunds.

The Drupal-specific way GCLIDs go missing sits in front of Drupal. Many Varnish and CDN setups strip marketing parameters such as gclid from the cache key, and some remove them from the request passed to the origin, so the server never sees the click ID. Check your proxy configuration, then capture gclid, gbraid and wbraid in JavaScript into a first-party cookie on landing, and copy it into an order field when the checkout session begins, where it no longer depends on what the cache served.

Because you own the database, an offline import is straightforward: a scheduled job reads orders that reached the state you agreed counts as revenue, with a GCLID present and a click under 90 days old, and uploads them through the Google Ads API to an import-type conversion action. Use the order number as the order ID. Orders sitting in draft or awaiting manual validation should not upload until they move on, which is exactly why the order-state agreement has to come first.

If you also run the Google Ads tag on the checkout complete step, it is a second conversion action counting the same orders. Keep one primary. Refunds and cancellations become conversion adjustments keyed on that same order number, and enhanced conversions can use the order email where the GCLID never arrived.

Drupal Commerce → Google Ads · what breaks

Why this join usually fails — Drupal Commerce → Google Ads

  1. 01

    The GCLID never reaches Drupal Commerce

    Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.

  2. 02

    Configurable workflow states nobody agreed on

    Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.

  3. 03

    The conversion action is the wrong type

    Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.

  4. 04

    Nothing reconciles afterwards

    Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.

Drupal Commerce → Google Ads · the fix

What working looks like — Drupal Commerce → Google Ads

  • The GCLID on every order

  • Conversions arriving in Google Ads

    Conversions appear against the campaign, ad group and keyword that produced the click, with the value you sent — which is what lets Smart Bidding optimize toward revenue instead of toward form fills.

  • Reconciled against the source

Drupal Commerce → Google Ads · architecture

How Drupal Commerce and Google Ads actually connect

  1. 1

    Drupal Commerce holds the truth

    You own the database, so the truth is exactly as good as the query. Pin down which order states count as revenue before comparing anything — Drupal's workflow states are configurable per install, so no two sites agree by default.

  2. 2

    Google Ads needs a click to match

    Google Ads matches an uploaded conversion back to a click using the GCLID. The conversion action must be created as an import type — an upload against a website-tag conversion action is rejected. Uploads must also land inside Google's window: the click has to be within the last 90 days.

  3. 3

    The identifier is the bridge

    The GCLID, captured at the visit and carried into the Drupal Commerce order.

  4. 4

    The event source decides reliability

    Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.

  5. 5

    Deduplication at the destination

    Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.

Drupal Commerce → Google Ads · normal or broken

Working vs. broken, side by side — Drupal Commerce → Google Ads

Normal, not a fault

  • The GCLID present on the order

  • Sent from the Drupal Commerce order placement hook

  • Deduplicated correctly

    Google deduplicates on the combination of GCLID, conversion action and conversion time. Uploading the same click twice against the same action at the same timestamp is rejected rather than double-counted, but uploading it against a second conversion action counts twice — which is how most double-counting here actually happens.

  • Reconciles with the source

Actually broken

  • The GCLID missing on most records

    Drupal's internal page cache and any reverse proxy in front of it serve stored renders, so anything relying on dynamically rendered values fails intermittently. Multilingual and multi-site installs add further paths where the capture code may simply not run.

  • Sent from the browser

    Drupal Commerce lets each install define its own order states. Two people reporting on the same store routinely count different states and never reconcile.

  • Counted twice, or not at all

    Uploads against a standard website conversion action fail. The action has to be created as 'Import' — and existing actions cannot be converted, so this is discovered late and requires starting a new action with no history.

  • Nobody has reconciled it

Drupal Commerce → Google Ads · diagnose

Diagnostic order — Drupal Commerce → Google Ads

  1. 01

    Count orders carrying the GCLID

  2. 02

    Follow one real conversion end to end

  3. 03

    List the order states in use and agree which count as revenue

    Do this before any technical work — it resolves more Drupal Commerce disputes than any code change.

  4. 04

    Check the conversion action type and the upload diagnostics

    In Google Ads, Goals → Conversions → Uploads shows every upload with its error rows. Read the errors rather than the success count; a file can import successfully with most rows rejected.

  5. 05

    Read the match rate, not the success message

    Google Ads reports uploads in Goals → Conversions → Uploads, with rows accepted and rows failed. A green result means the file parsed, not that the clicks matched. The number to watch is how many conversions actually appear against campaigns afterwards.

Drupal Commerce → Google Ads · prove

How it gets proven — Drupal Commerce → Google Ads

Source of truth

Drupal's commerce_order records in your own database, filtered to completed states.

  • The GCLID confirmed present on a live order.
  • The Uploads diagnostics read row by row, with the accepted count reconciled against conversions appearing in campaign reporting.
  • Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.

Drupal Commerce → Google Ads · free audit

What we check in the free audit

  • Count orders carrying the GCLID
  • Follow one real conversion end to end
  • List the order states in use and agree which count as revenue
  • Check the conversion action type and the upload diagnostics
  • Read the match rate, not the success message

Checked against

Drupal's commerce_order records in your own database, filtered to completed states.

Get my free conversion tracking audit

Free30 minutesNo obligation

Drupal Commerce → Google Ads · when not to buy

When you don't need this — Drupal Commerce → Google Ads

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the GCLID.
  • If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
  • If your sales close inside a few days and your website tag already reports accurately, you may not need offline import at all. It exists to solve the delay between click and revenue.

Drupal Commerce → Google Ads · what we deliver

What gets built — Drupal Commerce → Google Ads

  • Identifier capture into Drupal Commerce

    Capture the identifier and persist it as order field data through a hook on order placement, server-side, so it never depends on what the cache served.

  • Event source: the Drupal Commerce order placement hook

    Fire server-side from the hook rather than the checkout completion template, which is cacheable and may not execute anything.

  • Dispatch to Google Ads

    Offline Conversion Import through the Google Ads API, or a scheduled upload. Enhanced conversions for leads where GCLID coverage is poor and you have consented email addresses.

  • Reversals where they exist

    Order state transitions to refunded or cancelled are recorded and can drive reversals.

Written guarantee

95%+ tracking accuracy

Measured against Drupal's commerce_order records in your own database, filtered to completed states.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Drupal Commerce → Google Ads questions, answered

Contributed modules mostly place tags in the browser. Check whether a maintained module covers offline import for your version; most setups use a small custom job against the Google Ads API.

Free · 30 min

Get Drupal Commerce and Google Ads joined properly

Free30 minutesNo obligation