LW IT Solutions
« Blog Overview /Digital Marketing/Tutorials / Tutorial: Precise B2B Tracking with the LinkedIn...
Read this article in other languages:

Tutorial: Precise B2B Tracking with the LinkedIn Insight Tag and GTM

Tutorial: Precise B2B Tracking with the LinkedIn Insight Tag and GTM
Contents
  1. Step 1: The Base Tag, Loaded Once
  2. Step 2: Creating the Conversions in Campaign Manager
  3. Step 3: Firing a Conversion from GTM
  4. Step 4: Triggers That Describe Intent, Not Pages
  5. Step 5: Verifying Before Trusting the Numbers
  6. Staying Inside the Guardrails
  7. Questions and answers
  8. Sources

The LinkedIn Insight Tag pasted site-wide produces exactly one useful thing: a retargeting audience. Every conversion defined on top of it tends to be a URL rule — a thank-you page, a path fragment — which works until the form posts back to the same address, the demo plays inside a single-page application, or the download starts without any navigation at all. At that point the campaign optimises against a page view that has nothing to do with the action worth paying for.

The alternative is to define each action as its own conversion in Campaign Manager and fire it deliberately from Google Tag Manager. The following walkthrough covers the base tag, the conversion ids, the tag that sends them, and the triggers that decide when.

One LinkedIn Insight Tag loaded on all pages fanning out to three separate Campaign Manager conversions, each fired by its own GTM trigger and carrying its own conversion id
The base tag only makes tracking possible – the conversion id is what makes a campaign optimisable against one specific action.

Step 1: The Base Tag, Loaded Once

The Insight Tag belongs in the web container as a single tag on all pages — the community template in the GTM gallery takes only the partner id, and a Custom HTML tag with LinkedIn’s snippet does the same job. What matters is that it loads once and early, because everything afterwards depends on the function it exposes.

It also belongs behind a consent check. The Insight Tag has no cookieless mode: without advertising consent it does not send a reduced signal, it stops entirely, so gating it in GTM’s consent settings is the whole of the implementation rather than a compromise between two behaviours.

Step 2: Creating the Conversions in Campaign Manager

Each action needs its own conversion object, created in Campaign Manager under the account’s conversion tracking section. Choosing the event-specific method rather than the URL method is the decision that makes the rest possible — LinkedIn then issues a numeric conversion id per conversion, and that id is what separates a whitepaper download from a demo view in reporting.

Two settings are worth deciding rather than accepting. The attribution windows control how long after a click or a view a conversion still counts, and the conversion value, if the action has a plausible commercial value, is what lets campaigns be compared on more than volume. Reusing a single id across several events collapses them back into one number, which is the problem the URL-rule setup had in the first place.

Step 3: Firing a Conversion from GTM

With the base tag loaded, a conversion is one function call. A Custom HTML tag carries it, with a guard, because the function only exists once the Insight Tag has actually loaded — and it will not have, for anyone who declined consent or blocked the script:

<script>
(function() {
  if (typeof window.lintrk !== 'function') {
    return;               // base tag absent: consent denied, blocked, or not yet loaded
  }
  window.lintrk('track', { conversion_id: 12345678 });
})();
</script>

Without the guard the tag throws on exactly the visitors whose consent was denied, which turns a silent non-event into a console error on every affected page. Where JavaScript cannot be relied on at all, LinkedIn also accepts an image request carrying the same two identifiers, which is the mechanism behind the no-script fallback:

<img height="1" width="1" style="display:none" alt=""
     src="https://px.ads.linkedin.com/collect/?pid=PARTNER_ID&conversionId=12345678&fmt=gif">

Step 4: Triggers That Describe Intent, Not Pages

The tag is trivial; the trigger is the actual work. A conversion is only as precise as the condition that fires it, and the conditions worth using come from the site’s own data layer rather than from the address bar:

  • Whitepaper download — a custom event pushed when the form submits successfully, not a page view of the thank-you page, which a visitor can reach by other means or reload several times.
  • Demo viewed — a video progress event at a threshold that means something, such as 75 percent watched. A play event fires on autoplay and on accidental clicks; a progress event does not.
  • Pricing interest — a click on the pricing call to action, which needs no unique URL and works identically whether the page navigates or opens a modal.
