> Part of the walkerOS documentation. Project overview and full index: <https://www.walkeros.io/llms.txt>

# LinkedIn Insight Tag

<!-- -->

[Web](#)[ ](https://github.com/elbwalker/walkerOS/tree/main/packages/web/destinations/linkedin)

<!-- -->

[Source code](https://github.com/elbwalker/walkerOS/tree/main/packages/web/destinations/linkedin)[ ](https://www.npmjs.com/package/@walkeros/web-destination-linkedin)

<!-- -->

[Package](https://www.npmjs.com/package/@walkeros/web-destination-linkedin)

The [LinkedIn Insight Tag](https://www.linkedin.com/help/lms/answer/a427660) 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.

<!-- -->

Where this fits

LinkedIn Insight Tag is a **web destination** in the walkerOS flow:

## Installation[​](#installation "Direct link to Installation")

```
npm install @walkeros/web-destination-linkedin
```

* Integrated
* Bundled

```
import { startFlow } from '@walkeros/collector';
import { destinationLinkedIn } from '@walkeros/web-destination-linkedin';

await startFlow({
  consent: { marketing: false },
  destinations: {
    linkedin: {
      code: destinationLinkedIn,
      config: {
        consent: { marketing: true },
        loadScript: true,
        settings: {
          apiKey: '123456',
        },
        mapping: {
          order: {
            complete: {
              settings: {
                conversion: {
                  map: {
                    id: { value: 67890 },
                    value: 'data.total',
                    currency: { key: 'data.currency', value: 'EUR' },
                    eventId: 'id',
                  },
                },
              },
            },
          },
        },
      },
    },
  },
});
```

Add to your `flow.json` destinations:

```
"destinations": {
  "linkedin": {
    "package": "@walkeros/web-destination-linkedin",
    "config": {
      "consent": { "marketing": true },
      "loadScript": true,
      "settings": {
        "apiKey": "123456"
      }
    }
  }
}
```

[See bundled mode setup](https://www.walkeros.io/docs/getting-started/modes/bundled.md) | [CLI reference](https://www.walkeros.io/docs/apps/cli.md)

## Configuration[​](#configuration "Direct link to Configuration")

This <!-- -->destination<!-- --> uses the standard <!-- -->destination<!-- --> config wrapper (consent, data, env, id, ...). For the shared fields see [destination<!-- --> configuration](https://www.walkeros.io/docs/destinations.md#configuration). Package-specific fields live under `config.settings` and are listed below.

## Settings[​](#settings "Direct link to 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). |      |

\* Required fields

## Mapping[​](#mapping "Direct link to Mapping")

Per-event rules under `config.mapping`. For the standard rule fields (consent, condition, data, batch, name, policy) see [mapping](https://www.walkeros.io/docs/mapping.md).

| 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 for deduplication with a future server/Conversions API destination) }. Events without a resolved id are silently ignored. |      |

## Examples

### Lead conversion

A demo request fires a LinkedIn lintrk track for a lead conversion with id and event\_id only.

Event

```
{
  "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": 1700000104,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "collector",
    "schema": "4"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "id": {
          "value": 44444
        },
        "eventId": "id"
      }
    }
  }
}
```

Out

```
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.

Event

```
{
  "name": "order complete",
  "data": {
    "id": "0rd3r1d",
    "currency": "EUR",
    "shipping": 5.22,
    "taxes": 73.76,
    "total": 555
  },
  "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": 1700000102,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "collector",
    "schema": "4"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "id": {
          "value": 67890
        },
        "value": "data.total",
        "currency": {
          "key": "data.currency",
          "value": "EUR"
        },
        "eventId": "id"
      }
    }
  }
}
```

Out

```
lintrk("track", {
  "conversion_id": 67890,
  "conversion_value": 555,
  "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.

Event

```
{
  "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": 1700000103,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "collector",
    "schema": "4"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "id": {
          "value": 11111
        },
        "eventId": "id"
      }
    }
  }
}
```

Out

```
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.

Event

```
{
  "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": "a50e283e4c8558e1",
  "trigger": "test",
  "entity": "form",
  "action": "submit",
  "timestamp": 1700000101,
  "timing": 3.14,
  "source": {
    "count": 1,
    "trace": "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
    "type": "collector",
    "schema": "4"
  }
}
```

Mapping

```
{
  "settings": {
    "conversion": {
      "map": {
        "id": {
          "value": 12345
        }
      }
    }
  }
}
```

Out

```
lintrk("track", {
  "conversion_id": 12345
})
```

## Opt-in conversion model[​](#opt-in-conversion-model "Direct link to 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.

## Falsy guards[​](#falsy-guards "Direct link to Falsy guards")

The destination protects against misconfigured mappings:

* If `id` resolves to falsy or `0` the entire `lintrk` call is skipped (no silent error or partial conversion).
* If `value` / `currency` / `eventId` resolve to falsy, those individual fields are dropped from the call. `id` is always required.

## Consent[​](#consent "Direct link to Consent")

LinkedIn is an advertising platform. The walkerOS consent key is **`marketing`** (not `analytics`):

```
config: {
  consent: { marketing: true },
  loadScript: true,
  settings: { apiKey: '123456' },
}
```

The walkerOS `config.consent` gate blocks unconsented events from reaching the destination in the first place. The Insight Tag itself has no vendor opt-out API. When consent is later revoked, walkerOS stops sending events, but the loaded tag stays in the page.

### Deferred script load[​](#deferred-script-load "Direct link to Deferred script load")

If you want the Insight Tag to load **only** after consent is granted, set `loadScript: true` and leave `config.consent.marketing` un-granted at init time. The destination will skip `addScript()` during init and inject the script the first time an `on('consent')` event grants `marketing`. The handler is idempotent. If a `<script src="...snap.licdn.com...">` already exists in the DOM, no second injection happens.

Auto page view + retargeting

The Insight Tag fires its own page view on load and drops first-party cookies for audience building. The destination has no knob to suppress this. It is the expected behavior for retargeting, separate from explicit conversion tracking.

## No identity tracking[​](#no-identity-tracking "Direct link to 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.

A future `@walkeros/server-destination-linkedin` (Conversions API) will consume `li_fat_id` from the session source for advanced matching, sharing the `event_id` field for browser/server deduplication.

## Related[​](#related "Direct link to Related")

* [LinkedIn Insight Tag documentation](https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/conversions/)
* [Bundled mode](https://www.walkeros.io/docs/getting-started/modes/bundled.md)
