Skip to content
Climb Google Maps: Google Business Profile optimization.

LinkedIn AdsGuide

How to Set Up the LinkedIn Conversions API, With a Script We Tested

The LinkedIn Conversions API sends conversions from your server, so LinkedIn sees the leads and sales its browser tag misses. Here is the setup in Campaign Manager as LinkedIn documents it today, a short Node.js script that sends an event, and how to avoid counting the same lead twice.

A laptop showing source code in an editor, with reading glasses resting on the keyboard

Key takeaways

  • The LinkedIn Conversions API sends conversion events from your server to LinkedIn, so leads and sales count even when the browser Insight Tag is blocked or the conversion happens offline.
  • In Campaign Manager, the setup starts under Measure > Conversion tracking, where you create a conversion, choose Conversions API, then pick Direct API or a partner such as Google Tag Manager or Zapier.
  • Each event needs a conversion rule URN, a timestamp in milliseconds from the past 90 days, and at least one user identifier, such as a SHA-256 hashed email.
  • To avoid double counting, create separate Insight Tag and Conversions API conversion rules and send the same eventId from both; LinkedIn then counts the event once, under the Insight Tag.
  • LinkedIn API version 202511 is sunset on Nov. 16, 2026, so a direct integration should send a newer LinkedIn-Version header, such as 202610.

Update (Nov. 18, 2026): The Nov. 16 sunset of API version 202511 has passed, so an integration still sending LinkedIn-Version: 202511 needs a newer header now. LinkedIn's versioning page now lists 202611 (November 2026) as the latest version. The script below sends 202610, which LinkedIn still supports; LinkedIn says each version stays supported for at least one year before it is sunset.

The LinkedIn Conversions API lets your server tell LinkedIn when a lead or sale happens, instead of relying only on the Insight Tag in the visitor's browser. That matters for B2B advertisers because the conversions they care most about, a qualified lead in the CRM or a closed deal, often happen days later and nowhere near a browser.

This guide follows LinkedIn's help center and API documentation as of Nov. 10, 2026. We wrote a short Node.js script that builds and sends a conversion event, and ran it against LinkedIn's live endpoint to confirm the request format. Every menu path below comes from LinkedIn's own help pages, linked at the end.

What you need before you start

  • A LinkedIn Campaign Manager ad account, and a role on it other than Viewer. LinkedIn's API documentation lists Account Billing Admin, Account Manager, Campaign Manager and Creative Manager as roles that can send events.
  • A place where conversions are recorded with an email address or LinkedIn's click ID: your CRM, form handler or order system.
  • A choice between Direct API (your developer sends events from your server, with ongoing upkeep) and a partner integration. LinkedIn's help page lists Adobe, Dreamdata, Factors.ai, Funnel, Google Tag Manager, Hightouch, HubSpot, Make, Salesforce Data 360, Segment, Supermetrics, Tealium, Zapier and Zoho Recruit. LinkedIn describes a partner connection as usually a one-time setup.

If you already use one of those partners to move leads around, start there. The rest of this guide covers Direct API, which is what the partners do for you behind the scenes.

Step 1: Create a Conversions API conversion in Campaign Manager

From LinkedIn's help page for Direct API setup:

  1. In Campaign Manager, go to Measure > Conversion tracking and click Create conversion. Choose Conversions API as the source.
  2. Name the rule (only you see the name), choose a category such as Lead, and choose a value: the same value for every conversion, a dynamic value sent with each event, or no value. LinkedIn advises against no value. Enter a default value, choose the click and view time frames, and choose an attribution model. Click Next step.
  3. Select Direct API and click Next step.
  4. Review the ad sets LinkedIn selected for you (it picks active, draft and paused ones that fit the category) and click Create. LinkedIn only tracks a conversion for the ad sets it is attached to.

