> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Insight Tag

Read, create and share a LinkedIn Insight Tag, manage its conversion rules, check when it last fired, and install it on Shopify or WordPress.

The LinkedIn Insight Tag is the site tag behind LinkedIn website conversions and retargeting.

## Read the tag

Zernio exposes it under the platform-neutral [tracking tags API](/guides/pixels) on your `linkedinads` connection.

With it you can:

- Read or create an ad account's tag
- Turn first-party tracking on or off
- Manage the conversion rules a page fires
- Share the tag with other ad accounts
- Install it on a connected [Shopify](/platforms/shopify/tracking-pixels) store or [WordPress](/platforms/wordpress/tracking-pixels) site

This page covers the site tag. A campaign's Dynamic UTM parameters are on [URL tracking tags](/platforms/linkedin-ads/url-tracking).

`GET /v1/accounts/{accountId}/tracking-tags` lists one tag per active ad account on the connection.

`GET .../tracking-tags/{tagId}` adds:

- the base `code`
- `lastFiredTime`, the latest callback across the tag's domains (`null` when it never fired)
- `installed`
- the ad account's conversion rules as `events`

To create a tag, call `POST /v1/accounts/{accountId}/tracking-tags` with `adAccountId`. It is idempotent on LinkedIn: when the ad account already has an Insight Tag, it returns that tag instead of creating another.

`name` is required by the endpoint but ignored, because LinkedIn tags have no name.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data } = await zernio.trackingtags.createTrackingTag({
  path: { accountId: '66b2e19d8c3f5a7e9d0b1c2d' },
  body: { adAccountId: '517258773', name: 'Insight Tag' }
});
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

data = client.tracking_tags.create_tracking_tag(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="517258773",
    name="Insight Tag",
)
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/tracking-tags" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "adAccountId": "517258773", "name": "Insight Tag" }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "platform": "linkedinads",
  "tag": {
    "id": "9069513",
    "siteTagId": "9069513",
    "name": "Insight Tag 9069513",
    "platform": "linkedinads",
    "kind": "insight_tag",
    "status": "active",
    "ownerAdAccountId": "517258773",
    "code": "<script type=\"text/javascript\">\n_linkedin_partner_id = \"9069513\";...</script>",
    "lastFiredTime": 1804150800,
    "installed": true,
    "events": [
      { "id": "30828442", "name": "Purchase", "type": "PURCHASE", "status": "active", "siteEvent": "purchase", "siteEventId": "30828442", "defaultValue": 50, "currency": "USD", "clickWindowDays": 30, "viewWindowDays": 7 }
    ]
  }
}
```

`PATCH .../tracking-tags/{tagId}` accepts only `firstPartyCookieStatus`. It maps to LinkedIn's first-party tracking switch: `first_party_cookie_enabled` or `first_party_cookie_disabled`.

`empty` answers `400`, because the switch has no unset state.

## Ids

| Field | Value |
|-------|-------|
| `accountId` | The `linkedinads` connection |
| `tagId` | The Insight Tag's partner id (numeric). The API id is the id the site embeds, so `siteTagId` equals `id`. |
| `adAccountId` | A LinkedIn ad account id, numeric or `urn:li:sponsoredAccount:<id>`. Conversion rules and domains live under an ad account; per-tag calls default to the account that owns the tag. |
| `events[].id` | The conversion rule id. For rules a page can fire, `siteEventId` is the same id (the `conversionId` a page sends). |

`kind` is `insight_tag`. An ad account holds at most one Insight Tag.

The tag has no name of its own, so Zernio returns `Insight Tag <id>`.

## Conversion rules

LinkedIn conversions are separate rules owned by an ad account. Zernio exposes them as the tag's events on `/tracking-tags/{tagId}/events`.

Pass `adAccountId` when the rules you want are not on the account that owns the tag.

| Operation | Behavior |
|-----------|----------|
| List | Every conversion rule of the ad account, enabled or not (`status` `active` or `inactive`). |
| Create | Creates an event-specific Insight Tag rule, the kind a page fires by id. Not idempotent. |
| Update | Partial update of any field below. |
| Delete | Disables the rule (`state: "disabled"`); `PATCH` with `enabled: true` turns it back on. LinkedIn has no delete for rules (`DELETE /rest/conversions/{id}` has no route). |

The body takes:

- `name`
- a LinkedIn conversion type in `type` (`PURCHASE`, `ADD_TO_CART`, `LEAD`, `SIGN_UP`, `KEY_PAGE_VIEW`, ...) or a `siteEvent`
- `enabled`
- `defaultValue` with `currency`, both together, in the ad account's currency. The event's own value wins when it carries one.
- `clickWindowDays` and `viewWindowDays`

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data } = await zernio.trackingtags.createTrackingTagEvent({
  path: { accountId: '66b2e19d8c3f5a7e9d0b1c2d', tagId: '9069513' },
  body: { name: 'Purchase', siteEvent: 'purchase', defaultValue: 50, currency: 'USD', clickWindowDays: 30, viewWindowDays: 7 }
});
```
</Tab>
<Tab value="Python">
```python
data = client.tracking_tags.create_tracking_tag_event(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    tag_id="9069513",
    name="Purchase",
    site_event="purchase",
    default_value=50,
    currency="USD",
    click_window_days=30,
    view_window_days=7,
)
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/tracking-tags/9069513/events" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Purchase", "siteEvent": "purchase", "defaultValue": 50, "currency": "USD", "clickWindowDays": 30, "viewWindowDays": 7 }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "platform": "linkedinads",
  "event": { "id": "30828442", "name": "Purchase", "type": "PURCHASE", "status": "active", "siteEvent": "purchase", "siteEventId": "30828442", "defaultValue": 50, "currency": "USD", "clickWindowDays": 30, "viewWindowDays": 7 }
}
```

