On this page
What this issue is
li_fat_id is LinkedIn's first-party click ID. When link tracking is switched on for your account, LinkedIn can append it to the landing page URL of a click on your ad, like ?li_fat_id=abc123. It identifies that one click.
The Insight Tag can also set a first-party cookie with the same name on your domain. Not every visit gets that cookie, though. It depends on consent, on the tag loading in time and on how the visitor moves around your site. Not persisted means the value is present on the first page view but is not kept for later, so it is not there when the visitor finally submits a form or buys.
This matters most when you send conversions to LinkedIn from a server or a CRM (the Conversions API, or offline conversion uploads). Those methods use the click ID to match the conversion to the ad.
Why it costs you leads or sales
Without the click ID, LinkedIn has less to match on. Conversions you report from your CRM may be matched less often or not at all. LinkedIn campaigns then look like they bring fewer leads than they do. Budget gets moved away from channels that work, and bidding has weaker data to learn from.
It is a medium-impact issue. Your leads still arrive, but you lose the link between the lead and the ad. B2B sales cycles are long, so the click ID has to survive for weeks, from the first visit until the deal closes in the CRM.
- LinkedIn ad clickURL contains li_fat_id
- Landing pageID visible in the URL only
- Second pageNo cookie, ID dropped from the URL
- Form submitHidden field is empty
- CRM conversion uploadNothing to match to the ad
The ID is in the landing URL, but nothing saves it, so the form and CRM never receive it.
Example: illustrative numbers only. Saving the ID on landing keeps it available on later pages.
How to check if your site has it
Open a landing page with a test ID
Visit your landing page with
?li_fat_id=test123added to the URL. Use a private window and accept cookies if you have a banner.Look at the cookies
Open DevTools, then Application (Chrome) or Storage (Firefox), then Cookies. Check whether a cookie holding
test123exists on your domain.Click to another page
Go to a second page on the site, where the parameter is no longer in the URL. Check that the cookie value is still there.
Submit a test form
Fill in a form and check that the value reaches your form entry, email or CRM record.
How to fix it
The fix has three parts: read the ID from the URL, keep it in a first-party cookie, and put it into a hidden field in every form that creates a lead. Then pass it on from the CRM or server.
(function () {
var id = new URLSearchParams(window.location.search).get('li_fat_id');
if (id) {
var maxAge = 60 * 60 * 24 * 90; // 90 days
document.cookie = 'li_fat_id=' + encodeURIComponent(id) +
'; path=/; max-age=' + maxAge + '; SameSite=Lax; Secure';
}
})();(function () {
var match = document.cookie.match(/(?:^|; )li_fat_id=([^;]*)/);
if (!match) return;
var value = decodeURIComponent(match[1]);
document.querySelectorAll('input[name="li_fat_id"]').forEach(function (el) {
el.value = value;
});
})();Create a URL variable
Add a URL variable of type Query with query key
li_fat_id. Add a first-party cookie variable namedli_fat_idas well.Set the cookie with a tag
Create a Custom HTML tag with the first snippet above. Trigger it on All Pages, gated by your marketing consent signal.
Fill the form field
Add the second snippet in a Custom HTML tag that runs on pages with forms, after the form has loaded.
Add a hidden field
In your form plugin (for example Gravity Forms, WPForms or Contact Form 7), add a hidden field named
li_fat_id. Many plugins let you set the default value from a cookie or a script.Add the scripts
Add the snippets through a header and footer scripts plugin or your theme, or load them from Google Tag Manager.
Add a hidden input
In the Designer, add an Embed element inside the form with
<input type="hidden" name="li_fat_id">.Add the scripts
Paste the snippets in Project Settings, Custom Code, Footer Code, or use Google Tag Manager.
Add a hidden field
In the form or survey builder, add a Hidden field with a clear label and map it to a custom field in the contact record.
Add the scripts
Paste the snippets into the funnel or website Custom Code area, then check that the hidden field is filled on a test submission.
Add the input
Put
<input type="hidden" name="li_fat_id">in each lead form.Store it with the lead
Save the field in your database and send it with the CRM record or conversion upload.
Keep the parameter through redirects
If your landing page redirects (for example http to https or a trailing slash), make sure the query string is kept. Otherwise the ID is gone before your script runs.
Map it in your CRM
Create a custom field for the LinkedIn click ID and map the hidden form field to it.
Send it with the conversion
When you upload conversions or use LinkedIn's Conversions API, include the click ID in the user identifiers as described in LinkedIn's current documentation.
How to confirm it's fixed
- A visit with ?li_fat_id=test123 creates a cookie holding test123 on your domain.
- The cookie is still there after moving to another page.
- A test form submission has li_fat_id filled in the entry.
- The value shows in the CRM custom field.
- Landing page redirects keep the query string.
- With consent denied, the script does not set the cookie.
How to prevent it happening again
This usually breaks after a form is rebuilt, a theme change, a new redirect rule or a change to your consent banner. Add a check for the hidden field and cookie to your release checklist, and rerun the manual test above after any of those changes.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real journeys on a schedule, from the EU or the US, and checks the tracking on each step. If li_fat_id is not kept as the visitor moves through the journey, it is flagged. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. You can try it with the Free plan (1 site, 2 journeys, daily checks, no card), or run the free read-only website audit first.
Questions people ask
What is li_fat_id?
li_fat_id is LinkedIn's click ID. It can be added to the landing page URL when someone clicks your LinkedIn ad, and the Insight Tag can store it in a first-party cookie. LinkedIn uses it to match later conversions to the ad click.
Why is my li_fat_id not being saved?
Common causes are no script that stores it, a redirect that strips the query string, a consent banner that blocks the cookie, or a form without a hidden field for it. Test with ?li_fat_id=test123 and check cookies and the form entry to see where it is lost.
How do I store li_fat_id in a hidden form field?
Read the value from the URL or cookie with a short script, then set it as the value of a hidden input named li_fat_id inside each lead form. Map that field to a custom field in your CRM so it is saved with the lead.
Do I need li_fat_id for LinkedIn Conversions API?
It is one of the identifiers LinkedIn can use to match a conversion to an ad click, so sending it usually helps matching. Check LinkedIn's current documentation for the exact fields and other accepted identifiers.
How long should I keep the li_fat_id cookie?
Keep it long enough to cover your sales cycle. The example above uses 90 days. Check your privacy policy and local rules on cookie lifetimes, and make sure it is set only with consent where that is required.
Does a redirect remove li_fat_id?
It can. If a redirect drops the query string, the ID is gone before your script or tags see it. Test your landing URL with a parameter added and check that the final URL still has it.
Can FunnelGuard tell me if li_fat_id is lost?
Yes. FunnelGuard detects when li_fat_id is not persisted during a scheduled journey run and alerts you with a screenshot and a likely cause, after re-checking from a second region.