LinkedIn is the B2B channel where leads are expensive and the default tracking, URL-based conversions on a thank-you page, is weakest. This guide sets up the Insight Tag through GTM, event-specific conversions from your dataLayer, enhanced conversion tracking with hashed email, and the server-side Conversions API for deduplicated and offline events.
Step 1: Insight Tag Through GTM
In Campaign Manager, open Analyze, then Insight Tag, and copy the Partner ID. In GTM, add the LinkedIn Insight Tag 2.0 template from the Community Template Gallery, enter the Partner ID, add a consent requirement for ad_storage, and fire it on All Pages plus your consent update event.
Raw snippet for reference:
<script>
_linkedin_partner_id = "YOUR_PARTNER_ID";
window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
window._linkedin_data_partner_ids.push(_linkedin_partner_id);
(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>
Step 2: Create Event-Specific Conversions
In Campaign Manager, Analyze, then Conversion tracking, then Create conversion, then Online conversion. Choose Insight Tag as the method and Event-specific as the type. Set the conversion type such as Lead, Sign up or Purchase, the attribution window, and a value if useful. Save and copy the conversion ID.
Create one per outcome: Demo request, Contact form, Trial signup, Purchase.
Step 3: Fire Conversions From the dataLayer
Using the same template, create a tag per conversion with the conversion ID, triggered by the dataLayer event, for example form_submit_success with a condition on form_name. With raw code:
<script>
window.lintrk('track', { conversion_id: 12345678 });
</script>
Add the email for enhanced conversion tracking where the conversion settings allow it; the template exposes a field for it and hashes it.
Step 4: Enhanced Conversion Tracking
In the conversion's settings in Campaign Manager, enable enhanced conversion tracking. In the GTM tag, map the email Data Layer Variable. LinkedIn hashes it and uses it to match members when the Insight cookie is unavailable. This matters on LinkedIn more than most channels because the audience skews to corporate devices and privacy-conscious browsers.
Step 5: Capture li_fat_id
LinkedIn appends li_fat_id to landing URLs from ads. Store it in a first-party cookie on arrival, alongside gclid and ttclid, and write it into form hidden fields. It is the key for server-side and offline attribution.
Step 6: Conversions API Through Server-Side GTM
In Campaign Manager, create a conversion with method Conversions API, or enable it on an existing conversion, and note the conversion URN. Generate an access token through a LinkedIn developer app with the required permissions, or use a partner integration that provides one.
In the server container, add the LinkedIn Conversions API template. Configure the token, map each GA4 event to the conversion URN, include the hashed email, li_fat_id from the cookie, the event ID matching the browser conversion for deduplication, and the conversion time. For offline outcomes such as qualified leads from the CRM, trigger from a webhook client with the stored email and li_fat_id.
Step 7: Verify
- GTM Preview: Insight Tag on page load, conversion tag once on the form success event, with the email mapped. Inspect the request in a tag debugger such as the Insighter Debugger extension.
- Campaign Manager, Insight Tag page: status Active with recent signals.
- Conversion tracking page: each conversion shows Active status and recent events after a test.
- For the Conversions API, the conversion's detail page shows events received through the API, deduplicated where IDs matched.
Common Problems
- Conversions show No recent activity. The tag never fired, or fired before the Insight Tag loaded. Sequence the base tag first.
- Counts far below real leads. No enhanced conversion tracking and no Conversions API. Add both.
- Duplicates. URL-based and event-specific conversions both active for the same thank-you page. Archive the URL one.
- Server events rejected. Missing
li_fat_idand email, or wrong conversion URN.
Outcome
LinkedIn counts each real lead once, matches more of them to members through hashed email and the click ID, receives offline outcomes through the API, and your campaign reports finally reflect what the expensive clicks produced.
