LinkedIn Insight Tag
The LinkedIn Insight Tag
forwards browser conversions to LinkedIn Campaign Manager for ad optimization,
retargeting, and demographic insights. This destination wraps the standard
Insight Tag snippet (loaded from snap.licdn.com/li.lms-analytics/insight.min.js);
there is no npm SDK for the browser tag. Mapped events become
window.lintrk('track', { conversion_id, conversion_value?, currency?, event_id? })
calls.
LinkedIn Insight Tag is a web destination in the walkerOS flow:
Installation
npm install @walkeros/collector @walkeros/web-destination-linkedin- Integrated
- Bundled
import { startFlow } from '@walkeros/collector';
import destinationLinkedin from '@walkeros/web-destination-linkedin';
await startFlow({
destinations: {
linkedin: {
code: destinationLinkedin,
config: {
loadScript: true,
settings: {
apiKey: '123456',
},
},
},
},
});
A complete flow.json with this destination:
{
"version": 4,
"flows": {
"default": {
"config": {
"platform": "web"
},
"destinations": {
"linkedin": {
"package": "@walkeros/web-destination-linkedin",
"config": {
"loadScript": true,
"settings": {
"apiKey": "123456"
}
}
}
}
}
}
}The quickstart above sets no consent, so the Insight Tag loads and sets its
cookies without marketing consent, every conversion you map is sent without it
too, and a revocation changes nothing. Add consent: { marketing: true } to
config, next to settings, before you go live (see Consent).
Configuration
This destination uses the standard destination config wrapper (consent, data, env, id, ...). For the shared fields see destination configuration. Package-specific fields live under config.settings and are listed below.
Settings
| Property | Type | Description | More |
|---|---|---|---|
apiKey | string | Your LinkedIn Partner ID (numeric string, typically 6 to 7 digits). Find it in Campaign Manager under Insight Tag. Assigned to window._linkedin_partner_id before the Insight Tag script loads (like 1234567). |
Mapping
Per-event rules under config.mapping. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.
| Property | Type | Description | More |
|---|---|---|---|
conversion | any | Resolves to a LinkedIn conversion object with short keys: { id (required number, the Campaign Manager conversion_id), value? (number), currency? (ISO code), eventId? (string, the same event id the server LinkedIn destination sends, for deduplication) }. A rule whose conversion resolves to no id makes no lintrk call and fails the push with missing-input. |
Examples
Lead conversion
A demo request fires a LinkedIn lintrk track for a lead conversion with id and event_id only.
{
"name": "demo request",
"data": {
"string": "foo",
"number": 1,
"boolean": true,
"array": [
0,
"text",
false
]
},
"context": {
"dev": [
"test",
1
]
},
"globals": {
"lang": "elb"
},
"custom": {
"completely": "random"
},
"user": {
"id": "us3r",
"device": "c00k13",
"session": "s3ss10n"
},
"nested": [
{
"entity": "child",
"data": {
"is": "subordinated"
}
}
],
"consent": {
"functional": true
},
"id": "1700000104abcdef",
"trigger": "test",
"entity": "demo",
"action": "request",
"timestamp": 1700000104000,
"timing": 3.14,
"source": {
"count": 1,
"trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"type": "collector",
"schema": "4"
}
}{
"settings": {
"conversion": {
"map": {
"id": {
"value": 44444
},
"eventId": "id"
}
}
}
}lintrk("track", {
"conversion_id": 44444,
"event_id": "1700000104abcdef"
})Ecommerce conversion
A completed order fires a LinkedIn lintrk track with conversion_id, value, currency, and event_id for deduplication.
{
"name": "order complete",
"data": {
"id": "0rd3r1d",
"currency": "EUR",
"value": 462,
"tax": 73.76,
"shipping": 5.22,
"total": 467.22
},
"context": {
"shopping": [
"complete",
0
]
},
"globals": {
"pagegroup": "shop"
},
"custom": {
"completely": "random"
},
"user": {
"id": "us3r",
"device": "c00k13",
"session": "s3ss10n"
},
"nested": [
{
"entity": "product",
"data": {
"id": "ers",
"name": "Everyday Ruck Snack",
"color": "black",
"size": "l",
"price": 420
},
"context": {
"shopping": [
"complete",
0
]
},
"nested": []
},
{
"entity": "product",
"data": {
"id": "cc",
"name": "Cool Cap",
"size": "one size",
"price": 42
},
"context": {
"shopping": [
"complete",
0
]
},
"nested": []
},
{
"entity": "gift",
"data": {
"name": "Surprise"
},
"context": {
"shopping": [
"complete",
0
]
},
"nested": []
}
],
"consent": {
"functional": true
},
"id": "1700000102abcdef",
"trigger": "load",
"entity": "order",
"action": "complete",
"timestamp": 1700000102000,
"timing": 3.14,
"source": {
"count": 1,
"trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"type": "collector",
"schema": "4"
}
}{
"settings": {
"conversion": {
"map": {
"id": {
"value": 67890
},
"value": "data.value",
"currency": {
"key": "data.currency",
"value": "EUR"
},
"eventId": "id"
}
}
}
}lintrk("track", {
"conversion_id": 67890,
"conversion_value": 462,
"currency": "EUR",
"event_id": "1700000102abcdef"
})Key page view
A page view fires an explicit lintrk track mapped to a LinkedIn KEY_PAGE_VIEW conversion rule.
{
"name": "page view",
"data": {
"domain": "www.example.com",
"title": "walkerOS documentation",
"referrer": "https://www.walkeros.io/",
"search": "?foo=bar",
"hash": "#hash",
"id": "/docs/"
},
"context": {
"dev": [
"test",
1
]
},
"globals": {
"pagegroup": "docs"
},
"custom": {
"completely": "random"
},
"user": {
"id": "us3r",
"device": "c00k13",
"session": "s3ss10n"
},
"nested": [
{
"entity": "child",
"data": {
"is": "subordinated"
}
}
],
"consent": {
"functional": true
},
"id": "1700000103abcdef",
"trigger": "load",
"entity": "page",
"action": "view",
"timestamp": 1700000103000,
"timing": 3.14,
"source": {
"count": 1,
"trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"type": "collector",
"schema": "4"
}
}{
"settings": {
"conversion": {
"map": {
"id": {
"value": 11111
},
"eventId": "id"
}
}
}
}lintrk("track", {
"conversion_id": 11111,
"event_id": "1700000103abcdef"
})Simple conversion
A form submit fires a LinkedIn lintrk track with only a conversion_id from Campaign Manager.
{
"name": "form submit",
"data": {
"string": "foo",
"number": 1,
"boolean": true,
"array": [
0,
"text",
false
]
},
"context": {
"dev": [
"test",
1
]
},
"globals": {
"lang": "elb"
},
"custom": {
"completely": "random"
},
"user": {
"id": "us3r",
"device": "c00k13",
"session": "s3ss10n"
},
"nested": [
{
"entity": "child",
"data": {
"is": "subordinated"
}
}
],
"consent": {
"functional": true
},
"id": "9b8307d75187a0ec",
"trigger": "test",
"entity": "form",
"action": "submit",
"timestamp": 1700000101000,
"timing": 3.14,
"source": {
"count": 1,
"trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
"type": "collector",
"schema": "4"
}
}{
"settings": {
"conversion": {
"map": {
"id": {
"value": 12345
}
}
}
}
}lintrk("track", {
"conversion_id": 12345
})When it fails
- missing conversion id ignored: A conversion mapping whose id resolves to nothing makes no lintrk call, so the push fails with missing-input instead of counting as delivered. Reported as
failedwith codemissing-input.
Opt-in conversion model
LinkedIn is an opt-in conversion platform. Every tracked event must
reference a pre-created Conversion Rule in Campaign Manager via its numeric
conversion_id. Events without an explicit mapping.settings.conversion
produce zero lintrk calls. This is the opposite of analytics destinations
(Amplitude, Clarity, PostHog) which forward every event by default. Map only
the events that matter for attribution.
Events that no rule sends still count as delivered. To report them as skipped
instead, add a wildcard rule with ignore: true ('*': { '*': { ignore: true } })
and map the events you want, see ignore vs silent.
Falsy guards
The destination protects against misconfigured mappings:
- If
idresolves to nothing,0or a non-numeric string, nolintrkcall is made and the push fails withmissing-input: the push result lists the destination underfailedand the collector writes an ERROR line. A numeric string such as"67890"is sent as a number. value(a number or numeric string),currencyandeventId(non-empty strings) are left out of the call when they resolve to anything else. Avalueof0is sent.
Consent
LinkedIn is an advertising platform. The walkerOS consent key is marketing
(not analytics):
config: {
consent: { marketing: true },
loadScript: true,
settings: { apiKey: '123456' },
}With this config.consent, until marketing is granted, the collector holds
the destination's events in a queue and sends them once consent is granted, see
consent management. The Insight Tag itself has no
vendor opt-out API: after a revocation, walkerOS holds new events again, but
the loaded tag stays in the page.
Deferred script load
With loadScript: true and config.consent, the Insight Tag loads only after
consent is granted: the destination initializes, and injects the tag, once
marketing is granted. walkerOS injects the tag once per page. If your page
already embeds the Insight Tag snippet, leave loadScript off (the default):
the destination then only sets the partner ID and, if the page has none yet,
the lintrk queue, and sends its calls through the page's tag. With both, the
tag loads twice.
Each time the Insight Tag loads, it tracks a page-load conversion by calling
window.lintrk() itself, and it sets first-party cookies for audience
building. The destination has no setting to suppress this. These calls come
from the tag, separate from the conversions you map.
No identity tracking
LinkedIn identity on the web is cookie-based. The Insight Tag manages its
own first-party cookies and matches visitors against LinkedIn member profiles
server-side. There is no lintrk('identify', ...) API. The destination does
not forward user IDs, emails, phone numbers, or the li_fat_id click ID.
The server LinkedIn destination sends
conversions through the Conversions API with eventId set to the event's id
and can forward li_fat_id. To
deduplicate
conversions sent from both, LinkedIn needs a separate conversion rule for each
data source: the Insight Tag rule's ID goes in conversion.id here, the
Conversions API rule's ID in the server destination's conversionRuleId. Map
eventId: 'id' here, as the Ecommerce conversion example above does, so both
send the same event ID.
LinkedIn then counts a conversion it receives from both once, under the Insight
Tag rule.