Overview
LinkedIn event tracking enables measurement of user actions after ad exposure. This powers conversion-based optimization, ROI calculation, and campaign attribution. Proper event tracking is essential for understanding campaign impact and optimizing performance.
Prerequisites
Before implementing conversion tracking:
- Insight Tag Installed - Base tag must be on all pages
- Conversion Created - Define conversion in Campaign Manager
- Access to Website Code - Ability to add tracking code to conversion pages
- Testing Environment - Staging site for verification
Creating Conversions in Campaign Manager
Step 1: Access Conversions
- Log in to LinkedIn Campaign Manager
- Navigate to Account Assets
- Select Conversions
- Click Create Conversion
Step 2: Configure Conversion
Basic Information:
Name
- Descriptive label (e.g., "Demo Request", "Trial Signup")
- Internal reference only (not visible to users)
Type Choose from standard options:
Value
- Static Value: Fixed amount per conversion
- Dynamic Value: Pass actual transaction value
- No Value: Count conversions without value
Example Values:
- Lead: $50 (average lead value)
- Purchase: Dynamic (actual order total)
- Download: $0 (count only)
Step 3: Attribution Settings
Click-Through Attribution Window
- 1, 7, 30, or 90 days
- Default: 30 days
- How long after click to attribute conversion
View-Through Attribution Window
- 1, 7, or 30 days
- Default: 7 days
- How long after impression to attribute conversion
Counting Method
- One per click: Only first conversion counts (recommended for leads/signups)
- Many per click: Multiple conversions count (for ecommerce repeat purchases)
Step 4: Get Conversion ID
After creating conversion:
- Note the Conversion ID (numeric)
- Copy tracking code snippet provided
- Save conversion
Basic Conversion Tracking
Standard Implementation
Place on conversion confirmation page (thank-you page, order confirmation, etc.):
<!-- LinkedIn Conversion Tracking -->
<script type="text/javascript">
window.lintrk('track', { conversion_id: YOUR_CONVERSION_ID });
</script>
Example for Trial Signup:
<!DOCTYPE html>
<html>
<head>
<title>Thank You - Trial Started</title>
<!-- LinkedIn Insight Tag (should already be on all pages) -->
<script type="text/javascript">
_linkedin_partner_id = "1234567";
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>
</head>
<body>
<h1>Thank you for starting your trial!</h1>
<!-- Conversion Tracking for Trial Signup -->
<script type="text/javascript">
window.lintrk('track', { conversion_id: 5678901 });
</script>
</body>
</html>
Dynamic Value Tracking
Passing Transaction Value
For purchases or variable-value conversions:
window.lintrk('track', {
conversion_id: YOUR_CONVERSION_ID,
value: 99.99,
currency: 'USD'
});
E-commerce Purchase Example
<script type="text/javascript">
// Get order total from your system
var orderTotal = 249.99; // Example: from server-side variable
window.lintrk('track', {
conversion_id: 1234567, // Your Purchase conversion ID
value: orderTotal,
currency: 'USD'
});
</script>
Dynamic Implementation with Server Variables
PHP Example:
<script type="text/javascript">
window.lintrk('track', {
conversion_id: 1234567,
value: <?php echo $order_total; ?>,
currency: 'USD'
});
</script>
JavaScript/Template Example:
<script type="text/javascript">
window.lintrk('track', {
conversion_id: 1234567,
value: {{ order.total }}, // Template variable
currency: 'USD'
});
</script>
Supported Currencies
Use ISO 4217 currency codes:
- USD, EUR, GBP, CAD, AUD
- JPY, CNY, INR, BRL, etc.
- Full list: ISO 4217 codes
Google Tag Manager Implementation
Creating Conversion Tag in GTM
Step 1: Create Tag
Step 2: Add Code
<script type="text/javascript">
window.lintrk('track', { conversion_id: YOUR_CONVERSION_ID });
</script>
Step 3: Configure Trigger
Create trigger based on conversion event:
Option A: Page View Trigger
- Trigger Type: Page View
- This trigger fires on: Some Page Views
- Page URL contains: /thank-you
- Or Page Path equals: /order-confirmation
Option B: Custom Event Trigger
- Trigger Type: Custom Event
- Event Name: formSubmission or purchase
- Fires when your form/checkout fires custom event
Step 4: Test and Publish
- Enable Preview mode
- Complete conversion action
- Verify tag fires in debugger
- Check Network tab for request
- Publish container
GTM with Dynamic Values
Step 1: Create Variables
Data Layer Variables:
Variable Name: DL - Order Total
Data Layer Variable Name: orderTotal
Variable Name: DL - Currency
Data Layer Variable Name: currency
Step 2: Update Tag Code
<script type="text/javascript">
window.lintrk('track', {
conversion_id: 1234567,
value: {{DL - Order Total}},
currency: '{{DL - Currency}}'
});
</script>
Step 3: Push to Data Layer
On confirmation page:
<script>
dataLayer.push({
'event': 'purchase',
'orderTotal': 249.99,
'currency': 'USD'
});
</script>
Multiple Conversions
Tracking Different Conversion Types
Create separate conversions for different actions:
Demo Request (Conversion ID: 1111111):
window.lintrk('track', { conversion_id: 1111111 });
Trial Signup (Conversion ID: 2222222):
window.lintrk('track', { conversion_id: 2222222 });
Purchase (Conversion ID: 3333333):
window.lintrk('track', {
conversion_id: 3333333,
value: orderTotal,
currency: 'USD'
});
Conditional Tracking Based on Action
// Determine which conversion occurred
var conversionType = getConversionType(); // Your function
if (conversionType === 'demo') {
window.lintrk('track', { conversion_id: 1111111 });
} else if (conversionType === 'trial') {
window.lintrk('track', { conversion_id: 2222222 });
} else if (conversionType === 'purchase') {
window.lintrk('track', {
conversion_id: 3333333,
value: getOrderTotal(),
currency: 'USD'
});
}
Advanced Tracking Scenarios
Single Page Applications (SPAs)
For React, Vue, Angular apps where pages don't reload:
// Track conversion on route change or form submission
function trackLinkedInConversion(conversionId, value = null) {
if (typeof window.lintrk === 'function') {
const conversionData = { conversion_id: conversionId };
if (value !== null) {
conversionData.value = value;
conversionData.currency = 'USD';
}
window.lintrk('track', conversionData);
}
}
// Call when conversion occurs
trackLinkedInConversion(1234567);
// Or with value
trackLinkedInConversion(3333333, 99.99);
React Example:
import { useEffect } from 'react';
function ThankYouPage() {
useEffect(() => {
// Track conversion when component mounts
if (typeof window.lintrk === 'function') {
window.lintrk('track', { conversion_id: 1234567 });
}
}, []);
return <div>Thank you for your purchase!</div>;
}
AJAX Form Submissions
Track conversions without page reload:
// After successful form submission
function onFormSuccess(response) {
// Your success handling
showSuccessMessage();
// Track LinkedIn conversion
window.lintrk('track', {
conversion_id: 1234567,
value: response.leadValue || 50,
currency: 'USD'
});
}
// Example with fetch
fetch('/api/submit-form', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
onFormSuccess(data);
}
});
Event-Based Tracking
Track conversions on specific user interactions:
// Download button click
document.getElementById('downloadBtn').addEventListener('click', function() {
window.lintrk('track', { conversion_id: 5555555 });
});
// Video completion
videoPlayer.on('ended', function() {
window.lintrk('track', { conversion_id: 6666666 });
});
// Scroll depth
if (scrollPercent >= 75) {
window.lintrk('track', { conversion_id: 7777777 });
}
Deduplication
Preventing Duplicate Conversions
Problem: Users refresh thank-you page, conversion fires multiple times
Solution 1: Session Storage
var conversionKey = 'linkedin_conversion_' + 1234567;
if (!sessionStorage.getItem(conversionKey)) {
window.lintrk('track', { conversion_id: 1234567 });
sessionStorage.setItem(conversionKey, 'true');
}
Solution 2: URL Parameter Check
// Only track if coming from form submission
if (window.location.search.includes('submitted=true')) {
window.lintrk('track', { conversion_id: 1234567 });
// Clean URL to prevent duplicate tracking on refresh
if (history.replaceState) {
history.replaceState({}, document.title, window.location.pathname);
}
}
Solution 3: Cookie-Based
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
if (!getCookie('linkedin_conv_1234567')) {
window.lintrk('track', { conversion_id: 1234567 });
setCookie('linkedin_conv_1234567', 'true', 30);
}
Testing and Verification
Browser Console Testing
// Check if lintrk function available
if (typeof window.lintrk === 'function') {
console.log('✓ lintrk function available');
// Manually trigger test conversion
window.lintrk('track', { conversion_id: YOUR_CONVERSION_ID });
console.log('✓ Test conversion fired');
} else {
console.error('✗ lintrk function not found - check Insight Tag installation');
}
Network Tab Verification
- Open DevTools > Network tab
- Filter for "linkedin" or "px.ads.linkedin.com"
- Trigger conversion
- Look for request with conversion_id parameter
- Verify 200 status code
Expected request:
https://px.ads.linkedin.com/collect/?pid=1234567&conversionId=5678901&v=...
Campaign Manager Verification
Timeline:
- Conversions appear within 24-48 hours
- Real-time reporting not available
- Test conversions may not appear (minimum spend required)
Check Conversion Health:
- Account Assets > Conversions
- View specific conversion
- Check recent activity
- Verify tracking status: Active/Inactive
GTM Debug Mode
When using GTM:
- Enable Preview mode
- Navigate to conversion page
- Check "Tags Fired" section
- Verify LinkedIn conversion tag appears
- Review tag data in debug panel
Best Practices
Implementation
- Place on Confirmation Pages Only - Don't track on form pages
- Use Static Conversion IDs - Never use variables for conversion_id
- Implement Deduplication - Prevent duplicate tracking
- Test Thoroughly - Verify before launching campaigns
- Document Conversions - Maintain list of conversion IDs and purposes
Value Tracking
- Dynamic for Transactions - Pass actual purchase amounts
- Static for Leads - Use average lead value
- Currency Consistency - Match Campaign Manager account currency
- Validate Values - Ensure proper number formatting
- Include Tax/Shipping - Use total order value
Conversion Design
- Meaningful Events - Track actions that matter to business
- Funnel Approach - Track micro and macro conversions
- Consistent Naming - Use clear, descriptive names
- Appropriate Attribution Windows - Match sales cycle length
- Right Counting Method - One vs. many per click based on goal
Privacy & Compliance
- Respect Consent - Only track with user permission
- No PII in Values - Don't pass personally identifiable information
- Secure Implementation - Use HTTPS pages
- Privacy Policy Disclosure - Inform users of tracking
- Honor Opt-Outs - Respect user preferences
Troubleshooting
Conversions Not Recording
Check:
- ✓ Insight Tag installed on conversion page?
- ✓ Conversion tracking code on confirmation page?
- ✓ Correct conversion ID?
- ✓ Window.lintrk function available?
- ✓ Network request firing?
- ✓ 24-48 hours passed since test?
- ✓ Minimum ad spend threshold met?
Common Issues:
- Tag installed only on landing page, not confirmation page
- Conversion code in wrong location (fires before Insight Tag loads)
- JavaScript error preventing execution
- AdBlockers preventing tracking (educate users)
Value Not Passing
Verify:
// Log value being passed
var orderTotal = 99.99;
console.log('Conversion value:', orderTotal);
window.lintrk('track', {
conversion_id: 1234567,
value: orderTotal,
currency: 'USD'
});
Common Issues:
- Value is string, should be number:
value: parseFloat(orderTotal) - Currency mismatch with account settings
- Value includes currency symbol: Use
99.99not"$99.99"
GTM Tag Not Firing
Debug:
- Preview mode shows tag not triggered
- Check trigger configuration
- Verify data layer variables populated
- Review trigger conditions
- Check tag firing order
Conversion Types Reference
Lead Generation
Use Cases:
- Form submissions
- Demo requests
- Contact inquiries
- Quote requests
Implementation:
window.lintrk('track', {
conversion_id: LEAD_CONVERSION_ID,
value: 50, // Average lead value
currency: 'USD'
});
E-commerce
Use Cases:
- Product purchases
- Checkout completions
- Add to cart (micro-conversion)
Implementation:
window.lintrk('track', {
conversion_id: PURCHASE_CONVERSION_ID,
value: orderTotal,
currency: 'USD'
});
Sign Ups
Use Cases:
- Account registration
- Newsletter subscription
- Free trial starts
Implementation:
window.lintrk('track', {
conversion_id: SIGNUP_CONVERSION_ID
});
Downloads
Use Cases:
- White paper downloads
- App installations
- Resource downloads
Implementation:
window.lintrk('track', {
conversion_id: DOWNLOAD_CONVERSION_ID
});
Next Steps
After implementing conversion tracking:
- Monitor Performance - Check conversion data in Campaign Manager
- Set Up Goals - Configure campaign optimization goals
- Analyze Attribution - Review click vs. view-through conversions
- Optimize Campaigns - Use conversion data for bidding and targeting
- Expand Tracking - Add micro-conversions for better insights
Additional Resources
- Data Layer Setup - Advanced parameter passing
- Troubleshooting Guide - Common issues and solutions
- Server-Side Tracking - Alternative implementation
- LinkedIn Help Center - Official documentation