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:
dynamicValueParametersmap 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.customValueParametersmap 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.
Call GET /v1/ads/{adId}/tracking-tags with the Zernio _id of an ad in the campaign.
import Zernio from '@zernio/node';
const zernio = new Zernio();
const { data: tags } = await zernio.trackingtags.getAdTrackingTags({
path: { adId: '66f0a1b2c3d4e5f6a7b8c9d0' }
});
console.log(tags.dynamicValueParameters);Response (200):
{
"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.
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);Response (200):
{
"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.
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:
{
"error": "Ad not found",
"type": "not_found",
"code": "ad_not_found",
"param": "adId"
}Related
- Create ads: where the ad
_idcomes from. - Insight Tag: the site tag and its conversion rules, which is a different thing.
- Meta Ads tracking tags and Google Ads tracking tags: the same endpoint on the other networks.
- Get ad tracking tags and Set ad tracking tags: every field.
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.
Manage ads
Pause and resume LinkedIn campaign groups, campaigns and creatives, change a campaign's budget, swap a creative's media, rename, duplicate and delete.