On this page
What this issue is
When someone clicks an ad, the ad platform adds a click ID to the landing page URL: gclid for Google Ads, fbclid for Meta, ttclid for TikTok, msclkid for Bing. Your tags read that ID and save it in a cookie. Later, when the visitor converts, the ID is sent back so the platform can credit the right ad.
Why it costs you leads or sales
The sale still happens, but the ad platform never hears it was theirs. Reported conversions drop, cost per lead looks worse, and automated bidding learns from less data. You may cut campaigns that actually work. It matters most when the buying cycle is longer than a week: high-priced items, B2B services, quotes and bookings.
- Ad clickURL carries gclid or fbclid
- JS cookie savedTag writes the ID with a 90-day expiry
- Safari shortens itITP deletes it after about 7 days
- Return visit and purchaseNo click ID left to send
- Ad platform creditSale shows as direct or unattributed
The visitor converts after the browser has already deleted the cookie.
Example: illustrative numbers for Safari visitors with a JavaScript-set cookie. Your own data will differ.
How to check if your site has it
Open your site with a test click ID
In Safari, visit your landing page with
?gclid=test123added to the URL.Open Web Inspector
Enable the Develop menu in Safari Settings > Advanced, then choose Develop > Show Web Inspector > Storage > Cookies.
Find the click ID cookie
Look for
_gcl_aw,_fbcor your own cookie. Note the expiry date shown.Compare with the lifetime you set
Safari often shows 7 days or less for cookies written by JavaScript, even if the tag asks for 90 days.
Look for the pattern in reports
In your ad platform, compare conversion rates for Safari and Chrome. A big gap on long-cycle products points to this issue.
How to fix it
You cannot change Safari's rules. You can move the click ID out of the storage Safari limits. Cookies set by your own server in an HTTP response header (Set-Cookie) are treated differently from JavaScript cookies, though Safari can still limit them in some cases, such as when the response comes from a CNAME-cloaked or third-party IP. The most reliable approach is to also save the click ID with the lead itself.
Capture the click ID on landing
Read
gclid,fbclid,ttclidandmsclkidfrom the URL as soon as the page loads.Set a first-party cookie from your server
Have your server or CDN send a
Set-Cookieheader on the landing request with a longMax-Age,SecureandSameSite=Lax.Save the click ID in hidden form fields
Add hidden fields to lead forms and booking forms and fill them from the cookie, so the ID is stored in your CRM with the lead.
Send conversions back from your system
Use the platform's offline or server-side conversion upload (for example Google Ads offline conversion import, or Meta Conversions API) with the stored ID.
Respect consent
Only store and send click IDs where your consent setup allows it.
Add hidden fields
In your form plugin (for example Gravity Forms, WPForms or Contact Form 7 add-ons), add hidden fields and set the default value to read from the click ID cookie or URL.
Set the cookie server-side
Add a small PHP function on the
inithook that sets the cookie withsetcookie()whengclidis in the URL (see the code below).
Store the ID on the cart
Save the click ID as a cart attribute from your theme, so it travels into the order and can be exported or sent with the order.
Use server-side sending
Use the Google and Meta channel apps' server-side options where available, or send orders from your own backend.
Use a server container
If you run a server-side GTM container on your own subdomain, use its cookie settings so the click ID cookie is set from your server response.
Fill hidden fields
Create a variable that reads the URL parameter or cookie and a tag that writes it into the form's hidden field.
Add hidden inputs
Add hidden input fields to your Webflow form and fill them with a custom script from the page settings.
Forward to your CRM
Make sure the form's destination (webhook or integration) receives those fields.
Use hidden fields
Add hidden fields to the form or survey and map them to contact custom fields so the click ID stays on the contact record.
Capture in the form
Wix limits custom cookie control. Add a hidden field to your form through Velo (custom code) and save the click ID with the submission.
Use form storage
Squarespace has no server cookie control. Add a hidden field through code injection and send the value to your CRM or a connected tool.
Set the cookie in your backend
Read the parameter on the first request and send a
Set-Cookieheader from your server (see the code below).Store it with the lead
Save the click ID in your database next to the lead or order.
<?php
add_action('init', function () {
if (!empty($_GET['gclid'])) {
$value = sanitize_text_field(wp_unslash($_GET['gclid']));
setcookie('fg_gclid', $value, [
'expires' => time() + 90 * DAY_IN_SECONDS,
'path' => '/',
'secure' => true,
'httponly' => false,
'samesite' => 'Lax',
]);
}
});const params = new URLSearchParams(location.search);
const fromCookie = (n) => (document.cookie.match('(?:^|; )' + n + '=([^;]*)') || [])[1];
const gclid = params.get('gclid') || fromCookie('fg_gclid') || '';
const field = document.querySelector('input[name="gclid"]');
if (field && gclid) field.value = decodeURIComponent(gclid);How to confirm it's fixed
- In Safari, visit a landing page with
?gclid=test123and confirm your server-set cookie appears in Web Inspector. - Check the cookie's expiry is longer than 7 days (Safari may still cap it in some setups; if so, rely on the stored lead field).
- Submit a test lead and confirm the click ID appears in the CRM record.
- Upload or send a test conversion with that ID and check the platform accepts it.
- After a few weeks, compare Safari conversion counts against Chrome for the same campaigns.
How to prevent it happening again
- Always store the click ID with the lead or order, not only in a cookie.
- Recheck after theme, consent banner or tag changes.
- Keep hidden fields in every new form template.
- Review Safari vs other browser conversion rates each quarter.
- Read Apple's WebKit tracking prevention notes when Safari updates.
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. It depends on how long a real visitor's browser keeps a cookie over days or weeks, which a scheduled robot journey cannot observe. The tools that fit are your ad platforms' diagnostics, a server-side tagging setup, and a CRM that stores click IDs with each lead.
Questions people ask
Why is my gclid cookie disappearing in Safari?
Safari's Intelligent Tracking Prevention limits cookies written by JavaScript to about 7 days, and sometimes 24 hours. Even if your tag sets a 90-day expiry, Safari can delete it sooner. Store the click ID server-side or with the lead.
How long does a click ID cookie last in Safari?
Cookies written with JavaScript are capped at 7 days under ITP, and at 24 hours in some link-decoration cases. Cookies set by your own server in a response header are treated differently, though Safari can still restrict them in some setups.
How do I stop ITP from deleting my gclid?
You cannot switch ITP off, but you can avoid relying on JavaScript cookies. Set the cookie from your server, and save the gclid in a hidden form field so it is stored in your CRM with the lead.
Will Google Ads still count conversions if the gclid is lost?
Google Ads can sometimes model or recover some conversions, but a missing gclid means the sale usually cannot be tied to the exact click. Storing the gclid and using offline conversion import is the dependable route.
Does this affect Facebook fbclid and TikTok ttclid too?
Yes. Any click ID kept in a JavaScript cookie is subject to the same Safari limits. Store each one with the lead and send it back through the platform's server-side or offline conversion option.
Can FunnelGuard detect click ID cookie expiry?
No. This depends on how a real visitor's browser behaves over days, which a scheduled test journey cannot see. Use server-side tagging, CRM-stored click IDs and your ad platform reports instead.
Is it okay to store click IDs for longer than 7 days?
Generally yes for first-party data, if your privacy policy and consent settings allow it and the visitor has agreed where required. Check your legal requirements and the ad platform's terms.
Related issues
- TRK-324Click IDs not persisted to cookies when consent denied (expected) but lost after acceptFix guide
- TRK-330Attribution window mismatched between platformsFix guide
- TRK-331Conversion counted in two platforms with overlapping windowsFix guide
- TRK-329Direct traffic inflated by missing UTMs on emails/SMSFix guide
- TRK-322fbclid/gclid trigger 404 or WAF block on landing pageFix guide
- TRK-312UTMs lost when moving from landing page to form pageFix guide