LinkedIn Ads
LinkedIn Ads has a self-serve ad account and a real Conversions API. Create and associate a conversion rule, then send confirmed events.
Use ad-conversion-hub for the canonical event envelope, consent gate, identity rules, retry policy, and adapter contract.
Account and access
Campaign Manager is self-serve. Select For Business → Advertise in LinkedIn, then create an ad account. A Business Manager account requires an admin. The creator gets account manager and billing admin access. Currency and Company Page cannot change later; a Company Page is required for full features. See Create an ad account.
For a direct advertiser integration, use Data → Signals Manager → Direct API → Generate access token. This route needs no developer application. The token does not expire and appears once. Store it at once. See CAPI access.
For a product serving several advertisers, request the Conversions API product
for a developer app. LinkedIn reviews the business details and use case. A Page
super admin must verify the app. Partner OAuth uses rw_conversions and
r_ads; the member needs a non-VIEWER role. See partner access and the API workflow.
LinkedIn defines no environment-variable names. This skill uses the hub convention:
LINKEDIN_TAG_ID public Insight Tag partner ID
LINKEDIN_ACCOUNT_URN urn:li:sponsoredAccount:<id>
LINKEDIN_CAPI_TOKEN server-only direct or OAuth bearer token
LINKEDIN_CAPI_CONVERSION_URN urn:lla:llaPartnerConversion:<id>
LINKEDIN_INSIGHT_CONVERSION_ID browser conversion rule ID
LINKEDIN_VERSION value for the Linkedin-Version header
Client-side Insight Tag
Create the tag under Data → Signals Manager → Insight Tag. Copy its partner
ID. Load it on every eligible page in the global footer, just before </body>.
See Insight Tag conversion tracking.
<script type="text/javascript">
_linkedin_partner_id = "<LINKEDIN_TAG_ID>";
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
window._linkedin_data_partner_ids.push(_linkedin_partner_id);
</script>
<script type="text/javascript">
(function (l) {
if (!l) {
window.lintrk = function (a, b) { window.lintrk.q.push([a, b]); };
window.lintrk.q = [];
}
var s = document.getElementsByTagName("script")[0];
var b = document.createElement("script");
b.type = "text/javascript"; b.async = true;
b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
s.parentNode.insertBefore(b, s);
})(window.lintrk);
</script>
<noscript><img height="1" width="1" style="display:none" alt=""
src="https://px.ads.linkedin.com/collect/?pid=<LINKEDIN_TAG_ID>&fmt=gif" /></noscript>
For a page-load conversion, set the shared ID before the base tag:
<script>window._linkedin_event_id = "<CANONICAL_EVENT_ID>";</script>
For an event-specific conversion, pass the same ID to lintrk:
window.lintrk("track", {
conversion_id: "<LINKEDIN_INSIGHT_CONVERSION_ID>",
event_id: canonicalEvent.event_id,
});
Rule setup and event mapping
The streaming payload has no free-form event name. The conversion rule's
type supplies the LinkedIn event name. Create a rule per type. Use separate
browser and server rules when you enable deduplication.
| Hub event | LinkedIn rule type | Send when |
|---|---|---|
page_view |
KEY_PAGE_VIEW |
Important page only |
view_content |
VIEW_CONTENT |
Meaningful product or plan view |
lead |
LEAD |
Qualified lead submission |
signup |
SIGN_UP or COMPLETE_SIGNUP |
Account or registration completes |
begin_checkout |
START_CHECKOUT |
Checkout starts |
purchase |
PURCHASE |
Payment provider confirms a charge |
subscription_start |
SUBSCRIBE |
Paid subscription activates |
refund |
Do not dispatch | Reconcile with payment truth |
These types are in the CAPI schema. LinkedIn documents no REFUND type.
Create a CAPI rule:
POST https://api.linkedin.com/rest/conversions?autoAssociationType=ALL_CAMPAIGNS
Authorization: Bearer <LINKEDIN_CAPI_TOKEN>
Content-Type: application/json
Linkedin-Version: <LINKEDIN_VERSION>
X-Restli-Protocol-Version: 2.0.0
{
"name": "CAPI purchase",
"account": "urn:li:sponsoredAccount:<ACCOUNT_ID>",
"conversionMethod": "CONVERSIONS_API",
"postClickAttributionWindowSize": 90,
"viewThroughAttributionWindowSize": 30,
"attributionType": "LAST_TOUCH_BY_CAMPAIGN",
"type": "PURCHASE"
}
Save the returned ID as urn:lla:llaPartnerConversion:<id>. Without automatic
association, use the Campaign Conversions API or Campaign Manager UI. LinkedIn
only attributes to associated campaigns. See Conversions API.
Server-side Conversions API
Send the confirmed event to POST https://api.linkedin.com/rest/conversionEvents
with the same bearer and version headers above:
{
"conversion": "urn:lla:llaPartnerConversion:<CONVERSION_ID>",
"conversionHappenedAt": 1730017211229,
"conversionValue": { "currencyCode": "USD", "amount": "25.00" },
"user": { "userIds": [
{ "idType": "SHA256_EMAIL", "idValue": "<SHA256_EMAIL_HEX>" },
{ "idType": "LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID", "idValue": "<LI_FAT_ID>" }
]},
"eventId": "<CANONICAL_EVENT_ID>"
}
conversion, conversionHappenedAt, and user are the event fields. The
timestamp is epoch milliseconds and must be within 90 days. The value amount is
a decimal string. At least one valid identity is required unless another valid
user field supplies identity. A successful single event returns 201 Created.
See the event schema.
Batch requests use X-RestLi-Method: BATCH_CREATE and allow 5,000 events. Use
the hub's bounded retry and dead-letter policy. Do not replay an uncertain
request unless the dispatch record and eventId rule make it safe. See CAPI FAQ.
Identity and consent
- Require
measurement: truein the hub before any LinkedIn event. - Require
ad_user_data: truebefore hashed email, IP, or external IDs. - Remove email whitespace, lowercase it, then SHA-256 hash it. Send lowercase hexadecimal text. Do not hash an existing hash again.
- Supported IDs include
SHA256_EMAIL,LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID,ACXIOM_ID,PLAINTEXT_IP_ADDRESS,SHA256_IP_ADDRESS, andGOOGLE_AID. - Plain and hashed IP IDs support IPv4 only.
userInfois plain text and needs bothfirstNameandlastName.externalIdsaccepts one advertiser ID. - LinkedIn preserves a matched external-ID mapping for one year across ad accounts in the same Business Manager. Pair it with a standard ID first.
The hub owns normalization and consent. LinkedIn also prohibits the Insight Tag on pages that collect sensitive health or financial data. See privacy guidance.
Click ID and first-party cookie
Enable Enhanced conversion tracking for the Insight Tag. LinkedIn then adds
li_fat_id to ad landing URLs. Capture it on first landing and persist first-
touch and latest values in first-party storage. The cookie lasts 30 days from
the latest qualifying ad click. Send it to CAPI as
LINKEDIN_FIRST_PARTY_ADS_TRACKING_UUID. Parsing only the URL can limit view-
through attribution; reading the cookie supports it. Do not require a click ID
before sending a server purchase. See Enabling Click IDs.
New tags enable first-party tracking by default. Check
firstPartyTrackingEnabled when the cookie or li_fat_id is absent. Campaign
Manager and the partial update API can change this setting.
Deduplication
LinkedIn reconciles browser and server copies with eventId.
- Create a browser Insight Tag rule and a server CAPI rule for the action.
- Put the same hub
event_idin browserevent_idand servereventId. - Set
_linkedin_event_idbefore the page-load tag, or passevent_idtolintrkfor an event-specific conversion. - Check both conversion breakdowns. For the same account and ID, LinkedIn counts the Insight Tag copy and discards the CAPI twin.
See LinkedIn deduplication. The event ID is not the conversion rule URN.
Campaign Manager settings that override code
enabled=falsestops a rule from matching events.conversionMethodmust beCONVERSIONS_APIfor server rules.- No campaign association means no campaign attribution.
- The rule controls attribution windows and model. Current CAPI defaults are 30 days post-click and 7 days view-through. Supported windows include 1, 7, 30, and 90 days; 365 days is limited to some types.
DYNAMIC,FIXED, andNO_VALUEcontrol reported conversion value.- A blocked Insight Tag domain sends no downstream conversion or audience signal.
- Website Actions can create conversions that stay inactive until approved.
See rule settings and Website Actions.
Verification
- Request proof: record the redacted event response.
201 Createdproves request acceptance, not attribution. - Platform proof: in Campaign Manager, open Measurement → Conversion
Tracking. Check the CAPI rule status and match rate.
Activewith a good match rate shows receipt and identity matching.Low Match Rateshows poor identity matching. Read active CAPI rules withGET /rest/conversions, filteringenabled=trueandconversionMethod=CONVERSIONS_API. - Business proof: open Conversions & Leads, break down by conversion, and reconcile counts and value with succeeded charges.
For the tag, query GET https://api.linkedin.com/rest/insightTagDomains?q=account&account=<ENCODED_ACCOUNT_URN>. Domains can take 5–10 minutes to populate after a visit. See tag verification and CAPI measurement.
Common pitfalls and security
- Use
urn:li:sponsoredAccount:<id>for the account andurn:lla:llaPartnerConversion:<id>for the rule. - Use epoch milliseconds, not seconds. Use
eventId, notevent_id, in CAPI. - Do not send raw email, an uppercase hash, or a double-hashed email.
- Do not create a new browser and server ID for one event.
- Do not send only
li_fat_id; organic and direct events still matter. - Do not treat
201, a live tag request, or an active campaign as attribution. - Recheck rule status, domain status, campaign association, member role, and
rw_conversions/r_adsafter any access change. - Keep
LINKEDIN_CAPI_TOKENserver-side. Never put it in browser code, URLs, logs, screenshots, or commits. Use HTTPS, redact bearer tokens, apply the hub consent gate, and delete temporary normalized identifiers after dispatch.