Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Warning
Deprecation Notice: The Marketing Version 202504 (Marketing April 2025) has been sunset. We recommend that you migrate to the latest versioned APIs to avoid disruptions. For information on all the supported versions, refer to the migrations documentation. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.
Seamless tracking across multiple campaigns and platforms is a core part of enabling advertisers to prove ROI. UTM codes are parameters added to the end of a URL to track the success of marketing efforts in driving traffic to a web page.
This feature provides a way to add dynamic tracking parameters to the landing page URLs of ad creatives.
Note
- Tracking parameters can be set on the
Campaignlevel. - Tracking parameters set on
Campaignwill affect the landing page URLs of ad creatives under thatCampaign. - Existing tracking parameters of a
Campaignwill be applied to all new creatives created under it. - An update to the tracking parameters of a
Campaignwith running ads will have the updated tracking parameters applied to all creatives under theCampaign. - A
Creativecan be tracked across multiple campaigns if dynamic tracking parameters are configured on these campaigns. - If static UTM Tracking was configured on the creative, for example
utm_abc=123and dynamic UTM parameters were configured at theCAMPAIGNlevel ascampaign=CAMPAIGN_ID, then the effective served URL will have the assignment:utm_abc=123&campaign=1234567. You must ensure uniqueness of the dynamic UTM parameters, and if a static UTM key was already present using the UTM Parameters (legacy) api, you should change from the UGC Posts and Shares API. Additionally, remove that static assignment to avoid multiple duplicate UTM parameters in the URL. - The ad won't require review again.
- Existing shortened URLs will be appended with dynamic tracking parameters before the ad is rendered. If the shortened URL has existing static UTM parameters, those will be appended with dynamic tracking parameters too.
- The following creative formats are currently unsupported:
- Conversation Ads
- Lead Generation Form Ads
- Message Ads
Permissions
| Permission | Description |
|---|---|
| rw_ads | Manage and read an authenticated member's ad accounts. Restricted to ad accounts in which the authenticated member has one of the following ad account roles: ACCOUNT_BILLING_ADMINACCOUNT_MANAGERCAMPAIGN_MANAGERCREATIVE_MANAGER |
| r_ads | Read an authenticated member's ad accounts. Restricted to ad accounts in which the authenticated member has one of the following ad account roles: ACCOUNT_BILLING_ADMINACCOUNT_MANAGERCAMPAIGN_MANAGERCREATIVE_MANAGERVIEWER |
See Account Access Controls for more information on ad account roles.
Create Tracking Parameters For a Campaign
Note
X-Restli-Protocol-Version: 2.0.0must be passed as the header in your API requests.Linkedin-Version: {yyyymm}must be passed as the header in your API requests as this API is released with Versioning.
Creating Tracking parameters on an existing Campaign can be done by calling the /adTrackingParameters API as below:
- Two types of tracking parameters can be set:
dynamicTrackingParametersandcustomTrackingParameters. dynamicTrackingParametersare of the format:any_string_key->AdDynamicTrackingParameterValue. The value ofdynamicTrackingParametersneeds to be of typeAdDynamicTrackingParameterValue. These values are resolved and the actual values will be substituted before appending the parameters to the landing page URL.customTrackingParametersare of the format:any_string_key->any_string_value. These parameters are appended as it's to the landing page URL.AdDynamicTrackingParameterValuecurrently supports the following enum:ACCOUNT_IDACCOUNT_NAMECAMPAIGN_GROUP_IDCAMPAIGN_GROUP_NAMECAMPAIGN_IDCAMPAIGN_NAMECREATIVE_ID
PUT https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:{sponsoredCampaignURN}))
{
"dynamicValueParameters": {
"accountId":"ACCOUNT_ID",
"campaign_name": "CAMPAIGN_NAME",
"cg_id": "CAMPAIGN_GROUP_ID"
},
"customValueParameters": {
"any_custom":"any_value",
"source":"LinkedIn"
}
}
A successful request returns 201 CREATED. If sponsoredCampaignUrn is malformed, then a error 400 Bad Request status code is returned.
Sample Request
PUT https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:urn%3Ali%3AsponsoredCampaign%3A12345))
{
"dynamicValueParameters": {
"utm_campaign": "CAMPAIGN_NAME",
"utm_campaign_id": "CAMPAIGN_ID",
"utm_campaign_group_id": "CAMPAIGN_GROUP_ID",
"utm_creative_id": "CREATIVE_ID"
},
"customValueParameters": {
"utm_source":"linkedin",
"utm_medium":"social"
}
}
Get Tracking Parameters of a Campaign
To retrieve existing tracking parameters of a campaign:
GET https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:{sponsoredCampaignURN}))
Sample Response
{
"dynamicValueParameters": {
"campaign_name": "CAMPAIGN_NAME",
"cg_id": "CAMPAIGN_GROUP_ID",
"account_id": "ACCOUNT_ID"
},
"idempotencyToken": "1653526665978",
"changeTimeStamps": {
"created": 1653526665978,
"lastModified": 1653526665978
},
"customValueParameters": {
"any_custom": "value_1",
"source": "LinkedIn"
},
"adEntity": {
"sponsoredCampaign": "urn:li:sponsoredCampaign:366948955"
}
}
Update Tracking Parameters For a Campaign
Update the Tracking parameters on a Campaign with existing parameters by performing the following steps:
- Retrieve an existing tracking parameters by Campaign URN.
GET https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:{sponsoredCampaignURN}))
Sample Response
{
"dynamicValueParameters": {
"campaign_name": "CAMPAIGN_NAME",
"cg_id": "CAMPAIGN_GROUP_ID",
"account_id": "ACCOUNT_ID"
},
"idempotencyToken": "1653526665978",
"changeTimeStamps": {
"created": 1653526665978,
"lastModified": 1653526665978
},
"customValueParameters": {
"any_custom": "value_1",
"source": "LinkedIn"
},
"adEntity": {
"sponsoredCampaign": "urn:li:sponsoredCampaign:366948955"
}
}
- Extract
idempotencyTokenfrom the response. This must be passed in a query parameter for update. - Use the new parameter mapping to be set on the
Campaignand call the Update API as below.
Note
A successful request returns 200 OK. If the idempotencyToken doesn't match, a 409 CONFLICT error is returned. This means the tracking parameter mapping has been updated after your GET call. Perform the GET operation again and use the new idempotencyToken.
PUT https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:{sponsoredCampaignURN}))?idempotencyToken=1653526665978
{
"dynamicValueParameters": {
"accountId":"ACCOUNT_ID",
"cg": "CAMPAIGN_ID",
"cg_id": "CAMPAIGN_GROUP_ID"
},
"customValueParameters": {
"any_custom_new":"any_value_new" },
"adEntity": {"sponsoredCampaign": "urn:li:sponsoredCampaign:123444678" }
}
Delete Tracking Parameters of a Campaign
To delete existing tracking parameters of a campaign:
DELETE https://api.linkedin.com/rest/adTrackingParameters/(adEntity:(sponsoredCampaign:{sponsoredCampaignURN}))
Sample Response
A successful request returns 204 NO CONTENT.