Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Click IDs expiring before conversion (ITP cookie limits): fix

TRK-325Medium impactOther toolBy FunnelGuardPublished Updated
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.

How the click ID gets lost
  1. Ad clickURL carries gclid or fbclid
  2. JS cookie savedTag writes the ID with a 90-day expiry
  3. Safari shortens itITP deletes it after about 7 days
  4. Return visit and purchaseNo click ID left to send
  5. Ad platform creditSale shows as direct or unattributed

The visitor converts after the browser has already deleted the cookie.

Share of conversions that keep their click ID, by delayExample numbers
Share of conversions that keep their click ID, by delay (example)Same day: 95 %; Within 7 days: 85 %; 8-14 days: 10 %; 15-30 days: 5 %036739585105Same dayWithin 7 days8-14 days15-30 days%

Example: illustrative numbers for Safari visitors with a JavaScript-set cookie. Your own data will differ.

How to check if your site has it

Check the cookie lifetime in Safari
  1. Open your site with a test click ID

    In Safari, visit your landing page with ?gclid=test123 added to the URL.

  2. Open Web Inspector

    Enable the Develop menu in Safari Settings > Advanced, then choose Develop > Show Web Inspector > Storage > Cookies.

  3. Find the click ID cookie

    Look for _gcl_aw, _fbc or your own cookie. Note the expiry date shown.

  4. 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.

  5. 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.

Keep click IDs longer
  1. Capture the click ID on landing

    Read gclid, fbclid, ttclid and msclkid from the URL as soon as the page loads.

  2. Set a first-party cookie from your server

    Have your server or CDN send a Set-Cookie header on the landing request with a long Max-Age, Secure and SameSite=Lax.

  3. 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.

  4. 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.

  5. Respect consent

    Only store and send click IDs where your consent setup allows it.

Where to do it on your platform
  1. 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.

  2. Set the cookie server-side

    Add a small PHP function on the init hook that sets the cookie with setcookie() when gclid is in the URL (see the code below).

WordPress: set a click ID cookie from the serverphp
<?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',
    ]);
  }
});
Copy click IDs into hidden form fieldsjavascript
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

Confirmation checks
  • In Safari, visit a landing page with ?gclid=test123 and 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

Ongoing habits
  • 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.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.