LinkedIn Conversions API (CAPI) & Offline Event Sync: How to Pass CRM Pipeline Stages to LinkedIn Ads via GTM
LinkedIn Ads is the most expensive cost-per-click advertising auction on the internet. With average B2B CPCs ranging from $8 to $35+, relying exclusively on the client-side LinkedIn Insight Tag is a high-risk liability. Ad blockers, Safari ITP 24-hour cookie limits, and multi-touch B2B buyer journeys mean that many high-value enterprise pipeline touchpoints go completely unattributed.
Furthermore, optimizing LinkedIn campaigns exclusively on initial lead generation form fills often trains LinkedIn’s algorithm to hunt for lower-tier job titles who download whitepapers, rather than senior VP and C-level decision-makers who actually sign contracts.
The solution is the LinkedIn Conversions API (CAPI) combined with Offline CRM Event Synchronization.
I am Jobair Mahmud, an independent B2B tracking engineer. In this guide, I share the end-to-end technical protocol for instrumenting the LinkedIn Conversions API via Google Tag Manager and syncing verified pipeline milestones directly from HubSpot and Salesforce.
Key Takeaways: LinkedIn CAPI Architecture
- The LinkedIn CAPI Mandate: LinkedIn CAPI allows advertisers to send conversion events directly from their server or CRM to LinkedIn’s marketing API, completely bypassing browser-based ad blockers and cookie restrictions.
- First-Party User Parameter Matching: LinkedIn matches conversions against its professional member graph using hashed personal data: SHA-256 encrypted email addresses, phone numbers, first/last names, company names, job titles, and the LinkedIn Click ID (
li_fat_id). - Pipeline Milestone Bidding: B2B companies should track multiple conversion milestones:
Demo Requested(Tier 1),Marketing Qualified Lead(Tier 2),Sales Qualified Opportunity(Tier 3), andClosed Won Customer(Tier 4). - Dual-Stream Deduplication: When running both the LinkedIn Insight Tag and LinkedIn CAPI, transmit an identical
eventIdparameter to ensure LinkedIn deduplicates the actions accurately. - If you need expert engineering for your B2B demand gen tracking, review my LinkedIn Ads Conversion Tracking service.
How LinkedIn Matches Conversion Signals
LinkedIn matches event payloads against active member profiles using a tiered priority graph:
Priority 1: First-Party Click Identifier (li_fat_id cookie)
+
Priority 2: Hashed Work Email (SHA-256)
+
Priority 3: Hashed Personal Email (SHA-256)
+
Priority 4: Hashed First Name + Last Name + Company Name + Country
When all four data tiers are provided in a server-side payload, match rates exceed 80%, allowing LinkedIn’s Predictive Audiences and bidding algorithms to optimize on true pipeline revenue.
Step 1: Capturing the LinkedIn Click Identifier (li_fat_id)
When a user clicks a LinkedIn Ad, LinkedIn appends a click identifier parameter to the URL:
https://yourcompany.com/request-demo/?li_fat_id=f4e5d6c7-b8a9-4123-9876-abcdef123456
GTM First-Party Cookie Capture Script
Create a GTM Custom HTML Tag firing on Page View to persist this parameter in a first-party cookie:
// Store LinkedIn Click ID (li_fat_id) in a 90-day First-Party Cookie
(function() {
function getQueryParam(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
var liFatId = getQueryParam('li_fat_id');
if (liFatId) {
var domain = window.location.hostname.replace(/^www\./, '');
var expires = new Date();
expires.setTime(expires.getTime() + (90 * 24 * 60 * 60 * 1000)); // 90 days
document.cookie = 'li_fat_id=' + liFatId + ';expires=' + expires.toUTCString() + ';path=/;domain=.' + domain + ';SameSite=Lax;Secure';
}
})();
Step 2: Implementing LinkedIn CAPI via Server-Side GTM
In your Server-Side GTM Container:
- Add the official LinkedIn Conversions API tag template.
- Enter your LinkedIn Conversion Rule ID and Access Token (generated in LinkedIn Campaign Manager -> Analyze -> Conversion Tracking -> Conversions API).
- Under User Identification, map the following server parameters:
userId.email-> SHA-256 hashed emailuserId.linkedinFirstPartyClickId->{{Cookie - li_fat_id}}userIp->{{Client IP}}userAgent->{{Client User Agent}}
- Set the Deduplication Key to
{{Event Data - event_id}}.
Step 3: Syncing CRM Deal Milestones from HubSpot & Salesforce
The highest-leverage application of LinkedIn CAPI is pushing offline deal stages from your CRM back to LinkedIn Campaign Manager.
The HubSpot to LinkedIn Pipeline:
- In HubSpot, create a custom property named
LinkedIn Click ID (li_fat_id). - Ensure your website demo forms contain a hidden input for
li_fat_id. - In HubSpot Workflows, create a trigger:
- Trigger: Deal Stage changes to “Opportunity Qualified” or “Closed Won”.
- Action: Send a Webhook POST request to the LinkedIn Conversions API endpoint
https://api.linkedin.com/rest/conversionEvents.
{
"conversion": "urn:lla:llaPartnerConversion:12345678",
"conversionHappenedAt": 1730505600000,
"user": {
"userIds": [
{
"idType": "SHA256_EMAIL",
"idValue": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
},
{
"idType": "LINKEDIN_FIRST_PARTY_CLICK_ID",
"idValue": "f4e5d6c7-b8a9-4123-9876-abcdef123456"
}
]
},
"eventValue": {
"currencyCode": "USD",
"amount": "24000.00"
}
}
Transitioning to High-Pipeline Value Bidding
Once LinkedIn CAPI is recording qualified deals:
- In LinkedIn Campaign Manager, create a conversion rule named “CRM Closed-Won ARR”.
- Assign your primary campaigns to optimize for this offline conversion rule.
- Combine with LinkedIn’s demographic targeting (Senior Decision Makers, Buying Committees) to double down on accounts that consistently convert to pipeline revenue.
Engineer Your B2B Measurement Stack
Don’t let expensive LinkedIn ad clicks evaporate into low-quality form fills. Bridge your sales pipeline and ad campaigns with bulletproof engineering.
Through our LinkedIn Ads Conversion Tracking service, we deliver:
- Complete LinkedIn Insight Tag and CAPI dual-stream deployment.
- GTM container engineering with automatic SHA-256 user data hashing.
- HubSpot, Salesforce, and custom CRM webhook automations.
- Weekly attribution audits to verify pipeline match quality.
Schedule your B2B demand gen tracking consultation → or check our full suite of Advanced Tracking Services.
Need this implemented, audited, or white-labeled?
Whether you are an eCommerce brand owner fixing signal loss or a digital marketing agency needing a senior analytics engineer under strict NDA, I deliver 24–48h SLA turnaround with 8.5+ EMQ match rates.

