Third-Party Tracking

Warning

Deprecation Notice
The Marketing Version 202310 (Marketing October 2023) and earlier versions (excluding 202306 and 202307) have been sunset. Additionally, the unversioned APIs will be sunset soon. We recommend that you migrate to the versioned APIs as well as migrate to the new Content and Community Management APIs to avoid disruptions. See the Migration page for more details. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.

LinkedIn's third-party tracking allows you to add a tag from an approved third-party tracking vendor to your LinkedIn Ad Creative to measure your ad performance. LinkedIn currently supports Google DoubleClick reporting and attribution for LinkedIn Sponsored Content, Dynamic Ads (Spotlight Ads only), and Text Ads. See examples of tracking tags and learn how to set up and manage third-party tracking in Campaign Manager.

Note

Using both click tags and URL landing page link wrappers for a Creative results in clicks being double counted. We recommend using click tags as this most accurately captures all ad engagements, not just landing page link clicks.

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_ADMIN
  • ACCOUNT_MANAGER
  • CAMPAIGN_MANAGER
  • CREATIVE_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_ADMIN
  • ACCOUNT_MANAGER
  • CAMPAIGN_MANAGER
  • CREATIVE_MANAGER
  • VIEWER

See Account Access Controls for more information on ad account roles.

Schema

Field Name Type  Description
account Account URN Read-only URN identifying the advertising account associated with the tag. For example, urn:li:sponsoredAccount:502840441.
entity SponsoredCreative URN URN identifying the entity that this third party tracking tag is created for, such as a campaign or creative. For example, urn:li:sponsoredCreative.
event ThirdPartyTrackingEvent The event for which the third party tracking tag should be used. Possible values are IMPRESSION, CLICK.
id long Read-only numerical identifier for the third party tracking tag; synthetic key that should be omitted during creation.
platform ThirdParty Tracking Platform The third party tracking platform for this tag. Possible value is DOUBLECLICK
trackingUrl URL The third-party tracking URL.

Get Third-Party Tracking Tag

Use thirdPartyTrackingTags to retrieve a previously created third-party tracking tag.

Sample Request

GET https://api.linkedin.com/rest/thirdPartyTrackingTags/19664
GET https://api.linkedin.com/v2/thirdPartyTrackingTags/19664

Sample Response

{
    "account": "urn:li:sponsoredAccount:502840441",
    "changeTimeStamps": {
      "created": 1536692090000,
      "lastModified": 1536692090000
    },
    "entity": "urn:li:sponsoredCreative:70572434",
    "event": "IMPRESSION",
    "id": 15084,
    "platform": "DOUBLECLICK",
    "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
}

{
    "account": "urn:li:sponsoredAccount:502840441",
    "changeAuditStamps": {
        "created": {
            "time": 1536692090000
        },
        "lastModified": {
            "time": 1536692090000
        }
    },
    "entity": "urn:li:sponsoredCreative:70572434",
    "event": "IMPRESSION",
    "id": 15084,
    "platform": "DOUBLECLICK",
    "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
}

Create Third-Party Tracking Tag

Third-party tracking tags can be created through the API. First, you'll need to get the tag URL from your third-party tracking vendor.

Note

Impression and click tracker tags are accepted; monitoring or blocking tags are not accepted.

Sample Request

POST https://api.linkedin.com/rest/thirdPartyTrackingTags
{
    "entity": "urn:li:sponsoredCreative:114862845",
    "event": "IMPRESSION",
    "platform": "DOUBLECLICK",
    "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
}
POST https://api.linkedin.com/v2/thirdPartyTrackingTags
{
    "entity": "urn:li:sponsoredCreative:114862845",
    "event": "IMPRESSION",
    "platform": "DOUBLECLICK",
    "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
}

A successful response returns a 201 Created HTTP status code and the ID in the x-linkedin-id response header.

A failed response returns a 400 Bad Request status code. To avoid failures, make sure you verify the following:

  • Platform and event values are enums and should be provided as defined in the schema
  • Ensure your tag includes https

Delete Third-Party Tracking Tag

Sample Request

DELETE https://api.linkedin.com/rest/thirdPartyTrackingTags/19664
DELETE https://api.linkedin.com/v2/thirdPartyTrackingTags/19664

The thirdPartyTrackingTag is deleted and a 204 No Content is returned.

Creative Finder

Third-party tracking tags can be retrieved through the ad creative they're associated with. The following request takes in an ad creative URN in the creative parameter to search for third-party tracking tags linked to that ad creative.

Sample Request

GET https://api.linkedin.com/rest/thirdPartyTrackingTags?creative={Sponsored-Creative-Urn}&q=creative&sortOrder=DESCENDING&totals=true
GET https://api.linkedin.com/v2/thirdPartyTrackingTags?creative={Sponsored-Creative-Urn}&q=creative&sortOrder=DESCENDING&totals=true

Sample Response

{
    "elements": [
        {
            "account": "urn:li:sponsoredAccount:502840441",
            "changeTimeStamps": {
              "created": 1536692090000,
              "lastModified": 1536692090000
            },
            "entity": "urn:li:sponsoredCreative:70572434",
            "event": "IMPRESSION",
            "id": 15084,
            "platform": "DOUBLECLICK",
            "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
        },
        {
            "account": "urn:li:sponsoredAccount:502840441",
            "changeTimeStamps": {
              "created": 1536691506000,
              "lastModified": 1536691506000
            },
            "entity": "urn:li:sponsoredCreative:70572434",
            "event": "IMPRESSION",
            "id": 15074,
            "platform": "DOUBLECLICK",
            "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
        }
    ],
    "paging": {
        "count": 10,
        "links": [],
        "start": 0,
        "total": 0
    }
}
{
    "elements": [
        {
            "account": "urn:li:sponsoredAccount:502840441",
            "changeAuditStamps": {
                "created": {
                    "time": 1536692090000
                },
                "lastModified": {
                    "time": 1536692090000
                }
            },
            "entity": "urn:li:sponsoredCreative:70572434",
            "event": "IMPRESSION",
            "id": 15084,
            "platform": "DOUBLECLICK",
            "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
        },
        {
            "account": "urn:li:sponsoredAccount:502840441",
            "changeAuditStamps": {
                "created": {
                    "time": 1536691506000
                },
                "lastModified": {
                    "time": 1536691506000
                }
            },
            "entity": "urn:li:sponsoredCreative:70572434",
            "event": "IMPRESSION",
            "id": 15074,
            "platform": "DOUBLECLICK",
            "trackingUrl": "https://serverside.doubleclick.net/ddm/trackimp/N8480.281152LINKEDINUS/B20690748.213458830;dc_trk_aid=512607074;dc_trk_cid=107409144;ord=[timestamp];dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?"
        }
    ],
    "paging": {
        "count": 10,
        "links": [],
        "start": 0,
        "total": 0
    }
}