Skip to main content
GUIDE · LINKEDIN CAPI11 min read

LinkedIn Conversions API for B2B attribution

A production setup guide for B2B teams that need LinkedIn to see more than a browser form submit: server-side lead events, CRM lifecycle changes, opportunity value, account-level context, durable identifiers, Campaign Manager validation, and the troubleshooting checks that protect pipeline reporting.

Guide section

Why B2B needs LinkedIn CAPI

B2B attribution breaks differently from consumer ecommerce. A buyer might click a LinkedIn ad on a phone, read the page from a laptop, ask a colleague to evaluate the product, book a demo from a work calendar, and become an opportunity weeks later inside a CRM. The browser event that started the journey is useful, but it rarely represents the business outcome sales and finance care about. LinkedIn Conversions API gives your server, CRM, or tracking layer a direct way to send those later events back to the conversion rule that campaigns optimize against.

This matters because LinkedIn campaigns are often judged on lead quality, target-account penetration, pipeline created, and meetings with the right buying committee, not only raw form volume. A pixel-only setup can miss blocked scripts, delayed consent banners, cross-device journeys, CRM qualification, and long sales-cycle updates. CAPI does not solve weak strategy, but it does let you report cleaner evidence: who converted, when the lifecycle step happened, which account it belonged to, and what value the business assigned to it.

Guide section

Prerequisites

LinkedIn Business Manager access with permission to manage the ad account, Campaign Manager assets, matched audiences, and conversion tracking.

A conversion rule already created in Campaign Manager with the event type, attribution window, and campaign association you plan to optimize against.

An access token from the LinkedIn Marketing Developer Platform with the required ads and conversion permissions for the advertiser account.

The current LinkedIn-Version header chosen and pinned in your integration so API behavior does not drift unexpectedly between releases.

A verified domain for the B2B site or landing pages that generate the form submits, demos, trials, meetings, and pipeline events.

Guide section

Step-by-step setup

Build the integration in narrow layers. Prove the endpoint and headers, then add the required fields, then add normalized identifiers, then connect CRM events and logging. That sequence keeps every failed request tied to one clear change.

Step 01

Resolve the advertiser and conversion rule

Start by identifying the sponsored account URN and the exact conversion rule that should receive server events. Do not use a sandbox rule for production tests. The conversion rule controls reporting, attribution windows, and campaign optimization, so the server payload must point to the same business object that media teams inspect in Campaign Manager.

POST https://api.linkedin.com/rest/conversionEvents
Authorization: Bearer LINKEDIN_ACCESS_TOKEN
LinkedIn-Version: 202601
X-Restli-Protocol-Version: 2.0.0
Content-Type: application/json

{
  "conversion": "urn:li:sponsoredConversion:123456",
  "conversionHappenedAt": 1776943226000
}
Step 02

Send required event fields first

The first accepted event should be intentionally plain: conversion rule, event timestamp, event ID, value when relevant, and user identifiers. Get this minimal payload accepted before adding CRM enrichment. A small known-good request proves token scope, header format, conversion ownership, timestamp units, and destination routing.

{
  "conversion": "urn:li:sponsoredConversion:123456",
  "conversionHappenedAt": 1776943226000,
  "eventId": "demo_98172_booked",
  "value": {
    "amount": "2500.00",
    "currencyCode": "USD"
  },
  "user": {
    "userIds": [
      {
        "idType": "SHA256_EMAIL",
        "idValue": "0d741ab04ce9..."
      }
    ],
    "userInfo": {
      "firstName": "f52fbd32b2b3...",
      "lastName": "a94a8fe5ccb...",
      "companyName": "acme software"
    }
  }
}
Step 03

Normalize identifiers before hashing

LinkedIn accepts hashed identifiers only when the input was normalized consistently before hashing. Lowercase and trim emails, remove decorative phone formatting, keep country codes predictable, and avoid hashing placeholders such as unknown, test, or a shared sales inbox. Bad hashes are worse than missing fields because they look complete in logs while never matching real members.

import crypto from "node:crypto";

function sha256(value: string) {
  return crypto
    .createHash("sha256")
    .update(value.trim().toLowerCase())
    .digest("hex");
}

const userIds = [
  { idType: "SHA256_EMAIL", idValue: sha256("buyer@example.com") },
  { idType: "SHA256_PHONE_NUMBER", idValue: sha256("+14155550123") }
];
Step 04

Forward B2B event context

B2B attribution improves when server events represent the buying journey instead of only the website click. Attach lead source, form type, account domain, lifecycle stage, opportunity amount, and CRM object IDs in your own event logs. Send only the fields LinkedIn supports to the API, but keep the richer envelope internally so every accepted or rejected event can be traced back to CRM truth.

{
  "conversion": "urn:li:sponsoredConversion:123456",
  "conversionHappenedAt": 1776944209000,
  "eventId": "opp_44381_sql",
  "value": {
    "amount": "18000.00",
    "currencyCode": "USD"
  },
  "user": {
    "userIds": [
      { "idType": "SHA256_EMAIL", "idValue": "0d741ab04ce9..." }
    ],
    "userInfo": {
      "firstName": "b6d767d2f8ed...",
      "lastName": "3e23e8160039...",
      "companyName": "acme software"
    }
  }
}
Step 05

Batch carefully and log every response

Treat LinkedIn CAPI like revenue infrastructure. Use stable event IDs, retry only transient failures, and log request ID, conversion rule, account, identifiers present, consent state, and API response. B2B volume is often lower than ecommerce volume, so one day of rejected demo or opportunity events can materially distort pipeline reporting.

