Skip to main content
Drupal Commerce → Amazon AdsIntegration guide

Connecting Drupal Commerce to Amazon 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. Amazon Ads spans two entirely different situations, and most guidance discusses them as though they were one. The join between them succeeds or fails on one thing: whether a click identifier only for off-Amazon destinations reaches the Drupal Commerce order before the conversion happens, because Amazon Ads can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Drupal Commerce and Amazon Ads: DSP to your store, or nothing

Only Amazon DSP sending shoppers to your Drupal store can be measured; Amazon listing sales never reach commerce_order. Read the click identifier with a script that bypasses page cache, Varnish or CDN stripping, copy it onto an order field at placement, and send the off-Amazon conversion through a queue after confirming your DSP upload route.

A Drupal Commerce order is placed on your site, so it can only be measured against Amazon ads that sent the shopper to your site. If you also list the same products on Amazon and run Sponsored Products there, those sales live in Amazon's system, not in commerce_order, and no hook in Drupal will ever see them. Keep the two apart in reporting from day one, or someone will try to reconcile Amazon listing sales against Drupal orders.

For Amazon DSP pointed at your Drupal store, the build is a standard off-Amazon conversion with one Drupal twist. The landing page is probably served from Drupal's page cache, Varnish or a CDN, and those layers can strip or ignore query parameters before PHP runs. Read the click identifier with a small script or middleware that runs on every request, attach it to the cart, and copy it onto an order field when the place transition fires. Send the conversion from that event subscriber through a queue so a slow Amazon response never blocks checkout. Confirm in your Amazon Ads account which identifier and upload route your DSP setup supports.

If you use Amazon Attribution tags on Drupal content, such as buying guides that link to your Amazon listings, that is the reverse direction: Drupal is the traffic source and Amazon measures the sale. Useful, but no Drupal Commerce order is involved, and it needs tagged links rather than an integration.

Drupal Commerce → Amazon Ads · what breaks

Why this join usually fails — Drupal Commerce → Amazon Ads

  1. 01

    A click identifier only for off-Amazon destinations 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

    Per-order attribution promised on Amazon-completed sales

    It does not exist and cannot be built. Amazon owns the checkout and does not release the join. Any proposal offering per-order attribution on sales completing inside Amazon is describing something unavailable.

  4. 04

    Nothing reconciles afterwards

    For off-Amazon conversions, reconcile normally against your own records. For on-Amazon sales, Amazon Attribution is aggregated and delayed by construction — it cannot be reconciled per order and is not meant to be.

Drupal Commerce → Amazon Ads · the fix

What working looks like — Drupal Commerce → Amazon Ads

  • A click identifier only for off-Amazon destinations on every order

  • Conversions arriving in Amazon Ads

    Off-Amazon conversions appear against the campaign. On-Amazon sales appear in Amazon's aggregated attribution reporting, delayed.

  • Reconciled against the source

Drupal Commerce → Amazon Ads · architecture

How Drupal Commerce and Amazon 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

    Amazon Ads needs a click to match

    For off-Amazon destinations, an event with a value and the click identifier. For on-Amazon conversions, nothing — the measurement is not yours to do and Amazon Attribution provides aggregated reporting instead.

  3. 3

    The identifier is the bridge

    A click identifier only for off-Amazon destinations, 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

    Only relevant for off-Amazon conversions where both a tag and a server event exist. For on-Amazon purchases the question does not arise, because you are not measuring the conversion at all.

Drupal Commerce → Amazon Ads · normal or broken

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

Normal, not a fault

  • A click identifier only for off-Amazon destinations present on the order

  • Sent from the Drupal Commerce order placement hook

  • Deduplicated correctly

    Only relevant for off-Amazon conversions where both a tag and a server event exist. For on-Amazon purchases the question does not arise, because you are not measuring the conversion at all.

  • Reconciles with the source

Actually broken

  • A click identifier only for off-Amazon destinations 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

    It does not exist and cannot be built. Amazon owns the checkout and does not release the join. Any proposal offering per-order attribution on sales completing inside Amazon is describing something unavailable.

  • Nobody has reconciled it

Drupal Commerce → Amazon Ads · diagnose

Diagnostic order — Drupal Commerce → Amazon Ads

  1. 01

    Count orders carrying a click identifier only for off-Amazon destinations

  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

    Establish which Amazon product and which destination you are running

    On-Amazon and off-Amazon are different measurement problems, and conflating them wastes the entire engagement.

  5. 05

    Read the match rate, not the success message

    For off-Amazon conversions, reconcile normally against your own records. For on-Amazon sales, Amazon Attribution is aggregated and delayed by construction — it cannot be reconciled per order and is not meant to be.

Drupal Commerce → Amazon Ads · prove

How it gets proven — Drupal Commerce → Amazon Ads

Source of truth

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

  • A click identifier only for off-Amazon destinations confirmed present on a live order.
  • The ad product and destination confirmed in writing before any build, so the right measurement question is being answered.
  • Order field data confirmed populated on an order placed through a fully warmed cache as an anonymous visitor.

Drupal Commerce → Amazon Ads · free audit

What we check in the free audit

  • Count orders carrying a click identifier only for off-Amazon destinations
  • Follow one real conversion end to end
  • List the order states in use and agree which count as revenue
  • Establish which Amazon product and which destination you are running
  • 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 → Amazon Ads · when not to buy

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

  • Measure identifier coverage yourself first — pull your last hundred orders and count how many carry a click identifier only for off-Amazon destinations.
  • If your Drupal site is content-only with commerce elsewhere, work at the commerce system instead — this is the wrong layer.
  • If all your Amazon spend drives to Amazon listings, there is no conversion tracking build here — only a reporting exercise in Amazon's own tools.

Drupal Commerce → Amazon Ads · what we deliver

What gets built — Drupal Commerce → Amazon 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 Amazon Ads

    Conversion upload for off-Amazon destinations. For on-Amazon sales, Amazon's own attribution reporting is the only view.

  • 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 → Amazon Ads questions, answered

No. Amazon Attribution measures off-Amazon traffic to Amazon product pages. Drupal orders are only measurable through an off-Amazon setup such as Amazon DSP pointed at your store.

Free · 30 min

Get Drupal Commerce and Amazon Ads joined properly

Free30 minutesNo obligation