How to Implement LinkedIn Conversions API (CAPI) via Server-Side GTM
B2B campaigns running on LinkedIn Ads encounter severe signal loss when relying solely on the client-side Insight Tag. High-intent decision-makers frequently browse through privacy-hardened corporate networks, strict VPNs, and Safari browsers where Intelligent Tracking Prevention (ITP) caps client cookies at 24 hours. Because LinkedIn traffic commands some of the highest CPCs in performance marketing, missing even a fraction of demo requests or pipeline updates severely damages campaign ROAS.
The solution is deploying the LinkedIn Conversions API (CAPI) through a server-side container. By shifting transmission to the server, you transmit first-party verified identifiers—such as SHA-256 hashed corporate emails and Lead Gen Form IDs—directly to LinkedIn’s endpoint without relying on third-party browser storage.
Signal Loss: Insight Tag vs. Server-to-Server CAPI
The client-side Insight Tag writes a first-party cookie (li_fat_id) when a user clicks an ad. However, if the prospect converts after multiple sessions or across different corporate devices, browser-side tracking breaks:
LinkedIn Insight Tag vs. Server-Side CAPI
Prospect Ad Click Occurs
Landing URL captures identifier ➔ Persists to first-party cookie: li_fat_id
- ✕ Blocked by strict corporate ad-blockers and enterprise VPN filters
- ✕ WebKit / Safari ITP aggressively strips cookie persistence to 24h
- ✕ Unreliable cross-device matching on fragmented B2B sales cycles
- ✓ Immune to browser ad-blockers and client network-layer extensions
- ✓ Normalizes and hashes corporate email with deterministic SHA-256
-
✓
Correlates
li_fat_idwith business domain and CRM lifecycle stage
Pairing the client tag with server-side delivery increases Event Match Quality (EMQ) and ensures that downstream sales velocity syncs properly with your campaigns, much like the offline data pipelines covered in our Google Ads offline conversion webhook guide.
Prerequisites in LinkedIn Campaign Manager
- Open LinkedIn Campaign Manager and go to Analyze > Conversions.
- Click Create Conversion > API.
- Define the conversion event:
- Name: e.g.,
Server - Demo Booked - Type: Select Lead, Sign Up, or Key Page View.
- Attribution Window: Recommended standard is 30-day click / 7-day view.
- Name: e.g.,
- Note your numeric Conversion Rule ID from the URL or tag summary (you will need this in GTM).
- Generate an Access Token under your LinkedIn Developer App with the
rw_conversionsscope active.
Step 1: Pass Hashed User Data from the Web Container
LinkedIn CAPI achieves high match rates when provided with first-party identity data. Before dispatching hits to your server container, your web GTM setup must capture and format these parameters.
When a user submits a lead form or signs up, capture their business email, normalize it (trim spaces, convert to lowercase), and generate a SHA-256 hash. If your stack already utilizes client-side deduplication routines like our GA4 duplicate transaction prevention script, you can run the normalization within the same validation cycle.
Pass the hashed payload into the dataLayer:
JavaScript
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'lead_form_submitted',
user_data: {
email_address: 'd9b1d7d4...sha256_hash...', // Hashed lowercase email
first_name: 'Alex',
last_name: 'Vance'
},
li_fat_id: getCookie('li_fat_id') // First-party LinkedIn click identifier
});
Ensure the GA4 or custom HTTP transport tag forwarding this hit points directly to your dedicated tracking endpoint. For teams evaluating hosting options, review our technical comparison between Stape and AWS for Server GTM to ensure your custom domain handles first-party cookie transport correctly.
Step 2: Configure the LinkedIn CAPI Tag in Server GTM
Inside your GTM Server Container:
- Open Templates > Search Gallery and install the official LinkedIn Conversions API tag template (or the community template verified by Stape).
- Create a new tag: LinkedIn CAPI – Conversion Event.
- Populate the required credentials:
- API Access Token: Enter the bearer token generated in the LinkedIn Developer portal.
- Conversion Rule ID: Input your conversion rule ID from Campaign Manager.
- Map the User Match Parameters:
- SHA-256 Email: Map to
Event Data > user_data.email_address. - LinkedIn First-Party Cookie (
li_fat_id): Map toEvent Data > li_fat_idor read directly from incoming request cookies.
- SHA-256 Email: Map to
- Set the firing trigger to custom event
lead_form_submitted.
Step 3: Event Deduplication Between Insight Tag & CAPI
If you keep the browser-based Insight Tag running alongside CAPI for hybrid measurement, you must deduplicate events to prevent double-counting conversions.
Similar to our Meta CAPI event deduplication architecture, LinkedIn uses an eventId parameter to reconcile duplicates:
- In your Web Container Insight Tag, enable Event Deduplication and pass a unique string to
eventId(e.g.,evt_linkedin_98412). - In your Server Container LinkedIn CAPI Tag, pass that exact same
eventIdvariable. - LinkedIn automatically matches payloads arriving within a 48-hour window, logging only a single conversion toward attribution while using the combined parameters to boost the audience match score.
Step 4: Verification and Match Quality Audit
- Run Server GTM Preview Mode and trigger a test conversion on your site.
- Verify that the LinkedIn CAPI Tag fired with status
201 Createdor200 OK. - In LinkedIn Campaign Manager, navigate to Analyze > Conversions > Your Conversion Name.
- Check the Event Quality and Signal Health tabs:
- Look for the «Receiving Events» active indicator.
- Review the Match Rate: A well-configured setup passing both
li_fat_idand hashed email should report match rates between 65% and 80%, compared to 30% on the web pixel alone.
If downstream pipeline updates take place inside your CRM days later, ensure custom property formats align across tools by consulting our HubSpot to Salesforce synchronization guide to avoid dropping the li_fat_id before the conversion event triggers.
Frequently Asked Questions
Does LinkedIn CAPI require raw email addresses or hashed values?
LinkedIn requires all personally identifiable information (PII) like email addresses and phone numbers to be SHA-256 hashed. The string must be stripped of whitespace, converted entirely to lowercase, and hashed before sending. Never transmit plain-text emails over the API.
What is li_fat_id and how is it captured?
li_fat_id is LinkedIn’s first-party click identifier parameter. When a prospect clicks an ad on LinkedIn, the landing page URL is decorated with this ID. The client-side script or server reverse proxy stores it in a first-party cookie named li_fat_id so subsequent conversions can be attributed directly to that specific impression.
Can I run LinkedIn CAPI without the client-side Insight Tag?
Yes. You can implement a 100% server-side setup. However, running a hybrid deployment (both Insight Tag and CAPI with deduplication enabled) is recommended by LinkedIn, as the client tag assists with browser fingerprinting while the server pipeline guarantees delivery against ad-blockers and privacy filters.