Rules for the [Conversions API](/platforms/linkedin-ads/conversions) and URL-match rules cannot be fired by id from a page. They carry no `siteEventId` or `siteEvent`.

**`page_view`** maps to `KEY_PAGE_VIEW` on create, but the Shopify install never fires it. The base tag already reports every page, and a key-page-view rule on every page would count each visit as a conversion.

## Share with other ad accounts

`GET`, `POST` and `DELETE .../tracking-tags/{tagId}/shared-accounts` list, grant and revoke other ad accounts' access to the tag. Call them from the ad account that owns it.

A grant gives `USE_ONLY` access. The recipient can use the tag and its conversions but cannot edit, share or unshare it.

`sharedAccounts[]` covers the ad accounts this connection can see, with each account's role in its `name`.

**One tag per account.** LinkedIn allows one Insight Tag per ad account. A grant to an account that already uses another tag answers `400` (LinkedIn itself returns a bare `500` there).

**Last account.** Revoking the last ad account on a tag also answers `400`. LinkedIn would accept it and leave the tag orphaned, so share it with another account first.

## Stats

LinkedIn exposes no fire counts, so `GET .../tracking-tags/{tagId}/stats` is a health check. It returns two kinds of row:

- One per domain the tag has fired on: `kind: "domain"`, `domainName`, `lastFiredTime`, `creationTime`, `blocked`
- One per conversion rule: `kind: "conversion_rule"`, `id`, `name`, `type`, `conversionMethod`, `status`, `lastFiredTime`

## Install on a store

**Shopify.** Every page view goes to `px.ads.linkedin.com/collect`. That is LinkedIn's documented image pixel, with the parameter names `insight.min.js` sends.

Any other storefront event is sent only when the ad account has an enabled, page-fireable rule of the matching type. The most recently fired one wins.

That event goes as a `conversionId` hit with the value, currency, order id and an `eventId`. LinkedIn uses the `eventId` to deduplicate against the Conversions API.

The `li_fat_id` click id is captured from the landing URL. See [the event mapping](/platforms/shopify/tracking-pixels#event-mapping).

**WordPress.** The install adds LinkedIn's Insight Tag base code. LinkedIn has no official WordPress plugin, so a blocked install points to pasting the tag's `code` into the theme.

<Callout type="warn">The Shopify install stores the rule ids it found. Install again after you add or change conversion rules.</Callout>

## What the API cannot do

| Operation | Evidence |
|-----------|----------|
| Delete an Insight Tag | Absent from LinkedIn's docs; `DELETE /rest/insightTags/{id}` has no route. |
| Delete a conversion rule | Absent from the conversion-tracking docs; `DELETE /rest/conversions/{id}` answers `404` "No virtual resource found", so delete disables. |
| Name or rename the tag | Insight Tags have no name field. |
| Fire counts | LinkedIn reports last-callback times only. |

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `400` on `firstPartyCookieStatus` | The value is `empty`, and the switch has no unset state | Send `first_party_cookie_enabled` or `first_party_cookie_disabled` |
| `400` on a share grant | The ad account already uses another Insight Tag, and LinkedIn allows one per account | Revoke the account's current tag first, then grant again |
| `400` on a share revoke | It is the last ad account on the tag, which would leave it orphaned | Share the tag with another account first |
| A page never fires a rule | Conversions API and URL-match rules cannot be fired by id from a page | Create an Insight Tag rule on `/events` |
| Shopify fires the old rules | The install stores the rule ids it found | Install again after you add or change rules |

## Related

- [Pixels and tracking tags](/guides/pixels): the cross-platform model and capability matrix.
- [Conversions](/platforms/linkedin-ads/conversions): server-side events and Conversions API rules.
- [URL tracking tags](/platforms/linkedin-ads/url-tracking): a campaign's Dynamic UTM parameters.
- [List conversion events](/tracking-tags/list-tracking-tag-events) and [Share a tracking tag](/tracking-tags/add-tracking-tag-shared-account): every field.