For time frames, LinkedIn's best practices page says the Campaign Manager default of 90-day click and 90-day view suits most conversions. Lead, Qualified Lead, Purchase and a few other categories also allow 180 or 365 days, which fits long B2B sales cycles.

You will need the conversion's ID. LinkedIn's API schema says it is the number after /conversions/ in the Campaign Manager URL when you edit the rule.

Step 2: Generate an access token

LinkedIn's help page puts this under Measure > Signals manager > Direct API > Generate access token. LinkedIn doesn't store the token after it shows it to you, so save it in your password manager or secrets store right away. Treat it like a password: anyone with it can send conversions to your account.

Step 3: Send events from your server

Each event goes to POST https://api.linkedin.com/rest/conversionEvents. LinkedIn's API documentation sets these rules:

  • Headers: Authorization: Bearer <token>, LinkedIn-Version in YYYYMM form, and X-Restli-Protocol-Version: 2.0.0.
  • conversion: the rule as urn:lla:llaPartnerConversion:<id>.
  • conversionHappenedAt: milliseconds since 1970, and within the past 90 days, or the event is rejected.
  • user.userIds: at least one identifier. A SHA256_EMAIL must be lowercased, stripped of whitespace, then SHA-256 hashed as hex. LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID is LinkedIn's click ID. IP addresses and other IDs are also accepted.
  • eventId: optional, and the key to deduplication (below).
  • Success is a 201 Created response. A batch request can carry up to 5,000 events, and LinkedIn limits a token to 600 requests a minute and 500,000 a day.

One date to watch: LinkedIn's documentation says API version 202511 is sunset on Nov. 16, 2026. If an integration was built a year ago and still sends LinkedIn-Version: 202511, update it this week. The current version in LinkedIn's documentation is 202610.

Here is the script. It needs Node.js 18 or later and no packages:

// Send one conversion to the LinkedIn Conversions API.
// Node 18+, no packages. Set LINKEDIN_TOKEN and LINKEDIN_CONVERSION_ID.
// Without a token it prints the request instead of sending it.
import { createHash } from 'node:crypto';
 
const API = 'https://api.linkedin.com/rest/conversionEvents';
const VERSION = '202610'; // LinkedIn-Version header, YYYYMM
const NINETY_DAYS = 90 * 24 * 60 * 60 * 1000;
 
// LinkedIn: lowercase, no whitespace, SHA-256, hex.
export const hashEmail = (email) =>
  createHash('sha256').update(email.toLowerCase().replace(/\s+/g, '')).digest('hex');
 
export function buildEvent({ conversionId, email, liFatId, happenedAt, value, currency = 'USD', eventId }) {
  if (Date.now() - happenedAt > NINETY_DAYS) throw new Error('conversion is older than 90 days; LinkedIn will reject it');
  const userIds = [];
  if (email) userIds.push({ idType: 'SHA256_EMAIL', idValue: hashEmail(email) });
  if (liFatId) userIds.push({ idType: 'LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID', idValue: liFatId });
  if (!userIds.length) throw new Error('need an email or an li_fat_id to match the conversion');
  const event = {
    conversion: `urn:lla:llaPartnerConversion:${conversionId}`,
    conversionHappenedAt: happenedAt, // milliseconds since epoch
    user: { userIds },
  };
  if (value != null) event.conversionValue = { currencyCode: currency, amount: String(value) };
  if (eventId) event.eventId = eventId; // same ID as the Insight Tag event, for deduplication
  return event;
}
 
export async function send(event, token = process.env.LINKEDIN_TOKEN) {
  const headers = {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
    'LinkedIn-Version': VERSION,
    'X-Restli-Protocol-Version': '2.0.0',
  };
  if (!token) {
    console.log('No LINKEDIN_TOKEN set. Would send:\nPOST', API);
    console.log(JSON.stringify(event, null, 2));
    return null;
  }
  const res = await fetch(API, { method: 'POST', headers, body: JSON.stringify(event) });
  if (res.status !== 201) throw new Error(`LinkedIn answered ${res.status}: ${await res.text()}`);
  return res.status;
}
 