// Pushed by the site once the form has actually been accepted
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'lead_form_success',
  form_name: 'whitepaper_zero_trust',
  form_location: 'resource_library'
});

A Custom Event trigger on lead_form_success, narrowed by form_name where several forms share the mechanism, ties one LinkedIn conversion to one real action. The same data layer event can feed GA4 and the ad platforms at once, which is the point of pushing it from the site rather than reconstructing it per platform.

Step 5: Verifying Before Trusting the Numbers

Three checks in order. GTM’s preview mode confirms the tag fires on the intended trigger and not on page load. The browser’s network panel confirms a request leaves for LinkedIn’s collection endpoint carrying the expected conversion id — the value there is the one that decides which conversion is credited, and a copy-paste error between two ids produces a perfectly healthy-looking tag reporting into the wrong bucket. Campaign Manager itself then moves the conversion out of an unverified state once it has received real traffic, which is the confirmation that the id and the account actually match.

The final check is arithmetic rather than technical: the count of a conversion over a week against the number of those actions the CRM or the form backend recorded. LinkedIn will report fewer, and the difference is the consent-declined and blocked share.

Staying Inside the Guardrails

LinkedIn’s conversion numbers will not reconcile with GA4, and chasing that gap wastes time. The attribution windows differ, and LinkedIn counts view-through conversions that GA4 has no equivalent for. Someone who saw an ad without clicking, then arrived by another route, appears in one report and not the other. Keeping view-through and click-through visible as separate columns rather than a combined total prevents an inflated figure from being read as demand.

The tag also stays subject to the consent basis it was gated behind, in both directions. An implementation that fires conversions for visitors who declined is not more accurate, only less lawful. And the retargeting audience the base tag builds is a separate purpose that needs to be covered by that same consent.

Questions and answers

Why can a conversion go missing even though consent was given and GTM’s preview mode shows the tag as fired?

Because preview mode only shows that the Custom HTML tag ran, not that the call inside it happened. If the guard skipped the call because the Insight Tag’s window.lintrk function did not exist yet, the tag still counts as fired. That is exactly why the article lists the network panel as the second check: only a request carrying the expected conversion id shows that something left the browser.

The first thing to check is the order. The conversion tag fires before the base tag has run, for instance because the base tag only fires on “Window Loaded” while the event arrives earlier. GTM’s tag sequencing in the advanced settings fixes this, with the base tag as a setup tag that fires before the conversion tag.

Does every conversion need its own tag in GTM, or is one tag with a variable conversion id enough?

One is enough if a lookup table maps each event to exactly one conversion id. The table should then have no default value, and the guard in the tag should check not only for window.lintrk but also that an id is present at all, so that an unknown event sends nothing rather than reporting into the wrong bucket.

How does the Insight Tag fit with a Consent Mode setup in which Google tags send data even without consent?

Without consent the Insight Tag and the Google tags behave differently, and that widens the gap between the reports. In advanced Consent Mode, Google tags send cookieless signals even without consent, from which GA4 can model part of the gap; the Insight Tag stops entirely. On top of the two reasons given in the article, different attribution windows and view-through conversions, there is therefore a third. The comparison with the CRM described in the article shows how much LinkedIn loses to missing consent and blockers.

In GTM the Insight Tag therefore needs its own additional consent check, on ad_storage for example, as described in the article. It should also be attached to a trigger that fires again once consent is granted, such as the event the consent banner pushes into the data layer after acceptance. Otherwise the base tag only loads on the next page view after consent was given, and a conversion that follows on that same page is lost.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

Write a comment

Practical experience and questions about the implementation are welcome here.

The email address is not published. Required fields are marked with an asterisk.

Articles & categories

CCTV

Follow this category by RSS

Cloud & AI

All 11 articles in this category Follow this category by RSS

Data Privacy

All 18 articles in this category Follow this category by RSS

Digital Analytics

All 58 articles in this category Follow this category by RSS

Digital Marketing

All 37 articles in this category Follow this category by RSS

IT & Networks

All 17 articles in this category Follow this category by RSS

Music Production

All 16 articles in this category Follow this category by RSS

Raspberry PI

Follow this category by RSS

SaaS & Internet Earning

Articles coming soon

Smart Home

All 18 articles in this category Follow this category by RSS

Web Development

All 11 articles in this category Follow this category by RSS

WordPress Plugins & Tricks

All 13 articles in this category Follow this category by RSS