LinkedIn Conversion API (CAPI) Setup: Complete Guide
Jan 4, 2026
|
Narayan Prasath

LinkedIn Conversion API (CAPI) Setup: Complete Guide
TL;DR: LinkedIn Conversion API (CAPI) sends conversion data directly from your server to LinkedIn, bypassing browser tracking limitations. It requires developer resources to implement but delivers more accurate conversion tracking—especially when users block cookies or make offline purchases. Set up via Campaign Manager by generating an API token, then integrate with your server using LinkedIn's API endpoints.
Prerequisites
Before implementing LinkedIn Conversion API, you need:
LinkedIn Insight Tag installed (CAPI works alongside, not instead of, the tag)
Campaign Manager access with conversion tracking permissions
Technical resources (developer or engineer familiar with APIs)
Server-side environment that can make HTTPS POST requests
CRM or backend system that captures conversion events
Basic understanding of APIs and webhooks
Important: CAPI is an advanced implementation. If you're just starting with LinkedIn ads, implement standard pixel-based conversion tracking first.
What Is LinkedIn Conversion API?
LinkedIn Conversion API (CAPI) is a server-to-server integration that sends conversion data directly from your backend to LinkedIn. Unlike the Insight Tag (which tracks in the browser), CAPI operates on your server.
Traditional Tracking (Insight Tag Only)
User clicks LinkedIn ad → Lands on website → Insight Tag fires → Conversion tracked
Limitations:
Ad blockers prevent tag from firing
Cookie restrictions limit tracking
Cross-device tracking gaps
Offline conversions not captured
Server-Side Tracking (CAPI)
User converts → Your server records event → Server sends data to LinkedIn API → Conversion tracked
Benefits:
Works regardless of browser restrictions
More reliable data capture
Track offline events (phone calls, in-store purchases)
Better attribution for complex buyer journeys
Best practice: Use both Insight Tag AND CAPI simultaneously for maximum accuracy. LinkedIn automatically deduplicates events.
How LinkedIn Conversion API Works
The CAPI Data Flow
User interaction: Someone clicks your LinkedIn ad and visits your website
User converts: They fill out a form, make a purchase, or complete your conversion goal
Server captures event: Your backend records the conversion (email, user ID, timestamp)
Server sends to LinkedIn: Your server makes an HTTPS POST request to LinkedIn's CAPI endpoint with conversion details
LinkedIn matches user: LinkedIn matches the conversion to the original ad click using email hash or LinkedIn UUID
Conversion attributed: The conversion appears in Campaign Manager attributed to the correct campaign/ad
What Data CAPI Sends
Required fields for each conversion:
Conversion Rule ID: Identifies which conversion event this is (e.g., "demo_request")
Conversion Time: Unix timestamp when conversion occurred
User Identifier: Email hash, LinkedIn UUID, or both
Optional fields for better matching:
IP Address: User's IP when converting
User Agent: Browser/device information
Event Value: Revenue amount for purchase conversions
Currency: USD, EUR, etc.
Step 1: Set Up Conversion Tracking in Campaign Manager
Before implementing CAPI, create your conversion events:
Log into Campaign Manager at
business.linkedin.com/campaign-managerClick Analyze > Conversion Tracking
Click Create Conversion
Fill in conversion details:
- Name: "Demo Request" (internal name)
- Attribution Window: 30 days (default)
- Conversion Type: Lead, Purchase, or Other
- Value: Optional revenue amount
Click Create
Note the Conversion ID (you'll need this for CAPI integration)
Repeat for each conversion event you want to track (e.g., "Download Whitepaper," "Free Trial Signup," "Purchase").
Step 2: Generate CAPI Access Token
Create an API access token to authenticate server requests:
In Campaign Manager, navigate to Account Settings
Click Conversion Tracking tab
Scroll to Conversion API (CAPI) section
Click Generate Access Token
Copy the access token (appears once—store securely)
Save token as an environment variable in your server (never commit to version control)
Security: Treat this token like a password. Anyone with this token can send conversion data to your LinkedIn account.
Token format: CAP1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Step 3: Implement Server-Side Integration
Integration Method 1: Direct API Calls (Custom Development)
If building a custom integration, your server makes HTTPS POST requests to LinkedIn's CAPI endpoint:
Endpoint:
Headers:
Request Body (Example):
Required fields explained:
conversion: Your conversion rule URN (format:urn:li:conversion:{CONVERSION_ID})conversionHappenedAt: Unix timestamp in millisecondsuser.userIds: At least one user identifier (email hash recommended)eventId: Unique ID for deduplication (prevents duplicate tracking)
Integration Method 2: Using Official SDKs
LinkedIn doesn't provide official CAPI SDKs, but you can use HTTP libraries in your language:
Python Example:
Node.js Example:
Integration Method 3: Using Marketing Platforms
Popular marketing platforms offer LinkedIn CAPI integrations:
Segment:
In Segment, go to Catalog > Destinations
Search for "LinkedIn Conversions API"
Connect your LinkedIn account
Map Segment events to LinkedIn conversion rules
Enable destination
Zapier:
Create Zap triggered by your conversion event (form submission, CRM deal stage change)
Add action: "LinkedIn Ads - Send Conversion"
Authenticate with LinkedIn
Map fields: Email, Conversion ID, Value
Turn on Zap
HubSpot:
Install LinkedIn Ads integration
Navigate to Settings > Marketing > Ads
Connect LinkedIn account
Enable "Send offline conversions"
Map HubSpot properties to LinkedIn conversion events
Note: Third-party tools often have limitations (e.g., Zapier's 15-minute delay). Custom integration provides real-time tracking.
Step 4: Hash User Identifiers Correctly
LinkedIn requires email addresses hashed with SHA256:
Email normalization rules:
Convert to lowercase:
John@Example.com→john@example.comTrim whitespace:
user@example.com→user@example.comHash with SHA256
Send as hex string (64 characters)
Example transformation:
Original:
Jane@Example.comNormalized:
jane@example.comSHA256 hash:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Common hashing mistakes:
Not lowercasing (case sensitivity matters)
Hashing with extra whitespace
Using MD5 instead of SHA256
Sending plain text email (security risk)
Test your hashing: Use an online SHA256 calculator to verify your hashing logic matches expected output.
Step 5: Implement Deduplication
LinkedIn automatically deduplicates conversions received from both Insight Tag and CAPI if they have matching:
User identifier (email hash)
Conversion type
Timestamp (within 48 hours)
Best practice: Always send a unique eventId with each CAPI request:
Format: {event_type}_{unique_identifier}_{timestamp}
This prevents:
Duplicate conversions if your server retries failed requests
Accidental double-tracking from multiple systems
Step 6: Test CAPI Implementation
Before launching, test your integration:
Test 1: Send Test Conversion
Trigger a conversion on your website using a test email:
Use test email:
test@yourcompany.comComplete conversion action (form submit, purchase)
Check your server logs for CAPI API call
Verify API response:
201 Created(success) or error code
Test 2: Check Campaign Manager
Wait 15-30 minutes after test conversion:
Campaign Manager > Analyze > Conversion Tracking
Click your conversion event
Check Recent Conversions list
Look for your test conversion (may show "Direct" as source if not from an ad click)
Note: CAPI conversions without a LinkedIn ad click appear as "Direct" conversions in reports. They won't attribute to campaigns but confirm CAPI is working.
Test 3: Validate with Ad Click
Generate a real conversion with ad attribution:
Click one of your own LinkedIn ads (use a test campaign)
Complete the conversion on your site
Check that CAPI sends the conversion to LinkedIn
Wait 30 minutes
Campaign Manager > Check campaign performance for the conversion
Success: Conversion appears attributed to your test campaign.
Test 4: Deduplication Test
Verify LinkedIn deduplicates properly:
Complete a conversion (triggers both Insight Tag and CAPI)
Wait 1 hour
Check conversion count in Campaign Manager
Expected: Only 1 conversion counted (not 2)
If seeing duplicate conversions, check your eventId and timing implementations.
Step 7: Monitor CAPI Performance
After launching CAPI, monitor for issues:
API Error Monitoring
Log all CAPI API responses:
Common error codes:
400 Bad Request: Invalid payload format (check JSON structure)401 Unauthorized: Invalid or expired access token403 Forbidden: Token doesn't have permissions for this conversion429 Too Many Requests: Rate limit exceeded (implement exponential backoff)500 Server Error: LinkedIn API issue (retry with backoff)
Monitoring strategy:
Set up alerts for 4xx/5xx error rates above 5%
Log all failed CAPI requests for debugging
Implement retry logic with exponential backoff for 5xx errors
Rotate access tokens if seeing persistent 401 errors
Conversion Discrepancy Tracking
Compare conversion counts weekly:
If match rate drops below 85%:
Check server logs for failed CAPI requests
Verify email hashing logic
Confirm
eventIdimplementation prevents duplicatesTest with a manual conversion
Attribution Quality Check
Monitor conversion source mix:
Before CAPI (Insight Tag only):
70% attributed to LinkedIn ads
30% direct/unknown (ad blocker impact)
After CAPI:
90% attributed to LinkedIn ads
10% direct/unknown
Expected improvement: 15-30% increase in attributed conversions (CAPI captures users with ad blockers).
Advanced CAPI Use Cases
Use Case 1: Offline Conversion Tracking
Track conversions that happen off your website:
Example: Phone call conversions
Prospect clicks LinkedIn ad
Calls your sales team (tracked in phone system)
Phone system API sends conversion to your server
Your server sends CAPI request to LinkedIn with prospect's email
Implementation:
Integrate phone system webhooks with your server
Match call to lead record in CRM (get email)
Send CAPI conversion with call timestamp
Use Case 2: CRM-Based Conversion Tracking
Track when leads become opportunities or customers:
Example: HubSpot deal stage change
Lead from LinkedIn ad enters CRM
Sales team moves deal to "Closed Won"
HubSpot webhook triggers on deal stage change
Your server receives webhook
Server sends CAPI "Purchase" conversion to LinkedIn
Benefits:
Optimize LinkedIn campaigns for revenue, not just leads
Measure true ROI, not just top-of-funnel metrics
Identify which campaigns generate customers vs MQLs
Use Case 3: Mobile App Conversions
Track in-app conversions from LinkedIn ad clicks:
Example: iOS app subscription
User clicks LinkedIn ad on mobile
Installs app from App Store
User subscribes in app
App backend sends CAPI conversion to LinkedIn
Requirements:
Pass LinkedIn click ID from ad to app
Capture user email in app (for matching)
Send CAPI conversion from app backend
Use Case 4: Multi-Touch Attribution
Use CAPI to send multiple touchpoints:
Example funnel:
User clicks LinkedIn ad → CAPI "Viewed Pricing"
Returns later, fills form → CAPI "Demo Request"
Sales closes deal → CAPI "Purchase"
Each CAPI event helps LinkedIn understand the full buyer journey for better optimization.
Common Mistakes with LinkedIn CAPI
Mistake 1: Not Using Both Insight Tag and CAPI
Wrong: Replacing Insight Tag entirely with CAPI
Right: Run both simultaneously for maximum coverage
CAPI alone misses users who convert before your server processes data. Insight Tag + CAPI = best accuracy.
Mistake 2: Incorrect Email Hashing
Wrong: Hashing email with original case: John@Example.COM → hash
Right: Normalize first: john@example.com → hash
Case sensitivity breaks user matching, causing conversion loss.
Mistake 3: Sending Conversions Without eventId
Wrong: Omitting eventId field
Right: Always include unique eventId
Without eventId, retried requests create duplicate conversions.
Mistake 4: Not Implementing Error Handling
Wrong: Fire-and-forget CAPI requests without checking responses
Right: Log errors, implement retries for 5xx errors, alert on high error rates
Missing error handling leads to silent conversion tracking failures.
Mistake 5: Using Outdated API Version
Wrong: Using API version 202301 or earlier
Right: Use latest version (202401+) in LinkedIn-Version header
Older API versions lack features and may be deprecated.
Troubleshooting LinkedIn CAPI
Issue 1: CAPI Conversions Not Appearing in Campaign Manager
Causes:
Access token invalid or expired
Conversion ID incorrect
API request malformed
Timestamp more than 90 days old (LinkedIn rejects old conversions)
Fixes:
Test API token with simple request
Verify conversion ID: Campaign Manager > Conversion Tracking > Click conversion > Note ID
Validate JSON payload with LinkedIn's API docs
Check
conversionHappenedAtis recent and in milliseconds (not seconds)Review server logs for API error responses
Issue 2: Conversions Not Attributed to Campaigns
Causes:
User email in CAPI doesn't match email of person who clicked ad
Conversion sent more than 90 days after ad click (outside attribution window)
Ad click and conversion from different LinkedIn accounts
Fixes:
Ensure collecting correct email (the one linked to their LinkedIn profile)
Check attribution window setting (Campaign Manager > Conversion Settings)
Test with known LinkedIn ad click + conversion flow
Verify CAPI
conversionHappenedAtis within attribution window of ad click
Issue 3: High Error Rates (429 Too Many Requests)
Cause: Exceeding LinkedIn's API rate limits
Fix: Implement request batching and rate limiting:
LinkedIn's rate limits: ~100 requests/minute per access token.
Issue 4: Duplicate Conversions Despite eventId
Cause: Multiple systems sending same conversion with different eventId values
Fix:
Audit all systems sending CAPI requests (backend, CRM, marketing tools)
Choose ONE source of truth for each conversion type
Disable CAPI in duplicate systems
Use consistent
eventIdformat across all systems
CAPI Security Best Practices
Store access token securely: Use environment variables, never hardcode
Restrict token permissions: Generate separate tokens for different environments (dev/prod)
Hash user data: Never send plain text emails or PII in API requests
Use HTTPS only: All CAPI requests must use encrypted connections
Log cautiously: Don't log plain text user data or access tokens
Rotate tokens regularly: Generate new tokens every 90 days
Monitor for unauthorized usage: Alert on unexpected API call volume spikes
Implement IP whitelisting: If possible, restrict API calls to known server IPs
Use API versioning: Pin to specific API version to prevent breaking changes
Test in sandbox environment: Never test CAPI with production conversion rules initially
Glossary
Verification Checklist
After implementing LinkedIn CAPI:
[ ] Conversion events created in Campaign Manager with noted IDs
[ ] CAPI access token generated and stored securely as environment variable
[ ] Server can make HTTPS POST requests to LinkedIn API
[ ] Email hashing implemented correctly (lowercase, trimmed, SHA256)
[ ] Unique
eventIdgenerated for each conversion[ ] API requests include required headers (Authorization, LinkedIn-Version)
[ ] Error handling and logging implemented for failed requests
[ ] Test conversion sent successfully (201 response code)
[ ] Test conversion appears in Campaign Manager within 30 minutes
[ ] Deduplication verified (Insight Tag + CAPI = 1 conversion counted)
[ ] Conversions attributed to correct campaigns (test with ad click)
[ ] Monitoring set up for API errors and conversion discrepancies
[ ] Both Insight Tag and CAPI running simultaneously (not CAPI-only)
[ ] Offline/CRM conversion tracking tested if applicable
Next Steps After CAPI Setup
Week 1: Monitor conversion match rates between CRM and LinkedIn
Week 2: Check campaign attribution improvements (should see 15-30% more attributed conversions)
Week 3: Implement advanced use cases (offline conversions, CRM integration)
Week 4: Optimize campaigns using improved conversion data
Monthly: Review CAPI error logs and API success rates
Quarterly: Audit all conversion rules, update as business goals evolve
Stay in the loop
By dropping your email you’re giving us the green light to slide into your inbox with bite-sized brain boosters on growth!
