Where to Store Click IDs, and How Long They Actually Last
Cookie, local storage, or your database? Here is what survives Safari, what survives a 90 day sales cycle, and what quietly expires.

This post answers a question that decides whether your offline conversion tracking works on a 60 day sales cycle: where do you actually keep the click ID between the ad click and the closed deal?
The short answer is that the cookie is a relay baton, not a storage locker. The real home is your CRM. But the baton has to survive long enough to get there.
The three places it can live
First party cookie
Set by JavaScript on your own domain. Readable by your page, sendable into forms.
The catch is Safari. Its Intelligent Tracking Prevention caps cookies set by JavaScript at seven days, and in some cases 24 hours. Your 90 day cookie is a 7 day cookie for a large share of your visitors.
Server set first party cookie
Same cookie, set by an HTTP response header from your own domain instead of by script. Safari treats it as a genuine first party cookie and it can live far longer.
This is the single most useful upgrade available here, and it is one of the concrete reasons people run a server side container on their own subdomain. Background: extending cookie lifetime with server side tracking.
Local storage
Longer lived than a script set cookie on some browsers, and not sent to your server automatically. Fine as a secondary copy, and it is also cleared by ITP in some circumstances.
Use it as a belt and braces backup alongside a cookie, not as your only store.
Why it matters more than it sounds
Run the numbers on your own funnel. If your average time from click to closed deal is 30 days, and a third of your traffic is Safari where the cookie dies after seven, then a third of your pipeline arrives with no attribution.
You will see this as a mysterious pile of leads with empty click ID fields, skewed toward iPhone users. It is not random. It is the cookie cap.
The rule that actually saves you
Write to the CRM as early as possible.
The cookie only needs to survive from the ad click to the first form submission. That is usually minutes or days, not months. Once the value is on the lead record, cookie lifetime stops mattering entirely.
So if people browse for a while before converting, the cookie is your weak link and worth strengthening. If they submit on the first visit, you are already fine.
Let’s implement it
Capture on landing and write to a first party cookie with a 90 day expiry: one script that captures every click ID
Mirror the value into local storage as a fallback.
On form render, read the cookie first, then fall back to local storage if the cookie is gone.
Write the value into a dedicated CRM field at submission.
If a meaningful share of your traffic is Safari and your consideration period is long, move cookie setting to your server.
Do not put these in the URL
A pattern I see and would avoid: passing click IDs between pages as query parameters to survive cookie loss.
It works, and it also means your click IDs end up in analytics page paths, in referrer headers to third parties, and in any link somebody copies and shares. Keep identifiers in cookies and out of URLs.
Before you finish
Open your site in Safari, click through from an ad, and check the cookie’s expiry date in developer tools. If it says seven days, you have found your ceiling.
Segment your leads by browser and compare how many have an empty click ID field.
Confirm your form reads from the cookie and falls back to local storage.
Confirm the CRM field is long enough to hold the whole value.
FAQ
How long does a GCLID stay valid?
Ninety days for uploading a conversion against it. That is the ceiling regardless of how long you manage to store it.
What about visitors who block cookies entirely?
You lose the click ID for them. That is what Enhanced Conversions is for, since it matches on hashed customer data rather than a click identifier.
Should I store the click ID on the contact or the deal?
Both, ideally. On the contact so it survives, and copied to the deal so a second deal from the same person does not claim the first deal’s ad click.
Can I just store it in the URL of the thank you page?
You can read it there, and do not rely on it. People bookmark, refresh and share those pages, and the value ends up somewhere you did not intend.
Need this built properly?
The cookie is the weak link, and it is fixable. I set up and repair tracking for ecommerce stores and lead generation businesses, so the numbers in your ad accounts match the money in your bank account.
Have a look at what I do, or book a call and we can go through your setup together.



