POST /rest/conversionEvents
Authorization: Bearer LINKEDIN_ACCESS_TOKEN
LinkedIn-Version: 202601
X-Restli-Protocol-Version: 2.0.0
Content-Type: application/json

{
  "conversion": "urn:li:sponsoredConversion:123456",
  "conversionHappenedAt": 1776944209000,
  "eventId": "lead_77821_submit",
  "user": {
    "userIds": [
      { "idType": "SHA256_EMAIL", "idValue": "0d741ab04ce9..." }
    ]
  }
}
Guide section

Matching hierarchy

Match rate estimates vary by region, consent rate, job seniority, work email quality, and how often buyers use personal identities while researching business software. Treat the table as a prioritization model rather than a universal benchmark.

SignalEstimated match rateBest use
Hashed email45 to 70%Best default for form fills, trials, demo requests, webinar signups, and known CRM contacts.
LinkedIn user ID60 to 85%Very strong when captured through LinkedIn-native flows or an authenticated integration that legitimately has the member ID.
Hashed phone25 to 45%Useful for sales-qualified leads and meeting bookings where phone is normalized with country code.
First/last + company10 to 30%A fallback for business identity when email or phone is unavailable, strongest with uncommon names and precise company names.
Guide section

Account-level attribution for ABM

Account-based marketing needs a wider lens than person-level conversion counting. One LinkedIn member might research the product, another might attend the webinar, and a third might book the meeting. If those events are treated as unrelated people, the campaign can look weak even while the target account is moving forward. Your server-side event envelope should therefore keep account domain, CRM account ID, company name, lifecycle stage, opportunity ID, and campaign membership alongside the LinkedIn payload.

LinkedIn CAPI should receive only supported, policy-compliant fields, but your own logs can preserve the account graph that explains the journey. That lets media, demand generation, sales operations, and revenue operations reconcile LinkedIn reporting with Salesforce, HubSpot, or a warehouse model. For ABM, the practical win is not just more conversions. It is the ability to see whether paid LinkedIn activity is creating qualified movement inside named accounts.

Guide section

Testing with Campaign Manager

Campaign Manager validation should happen before the first live campaign depends on server events. Test a realistic B2B journey, including form submit and CRM stage changes, because many CAPI issues appear only after the browser event hands off to marketing automation or sales operations.

1

Send a controlled test conversion

Use a real conversion rule, a known test lead, and one event ID. Confirm that the request is accepted by the API before checking reporting screens. Rejected events will not become visible later.

2

Check Campaign Manager diagnostics

Open the conversion rule and inspect recent activity, match status, and warnings. The event should map to the expected rule and account without token, permission, or malformed identifier errors.

3

Compare against CRM timestamps

Verify that conversionHappenedAt reflects the actual form submit, meeting booked, MQL, SQL, or opportunity moment. B2B events sent with import time instead of lifecycle time can land outside the intended attribution window.

Guide section

Long attribution windows

LinkedIn attribution windows can extend up to 90 days, which is unusually important for B2B. A buyer who clicked an ad in January may not become a sales-qualified opportunity until March. If your server event uses the lifecycle timestamp and lands inside the configured window, LinkedIn has a better chance of connecting campaign exposure to the business result. If your integration sends only the import timestamp, the event can look artificially late and fall outside the period the campaign should receive credit for.

The operational rule is simple: preserve the moment the buyer actually performed the relevant action. For demo requests, use the submit or booking time. For MQL and SQL, use the CRM stage-change time. For opportunities, use the created date or accepted sales date agreed by revenue operations. Long windows are valuable only when timestamps are honest and event IDs stay stable through retries.

Guide section

Troubleshooting

Most LinkedIn CAPI failures are integration contract problems: wrong account, wrong rule, missing permission, stale token, malformed URN, invalid timestamp, weak hashing, or duplicate sends from CRM imports and browser tags. Fix them by logging the final request body and response, not by guessing from reporting screens alone.

401 unauthorized

Refresh the access token, confirm Marketing Developer Platform permissions, and verify the token can access the sponsored account that owns the conversion rule.

403 permission denied

Check Business Manager asset access, ad account roles, app approval, and whether the conversion rule belongs to a different advertiser account.

400 invalid payload

Validate JSON shape, URN format, timestamp in milliseconds, eventId type, value amount as a string, and the exact LinkedIn-Version header.

Low match rate

Audit normalization before hashing, suppress placeholder values, add phone where consent allows, and send company name only after trimming legal suffix noise.

Duplicate conversions

Use one stable eventId per lifecycle action and prevent browser tags, CRM jobs, and warehouse replays from sending the same conversion independently.

Guide section

FAQ

Should LinkedIn CAPI replace the Insight Tag?

Usually no. The Insight Tag captures browser context and retargeting audiences, while CAPI sends durable server-side conversion evidence. B2B teams normally run both and deduplicate or segment events by rule.

Which B2B events should be sent?

Start with high-intent events: demo request, contact sales, trial start, pricing request, webinar attended, MQL, SQL, opportunity created, and closed won. Avoid flooding LinkedIn with every page view from the backend.

Do I need an API version header?

Yes. Pin LinkedIn-Version in the request header and review it during maintenance. Version pinning makes payload behavior explicit and easier to debug when LinkedIn changes the Marketing API.

Can I send offline CRM conversions?

Yes, as long as the conversion rule, timestamp, attribution window, consent basis, and identifiers are valid. CRM lifecycle events are often the best reason for implementing LinkedIn CAPI in B2B.

How fast will conversions appear?

API acceptance is immediate, but Campaign Manager reporting and match diagnostics can lag. Validate request acceptance first, then judge reporting after enough normal traffic and processing time.

Next reads

Related implementation guides

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.