GCLID affiliate tracking: keep Google's click ID alive from ad to sale

November 28, 2026 · Hoplytic team · 5 min read

The short version: this guide in 79 seconds.
Read the video transcript

How do you keep the gclid attached, from the ad all the way to the sale?

Google adds the gclid to your landing page URL. They click your affiliate button. Your tracking link stores the gclid beside its click ID, and the network only gets that ID. The sale comes back, and the tracker uploads the conversion.

The gclid sits in your page's address bar, so something has to carry it to the click.

Most robust: store the gclid in your site's browser storage when the visitor lands. Then add it to tracked links on any page they click. A script that appends it on page load works for the first page only.

Don't put the gclid in the sub-ID. Networks cut long values, and a cut gclid matches nothing.

Gclids get lost when auto-tagging is off, or a redirect drops the query string. Test the chain with a fake gclid in a redirect checker. Keep it at least ninety days, and never edit it.

Hoplytic stores the gclid, gbraid and wbraid with every click. The site script keeps them seven days and adds them to tracked clicks. The Google Ads feed lists gclid sales from the last ninety days. gbraid and wbraid clicks are stored but not in it.

The full guide is right below. Hoplytic: ad tracking made simple.

Key points

Every Google Ads click carries a click ID, the gclid, and it is the only key Google accepts for crediting an affiliate sale to the keyword that earned it. The hard part isn't uploading the sale. It's keeping that ID attached to the visitor all the way from the ad, through your page, to the network's sale report.

Short answer: keep auto-tagging on, capture the gclid on your landing page, carry it to the moment the visitor clicks your affiliate link, and store it in your tracker next to your own short click ID. Send only your click ID to the network as the sub-ID. When the sale comes back, the tracker looks up the gclid and uploads the conversion to Google.

Uploading is covered in Google Ads offline conversion import, and the tracking template in Google Ads click tracker. This guide is about the gclid's journey.

The journey of one gclid

  1. Someone searches "best vpn for travel" and clicks your ad.
  2. Google adds gclid=Cj0KCQiA4ab... to your landing page URL: https://yoursite.com/best-vpn?gclid=Cj0KCQiA4ab....
  3. The visitor reads your page for three minutes and clicks the button for one VPN.
  4. That button goes to your tracking link, which records the click with ID c7f3a9e1, stores the gclid next to it, and redirects to the network with c7f3a9e1 in the sub-ID.
  5. Two days later the network reports a $32 commission with sub-ID c7f3a9e1.
  6. The tracker finds the gclid for c7f3a9e1 and adds the sale to the upload for Google.

Step 4 is where most setups break. The gclid sits in the address bar of your landing page. Your affiliate button doesn't have it, unless something puts it there.

Getting the gclid from the page to the affiliate click

Three ways, from least to most robust:

Why not put the gclid in the network's sub-ID?

It's tempting: the network would hand the gclid back with the sale. In practice:

A short click ID in the sub-ID, mapped to everything else in your tracker, avoids all four. See click ID tracking.

Where gclids get lost

CauseHow to check
Auto-tagging offGoogle Ads account settings. Without it there is no gclid at all.
A redirect that drops the query string (http to https, www to non-www, an old URL)Run your final URL with ?gclid=test123 through the redirect checker and see if it survives every hop.
A link shortener or cloaking plugin between the page and the trackerClick the button with a test gclid and look at the tracker's stored click.
A cached page with links baked inClear the cache and test in a private window.
A form or quiz step that reloads the page without parametersWalk through the funnel with a test gclid.
Clicks from organic search, not adsNormal. These sales can't be uploaded.

gbraid and wbraid

On some iOS traffic, Google sends gbraid (for app conversions) or wbraid (for web conversions) instead of a gclid. What that means for you:

If you upload through an API, note that Google announced that offline conversion imports would move from the Google Ads API to its Data Manager API starting June 15, 2026. Check Google's documentation for which one your account should use now. Scheduled file uploads are not affected by this.

Keep it, match it, measure it

Related: gclid, fbclid and ttclid compared.

Doing it in Hoplytic

A Hoplytic tracking link stores the gclid, gbraid and wbraid with every click it receives. When Google traffic lands on your own page first, the site script keeps those values in your site's browser storage for 7 days and adds them to the click when the visitor uses a tracked link, while the network only gets Hoplytic's click ID in its sub-ID. Under Send back, the Google Ads feed lists sales from the last 90 days whose click carried a gclid, ready for a daily scheduled upload; clicks with only gbraid or wbraid are stored but not included in that feed.

Choose the ad platform, then when to send each sale and its value.

Questions people ask

Can I put the gclid in my affiliate network's sub-ID?

You can, but it often fails: gclids are long and many networks cut or reject long sub-ID values. Store the gclid in your tracker and send a short click ID of your own to the network, then look the gclid up when the sale comes back.

Why is the gclid missing from my landing page?

Auto-tagging may be off, a redirect or shortener may drop the query string, or the visitor came from an organic result rather than an ad. Click a live ad and check the address bar for gclid=.

What are gbraid and wbraid?

They are Google click identifiers used on some iOS traffic in place of a gclid: gbraid for app conversions and wbraid for web conversions. Google's API takes exactly one identifier per conversion, a gclid, a gbraid or a wbraid.

How long is a gclid useful for affiliate tracking?

Google accepts offline conversion imports within 90 days of the click. Keep the gclid with the click at least that long, and longer if your network approves sales late.

More in Conversion tracking

Also: tracking glossary · ad platform macros · Markdown copy