---
title: "LinkedIn Insight Tag"
description: "Use the LinkedIn Insight Tag in your Nuxt app to track conversions, retarget visitors, and learn about your audience."
canonical_url: "https://scripts.nuxt.com/scripts/linkedin-insight"
last_updated: "2026-07-07T14:42:58.784Z"
---

The [LinkedIn Insight Tag](https://business.linkedin.com/marketing-solutions/insight-tag) is a lightweight JavaScript snippet for conversion tracking, retargeting, and audience insights on LinkedIn Ads campaigns.

Nuxt Scripts provides a registry script composable [`useScriptLinkedInInsight()`](/scripts/linkedin-insight) to integrate it in your Nuxt app.

<script-stats>



</script-stats>

<script-docs>



</script-docs>

<script-types>



</script-types>

## 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">
const { proxy } = 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>
```

The Insight Tag stores the hashed email in `localStorage["li_hem"]` and transmits it on the next page-view via a separate POST to `https://px.ads.linkedin.com/wa/...` (the WebsiteActions gateway). The `/collect` URL of the page-view immediately following `setUserData` does not carry it; LinkedIn picks it up on the next full page load when the bootstrap reads it back from `localStorage`.

### 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 auto-page-view (via `window._wait_for_lintrk = true`) and fires `lintrk('track')` on Nuxt's `page:finish` hook instead, so each route (including the initial page) produces exactly one `/collect` beacon.

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