DEV Community

Cover image for How to Track Google Ads Traffic to Amazon Listings with Amazon Attribution
Yuto Tanaka
Yuto Tanaka

Posted on

How to Track Google Ads Traffic to Amazon Listings with Amazon Attribution

Amazon detail pages don't run your JavaScript. There's no Google Ads conversion tag you can drop onto an ASIN, and no gtag call after Add to Cart. If you send paid traffic from Google Ads to an Amazon listing, the conversion happens on a page you don't own, which is the exact problem Amazon Attribution exists to solve.

This is a wiring problem.

You need a tagged Amazon URL, a click path that doesn't mangle it, and a campaign structure that lets you join Amazon's conversion data back to Google Ads spend.

How Amazon Attribution actually measures a click

Amazon Attribution works on a link, not a pixel. You create a campaign, ad group, and creative inside Amazon Attribution, and Amazon issues a URL for the target ASIN with a maas parameter attached:

https://www.amazon.com/dp/B0C1234XYZ?maas=maas_adg_api_9876543210&ref_=aa_maas
Enter fullscreen mode Exit fullscreen mode

When a user lands on Amazon with that parameter, Amazon records a click against the matching creative. Subsequent events (detail page views, add-to-cart, purchases, units, sales) get attributed to that creative inside Amazon's attribution window. (Check the current Amazon Attribution documentation for the window length; it has historically been 14 days for clicks.)

Two implications for engineers:

  • The maas value is the entire identity of the click. Lose it and the visit becomes an unattributed organic session.
  • You never see the click on your side. Amazon doesn't call your endpoint back with a conversion, so your only join key is the campaign / ad group / creative structure you build on both platforms.

Don't hand-construct the maas ID. Copy it from the Attribution console, or generate it through the Amazon Ads API, which exposes Attribution campaign, ad group, and creative resources along with reporting.

Prerequisites you can't route around

  • An Amazon Ads account with Amazon Attribution access (sellers generally need Brand Registry; vendors get access through Vendor Central).
  • The tag and the listing must live in the same marketplace. An amazon.com tag pointing at amazon.co.uk will not attribute.
  • Google Ads auto-tagging on, if you want gclid for cross-checking click volume later.

Wire the tag into Google Ads

There are two ways to get the maas parameter onto the click.

Option A: tagged URL as the final URL. Paste the full tagged Amazon URL into the ad's final URL. It works, and it's the fastest thing to ship. The downside: you get no visibility into your own click path, and every ad carries a long parameterized URL that's easy to break when someone copies it without thinking.

Option B: tracking template plus a redirect you control. The final URL stays the clean listing URL; the tracking template points at your own endpoint, which logs the click and 302s to the tagged URL.

https://track.example.com/go/us-brand-search?campaignid={campaignid}&adgroupid={adgroupid}&creative={creative}&gclid={gclid}&lp={lpurl}
Enter fullscreen mode Exit fullscreen mode

Then a minimal handler:

import express from "express";

const app = express();

// maas tags issued by Amazon Attribution — one per creative you want to measure.
const MAAS_BY_KEY = {
  "us-brand-search": "maas_adg_api_9876543210",
};

app.get("/go/:key", (req, res) => {
  const maas = MAAS_BY_KEY[req.params.key];
  const lpurl = req.query.lp;

  if (!maas || typeof lpurl !== "string") return res.sendStatus(400);

  // Do not turn this into an open redirect.
  const target = new URL(lpurl);
  if (target.hostname !== "www.amazon.com") return res.sendStatus(400);

  // Express already decoded the query value; searchParams.set() re-encodes once.
  target.searchParams.set("maas", maas);
  target.searchParams.set("ref_", "aa_maas");

  console.log(JSON.stringify({
    key: req.params.key,
    gclid: req.query.gclid,
    campaignId: req.query.campaignid,
    ts: Date.now(),
  }));

  res.redirect(302, target.toString());
});

app.listen(3000);
Enter fullscreen mode Exit fullscreen mode

Rules that matter here:

  • Use 302, not 301. A permanent redirect gets cached by the browser and you lose clicks you can't see.
  • Keep the chain to one hop. Every extra redirect adds latency before the Amazon page starts loading, and each hop is another chance for a proxy to strip unknown query parameters.
  • {lpurl} arrives percent-encoded as a parameter value, and Express decodes it for you. Don't call decodeURIComponent a second time. A double decode corrupts any % sequence in the original URL and can produce a mangled query string.
  • If you're appending the tag by hand and the destination already has a query string, use &, not ?. A second ? silently truncates everything after it.

Use campaign structure as your join key

Amazon Attribution reports break down by campaign → ad group → creative. Google Ads reports break down by campaign → ad group → ad. Mirror them one-to-one and the join becomes trivial:

Google Ads Amazon Attribution
Campaign Campaign
Ad group Ad group
Ad Creative

Give each level a stable, machine-readable name (such as gads-us-brand-exact or gads-us-brand-exact-b0c1234xyz) rather than "Test 2" and "Test 2 copy". You'll be joining CSVs in a script or a spreadsheet, and descriptive names are the difference between a five-minute join and an afternoon of guessing which row is which.

Validate before you scale

  1. Click your ad (or hit the tracking URL directly) in a normal browser with DevTools open, and confirm the redirect chain ends on Amazon with maas intact.
  2. Check the Attribution console for the click within a few hours. Clicks usually land faster than conversions.
  3. Cross-check Google Ads click counts against Amazon Attribution clicks after a day. They will not match exactly: Google filters invalid traffic, Amazon filters too, and some users never finish the redirect. Large gaps point at a broken tag; small gaps are normal noise.

Failure modes worth knowing

  • A tag can be stripped by an intermediary. URL shorteners, link cleaners, and some ad platforms drop parameters they don't recognise. Test every hop you introduce.
  • Amazon may route a click to a different ASIN than the one you tagged for size or colour variants. Attribution still works, but your expected-ASIN report won't line up.
  • Amazon's app-link handling can open the listing inside the app. Parameter behaviour there isn't under your control, so judge mobile performance by reported numbers rather than by a desktop click test.
  • Ad blockers and privacy extensions can block long parameterized redirect chains more often than a plain Amazon link.
  • Wrong marketplace: covered above, and still the most common cause of "no data at all".

Joining spend to conversions

Pull the Amazon Attribution report on a schedule (console export or Ads API), pull spend and clicks from the Google Ads API or a scheduled report, and join on date plus campaign name. The numbers you actually want are cost per detail page view, cost per purchase, and ROAS by campaign. Google Ads can never produce those figures for an Amazon destination because the conversion simply isn't visible to it.

One note on link length

If a tagged Amazon URL needs to live somewhere a 150-character parameterized link is awkward, such as a QR code on packaging, a slide, or a bio link, shorten the full tagged URL rather than the plain listing, then verify the maas parameter survives the redirect before you print or ship anything. LinkBit is one option for that.

The discipline stays the same regardless of tooling: one tag per ad, a click path you control, a naming scheme that survives a CSV join, and a click test after every change to the chain.

Top comments (0)