Restore the Google Ads click ID in Safari

In Google Ads · Updated

Google Ads links a conversion to an ad click through the Google Click ID, gclid. That ID arrives in the landing page URL, and the Google tag writes it to a first-party cookie called _gcl_aw. Safari can take known click IDs, such as gclid, out of the URL, for example in Private Browsing. No cookie is written then, and a later conversion from that visitor cannot be tied to the click.

On the ClickPatrol tag, an optional setting restores this cookie from a second copy of the click ID, sent in a parameter called vd. The setting is off by default.

How this works#

  1. Place vd={gclid} on your Google Ads final URL suffix. Every ad click then carries the click ID twice, once as gclid and once as vd.
  2. After Safari removes gclid, vd usually stays, because that parameter is not one of the click IDs Safari looks for.
  3. If the ClickPatrol tag sees vd and no gclid, it writes _gcl_aw itself, in the same format the Google tag uses, with a lifetime of 90 days.

The tag does this only when all three of these are true:

  • No gclid is on the URL.
  • A vd value is on the URL.
  • No _gcl_aw cookie is there yet. An existing cookie is never overwritten.

Your Google Ads conversion tag reads _gcl_aw, so the conversion is attributed to the click again. The same cookie is what ClickPatrol conversion tracking reads when it matches a conversion to a click.

Step 1: Add vd to the final URL suffix#

  1. In Google Ads, open Admin, then Account settings, then Tracking.
  2. In Final URL suffix, add vd={gclid}. If the field already has parameters, add this one at the end with &, for example utm_source=google&vd={gclid}.
  3. Save.

A final URL suffix set on a campaign, ad group, or ad overrides the account suffix. If you use those, add vd={gclid} there too. The suffix does not change your ClickPatrol tracking template.

Step 2: Turn the setting on#

Google Tag Manager#

  1. Open your ClickPatrol tag.
  2. Check Restore GCLID for Safari/ITP (recreate _gcl_aw from the vd parameter).
  3. Save, then publish the container.

WordPress plugin#

The ClickPatrol WordPress plugin includes the same option. You will find it under Settings, ClickPatrol, in the optional extras. See WordPress plugin.

_gcl_aw is a Google Ads advertising cookie. Run this setting only after the visitor accepts advertising cookies (ad_storage). In GTM, open the ClickPatrol tag, then Advanced Settings, then Consent Settings, and require additional consent for ad_storage.

That consent setting applies to the whole tag. Visitors who decline advertising cookies are then not classified either. Weigh that against the attribution you gain, or leave this setting off.

Check your setup#

  1. In GTM, click Preview.
  2. Open your site with ?vd=TEST123 added to the URL, and without gclid, in a browser that has no _gcl_aw cookie for your site yet.
  3. Open your browser's developer tools, go to the cookies for your domain, and look for _gcl_aw. The value should end in .TEST123.
  4. When you are done, delete that test cookie.

Limits to keep in mind#

  • Safari still shortens the cookie. Safari limits cookies written by JavaScript to 7 days at most, and in some cases to 24 hours. Because of this, the restored cookie does not last 90 days in Safari. Conversions within that period are covered.
  • Google Ads only. This setting restores gclid. Click IDs from other networks, such as fbclid or msclkid, are not restored.
  • The suffix must be live. With no vd={gclid} in your final URL suffix, there is nothing to restore from.

Was this article helpful?

Let us know so we can improve our documentation

Thanks for your feedback!

Need Help?

If something isn't working or you have questions, our support team is here to help you.

Contact Support