Restore the Google Ads click ID in Safari
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#
- Place
vd={gclid}on your Google Ads final URL suffix. Every ad click then carries the click ID twice, once asgclidand once asvd. - After Safari removes
gclid,vdusually stays, because that parameter is not one of the click IDs Safari looks for. - If the ClickPatrol tag sees
vdand nogclid, it writes_gcl_awitself, 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
gclidis on the URL. - A
vdvalue is on the URL. - No
_gcl_awcookie 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#
- In Google Ads, open Admin, then Account settings, then Tracking.
- In Final URL suffix, add
vd={gclid}. If the field already has parameters, add this one at the end with&, for exampleutm_source=google&vd={gclid}. - 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#
- Open your ClickPatrol tag.
- Check Restore GCLID for Safari/ITP (recreate _gcl_aw from the vd parameter).
- 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.
Step 3: Honor consent#
_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#
- In GTM, click Preview.
- Open your site with
?vd=TEST123added to the URL, and withoutgclid, in a browser that has no_gcl_awcookie for your site yet. - Open your browser's developer tools, go to the cookies for your domain, and look for
_gcl_aw. The value should end in.TEST123. - 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 asfbclidormsclkid, are not restored. - The suffix must be live. With no
vd={gclid}in your final URL suffix, there is nothing to restore from.
Related articles#
- Extend advertising cookie lifetime: on browsers that allow it, keep existing advertising cookies longer.
- Google Tag Manager: installing the ClickPatrol tag.
Was this article helpful?
Let us know so we can improve our documentation
Need Help?
If something isn't working or you have questions, our support team is here to help you.
Contact Support