// Example: a lead form submitted five minutes ago.
if (import.meta.url === `file://${process.argv[1]}`) {
  const event = buildEvent({
    conversionId: process.env.LINKEDIN_CONVERSION_ID || '123',
    email: ' [email protected] ',
    liFatId: process.env.LI_FAT_ID, // from the li_fat_id URL parameter, if you stored it
    happenedAt: Date.now() - 5 * 60 * 1000,
    value: 50,
    eventId: 'lead-000123',
  });
  console.log('status', await send(event));
}

Save it as linkedin-capi.mjs and run node linkedin-capi.mjs. In your own code, import buildEvent and send and call them from wherever a lead or order is saved.

What we tested

We ran the script on Nov. 10, 2026, three ways:

  • Without a token, it printed the request. The email ' [email protected] ' hashed to the same value as [email protected] hashed with the standard sha256sum tool, which confirms the lowercase and trim step works.
  • With a timestamp 91 days old, or with no email or click ID, it stopped before sending, matching the rules LinkedIn's API rejects with a 400 error.
  • With a dummy token against LinkedIn's live endpoint, LinkedIn answered 401 with the code INVALID_ACCESS_TOKEN. That confirms the URL and headers reach the right API. We don't have a LinkedIn ad account connected to this site, so we have not sent a real conversion, and you should watch your first events arrive (Step 5).

How do I stop LinkedIn counting a conversion twice?

If you keep the Insight Tag and add the Conversions API, which LinkedIn recommends for reliability, the same lead can arrive twice. LinkedIn's deduplication documentation says to:

  1. Create two conversion rules, one for the Insight Tag and one for the Conversions API, both attached to the same ad sets.
  2. Send the same eventId from both. On the page, pass it in the tag call, for example window.lintrk('track', { conversion_id: 12345, event_id: 'lead-000123' }). On the server, send it as eventId.

When LinkedIn gets both with the same eventId from the same account, it keeps the Insight Tag event and drops the server one. In reports, the Insight Tag conversion should therefore show the higher count. If the two counts look the same, deduplication probably isn't matching.

The simplest way to get a shared ID is to create it when the form is submitted, put it in the tag call, and save it with the lead so your server sends the same value.

How do I get LinkedIn's click ID?

The click ID gives LinkedIn a second way to match a conversion besides the email. LinkedIn's help center says to turn on Enable enhanced conversion tracking: go to Measure > Signals manager > Insight Tag, open the Manage Insight Tag menu, choose Settings, tick the box and save. LinkedIn then adds a click ID to your landing page URLs. LinkedIn's API documentation names it li_fat_id. Store it with the lead when the form is submitted, and send it as LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID. LinkedIn's documentation recommends sending both the hashed email and the click ID for the best match rate.

Why does my conversion say Unverified?

After setup, check the Status column on the Conversion tracking page. LinkedIn's help page says Unverified means the connection or event delivery needs review, and that the status can take time to update depending on how often the conversion happens. A rule for a conversion that happens a few times a week may stay Unverified for days even when it works. If it doesn't change, check the response codes your server logs: anything other than 201 comes with an error message that names the field at fault.

What we don't know

  • How long LinkedIn's access tokens from Signals manager last. The help page doesn't say, so plan to replace yours if events start failing with 401.
  • What match rate to expect. LinkedIn doesn't publish one, and it depends on whether your leads use the email on their LinkedIn account. A work email may not be the one a person uses to sign in to LinkedIn, which is why the click ID helps.

Sources

Photo of Kiran Dasgupta

About the author

Kiran Dasgupta, Editor

Kiran runs Kihan Marketing, a web design, SEO and ads agency, and manages dozens of websites across real estate, home services and healthcare. He writes about SEO, AI search and paid ads news, and what it means for the people who run websites.