---
title: "LinkedIn Insight Tag · Nuxt Scripts"
description: "Track LinkedIn Ads conversions, enhanced matching, and SPA page views."
canonical_url: "https://scripts.nuxt.com/scripts/linkedin-insight"
meta:
  "og:description": "Track LinkedIn Ads conversions, enhanced matching, and SPA page views."
  "og:image": "https://scripts.nuxt.com/_og/s/o_db37875360aa6cfb.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "LinkedIn Insight Tag · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_db37875360aa6cfb.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Scripts**

# **LinkedIn Insight Tag**

[Copy for LLMs](https://scripts.nuxt.com/scripts/linkedin-insight.md)

The [**LinkedIn Insight Tag**](https://business.linkedin.com/marketing-solutions/insight-tag) tracks conversions and sends audience signals to LinkedIn Ads.

[`**useScriptLinkedInInsight()**`](https://scripts.nuxt.com/scripts/linkedin-insight) registers the partner ID and exposes the `**lintrk**` command queue.

**LinkedIn Insight Tag**

[**View source **](https://github.com/nuxt/scripts/blob/main/packages/script/src/runtime/registry/linkedin-insight.ts)

## Nuxt Config Setup

Add this to your `**nuxt.config.ts**` to load LinkedIn Insight Tag globally. Alternatively you can use the **useScriptLinkedInInsight** composable for more control.

```
export default defineNuxtConfig({
  scripts: {
    registry: {
      linkedinInsight: {
        trigger: 'onNuxtReady',
      }
    }
  }
})
```

This config automatically enables **first-party mode ** (bundle + proxy). See below to customise.

## useScriptLinkedInInsight()

The `**useScriptLinkedInInsight**` composable lets you have fine-grain control over when and how LinkedIn Insight Tag is loaded on your site.

```
const { proxy } = useScriptLinkedInInsight()
```

Please follow the [**Registry Scripts **](https://scripts.nuxt.com/docs/guides/registry-scripts) guide to learn more about advanced usage.

## First-Party Mode: Privacy Focused Proxy

No extra config needed. The script is bundled from your domain (faster loads, no extra DNS lookup) and runtime requests are reverse-proxied through your server with automatic anonymisation (user IPs stay hidden from LinkedIn Insight Tag, works with ad blockers). [**Learn more. **](https://scripts.nuxt.com/docs/guides/first-party)

**Mode**

Bundle Proxy Partytown

**Privacy**

All identifying data is stripped: IP, user agent, language, screen size, timezone, and hardware fingerprints.

```
export default defineNuxtConfig({
  scripts: {
    // ✅ First-party mode: bundled + proxied
    registry: {
      linkedinInsight: {
        trigger: 'onNuxtReady',
      },
    },
  },
})
```

## Example

Using LinkedIn Insight Tag in a component with the proxy to send events .

ConversionButton.vue

```
<script setup lang="ts">
const { proxy } = useScriptLinkedInInsight()

// noop in development, ssr
// just works in production, client
function handleAction() {
  // use proxy methods here
}
</script>

<template>
  <div>
    <button @click="handleAction">
      Send Event
    </button>
  </div>
</template>
```

`**id**``string | string[]`** required **

Your LinkedIn Insight Tag Partner ID, or an array of Partner IDs to push onto window.\_linkedin\_data\_partner\_ids. The first ID is used as the primary \_linkedin\_partner\_id global.

`**eventId**``string`

Optional page-load event ID for Conversions API deduplication. Assigned to window.\_linkedin\_event\_id BEFORE the Insight Tag base code runs. Must match the eventId sent with the corresponding server-side Conversions API event. Per-event conversion deduplication uses the per-call event\_id passed to lintrk('track', { conversion\_id, event\_id }) instead.

`**enableAutoSpaTracking**``boolean` = false

Auto-fire lintrk('track') on Vue Router route changes (SPA virtual page views). When true, suppresses the script's built-in auto-page-view via window.\_wait\_for\_lintrk and tracks every navigation including the initial page through Nuxt's page:finish hook. When false, the script fires its own page-view exactly once on load and SPA navigations are not tracked unless lintrk('track') is called manually.

## Examples

### Tracking a conversion

```vue
<script setup lang="ts">
const { proxy } = useScriptLinkedInInsight({
  id: '111143',
})

function trackPurchase() {
  proxy.lintrk('track', { conversion_id: 1111111177 })
}
</script>
```

### Per-event deduplication with the Conversions API

When you also send conversions through LinkedIn's server-side Conversions API, pass the same `**event_id**` to both. LinkedIn discards the server-side duplicate and counts the Insight Tag event. See [**LinkedIn deduplication**](https://learn.microsoft.com/en-us/linkedin/marketing/conversions/deduplication?view=li-lms-2026-01).

```vue
<script setup lang="ts">
const { proxy } = useScriptLinkedInInsight({
  id: '111143',
})

function trackSignup() {
  const eventId = crypto.randomUUID()
  proxy.lintrk('track', { conversion_id: 1111111177, event_id: eventId })
  // Send the same eventId to your server-side Conversions API call.
}
</script>
```

### Page-load conversion deduplication

For dedup on the auto-fired page-view, set `**eventId**` at registration. The composable assigns `**window._linkedin_event_id**` *before* the Insight Tag base code runs, so the page-view URL includes `**&eventId=…**` automatically.

```vue
<script setup lang="ts">
useScriptLinkedInInsight({
  id: '111143',
  eventId: 'page-load-event-id-123',
})
</script>
```

### Enhanced matching with `**setUserData**`

Pass plain email; the Insight Tag SHA-256 hashes it on-device. See [**LinkedIn enhanced matching**](https://www.linkedin.com/help/lms/answer/a6246095).

```vue
<script setup lang="ts">
const { proxy } = useScriptLinkedInInsight({
  id: '111143',
})

function onSignupSuccess(email: string) {
  proxy.lintrk('setUserData', { email })
}
</script>
```

### SPA virtual page views

By default, the Insight Tag fires a page-view exactly once when the script loads, so SPA route changes go untracked. Opt in to per-route tracking with `**enableAutoSpaTracking**`:

```vue
<script setup lang="ts">
useScriptLinkedInInsight({
  id: '111143',
  enableAutoSpaTracking: true,
})
</script>
```

When enabled, the composable suppresses the script's built-in automatic page view (with `**window._wait_for_lintrk = true**`) and fires `**lintrk('track')**` on Nuxt's `**page:finish**` hook. Under the standard `**<NuxtPage />**` lifecycle, this produces one `**/collect**` beacon for each route, including the initial page. Keep-alive or overlapping page transitions can register multiple hooks, so call the composable once from a long-lived component in those setups.

### Multiple partner IDs

If you need to push more than one Partner ID onto `**window._linkedin_data_partner_ids**`, pass an array. The composable promotes the first ID to the primary `**_linkedin_partner_id**` global.

```vue
<script setup lang="ts">
useScriptLinkedInInsight({
  id: ['111143', '111154'],
})
</script>
```

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/linkedin-insight.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/linkedin-insight.md)

[**Lemon Squeezy** Load Lemon.js or turn checkout links into lazy overlay triggers.](https://scripts.nuxt.com/scripts/lemon-squeezy) [**Example: Delivery Tracker** Build a production-shaped delivery tracker with reactive route progress, map fallbacks, and an accessible status alternative.](https://scripts.nuxt.com/scripts/maplibre/guides/delivery-tracker)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/linkedin-insight#webpage","@type":"WebPage","description":"Track LinkedIn Ads conversions, enhanced matching, and SPA page views.","name":"LinkedIn Insight Tag","url":"https://scripts.nuxt.com/scripts/linkedin-insight","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/linkedin-insight#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/linkedin-insight"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/linkedin-insight#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"LinkedIn Insight Tag","item":"https://scripts.nuxt.com/scripts/linkedin-insight","position":3}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
