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

# URL tracking tags

Read and set a LinkedIn campaign's Dynamic UTM parameters through GET and PATCH /v1/ads/{adId}/tracking-tags.

By the end of this page, a LinkedIn campaign appends UTM parameters to every creative's landing-page URL.

## Read the parameters

LinkedIn's Dynamic UTM Tracking lives at the campaign level. You operate on it through the ad endpoints by passing any ad in the campaign.

There are two kinds of parameter:

- `dynamicValueParameters` map a key to a LinkedIn token resolved at serve time: `CAMPAIGN_ID`, `CAMPAIGN_NAME`, `CAMPAIGN_GROUP_ID`, `CAMPAIGN_GROUP_NAME`, `CREATIVE_ID`, `ACCOUNT_ID`, `ACCOUNT_NAME`.
- `customValueParameters` map a key to a static string.

These are click-URL parameters, not the site tag.

The LinkedIn Insight Tag you install on a website, with its conversion rules, is on [Insight Tag](/platforms/linkedin-ads/tracking-tag).

Call `GET /v1/ads/{adId}/tracking-tags` with the Zernio `_id` of an ad in the campaign.

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

const zernio = new Zernio();

const { data: tags } = await zernio.trackingtags.getAdTrackingTags({
  path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' }
});

console.log(tags.dynamicValueParameters);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

tags = client.tracking_tags.get_ad_tracking_tags(ad_id="66f0a1b2c3d4e5f6a7b8c9d0")

print(tags["dynamicValueParameters"])
```
</Tab>
<Tab value="curl">
```bash
curl "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0/tracking-tags" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "platform": "linkedinads",
  "level": "campaign",
  "dynamicValueParameters": { "utm_campaign": "CAMPAIGN_NAME" },
  "customValueParameters": { "utm_source": "linkedin" }
}
```

## Set or update them

Call `PATCH /v1/ads/{adId}/tracking-tags` with `dynamicValueParameters`, `customValueParameters` or both.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: updated } = await zernio.trackingtags.updateAdTrackingTags({
  path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' },
  body: {
    dynamicValueParameters: { utm_campaign: 'CAMPAIGN_NAME', utm_content: 'CREATIVE_ID' },
    customValueParameters: { utm_source: 'linkedin', utm_medium: 'paid_social' }
  }
});

console.log(updated.customValueParameters);
```
</Tab>
<Tab value="Python">
```python
updated = client.tracking_tags.update_ad_tracking_tags(
    ad_id="66f0a1b2c3d4e5f6a7b8c9d0",
    dynamic_value_parameters={"utm_campaign": "CAMPAIGN_NAME", "utm_content": "CREATIVE_ID"},
    custom_value_parameters={"utm_source": "linkedin", "utm_medium": "paid_social"},
)

print(updated["customValueParameters"])
```
</Tab>
<Tab value="curl">
```bash
curl -X PATCH "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0/tracking-tags" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dynamicValueParameters": { "utm_campaign": "CAMPAIGN_NAME", "utm_content": "CREATIVE_ID" },
    "customValueParameters": { "utm_source": "linkedin", "utm_medium": "paid_social" }
  }'
```
</Tab>
</Tabs>

Response (`200`):

```json
{
  "platform": "linkedinads",
  "level": "campaign",
  "dynamicValueParameters": { "utm_campaign": "CAMPAIGN_NAME", "utm_content": "CREATIVE_ID" },
  "customValueParameters": { "utm_source": "linkedin", "utm_medium": "paid_social" }
}
```

Parameters set on a campaign apply to all its creatives, existing and new, without re-review.

Conversation, Message and Lead Gen Form ads do not support dynamic UTM parameters.

<Callout type="warn">Static UTMs baked into a creative's own landing-page URL should not reuse the same keys, or they collide.</Callout>

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `404` `ad_not_found` | `adId` matched no ad of yours | Take the `_id` from the create response or from `GET /v1/ads` |
| `403` `ads_allowance_exceeded` on the `PATCH` | The team has no payment method on file and has reached its 500 free live ads | Add a card to resume |
| `405` | The ad's platform has no click-URL tracking surface (TikTok, X, Pinterest). A LinkedIn ad never returns it. | Use a LinkedIn, Meta or Google ad |

The `404` body:

```json
{
  "error": "Ad not found",
  "type": "not_found",
  "code": "ad_not_found",
  "param": "adId"
}
```

## Related

- [Create ads](/platforms/linkedin-ads/create-ads): where the ad `_id` comes from.
- [Insight Tag](/platforms/linkedin-ads/tracking-tag): the site tag and its conversion rules, which is a different thing.
- [Meta Ads tracking tags](/platforms/meta-ads/url-tracking) and [Google Ads tracking tags](/platforms/google-ads/url-tracking): the same endpoint on the other networks.
- [Get ad tracking tags](/tracking-tags/get-ad-tracking-tags) and [Set ad tracking tags](/tracking-tags/update-ad-tracking-tags): every field.