Resolve LinkedIn Ad Library Links to Metadata Ads
resolve_linkedin_ad_library_linksMap LinkedIn Ad Library links (linkedin.com/ad-library/detail/), sponsoredCreative URNs or bare LinkedIn creative ids to the ads in this account's Metadata library, so an ad the user points at by its LinkedIn link can be REUSED in a new campaign instead of rebuilt.
WHAT IT CAN AND CANNOT RESOLVE (repeat this to the user when a link is not found):
- It resolves ONLY ads that were launched THROUGH METADATA. Every ad Metadata
publishes to LinkedIn is recorded with the LinkedIn creative id LinkedIn gave
it, and that id is exactly what the Ad Library link carries. Those come back
with the library ad (id, name, type) plus the experiment and campaign that ran
them, ready to attach by name.
- An ad launched natively in LinkedIn Campaign Manager (a sponsored personal
post, a Thought Leader ad, anything built outside Metadata) is NOT in the
library and CANNOT be imported from the link, by this tool or any other. The
only way to run it here is to rebuild it from its source files (image, video,
PDF) with the ad tools.
- LinkedIn only. Meta or Google ad library links are refused per item.
HOW IT SEARCHES: the platform has no lookup by LinkedIn creative id, so this scans
the account's LinkedIn ads newest first (100 per page, `max_pages` pages, default
20, so the newest 2,000 ads) and stops as soon as every id is found. A miss with
`reached_end: false` means the ad may simply be older than the scan: pass
`campaign_ids` to narrow the scan to the campaigns that ran it, or raise
`max_pages`. A miss with `reached_end: true` means the account never launched
that ad through Metadata.
PARAMETERS:
- links: Ad Library URLs, `urn:li:sponsoredCreative:<id>` URNs or numeric LinkedIn
creative ids (1 to 20 per call).
- campaign_ids: optional wizard campaign ids that restrict the scan.
- max_pages: optional, 1 to 50, default 20.
RETURNS: {success, found, not_found, scanned_ads, scanned_pages, reached_end,
results: [{input, linkedin_creative_id, found: true, library_ad: {id, name, type,
channel, status, image_url}, experiment: {id, name, goal}, campaign: {id, name,
status}, stats: {spend, impressions, clicks, leads}, destination_url, reuse} |
{input, linkedin_creative_id, found: false, reason}]}
NEXT STEPS: attach a found ad by its library NAME through create_campaign /
add_and_edit_campaign_elements (`ads.list`), or read it with
get_ad_details(ids=<library_ad.id>). Never re-upload a found ad's creative: that
creates a duplicate library entry.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | Yes | LinkedIn Ad Library URLs, sponsoredCreative URNs, or numeric LinkedIn creative ids. | |
| max_pages | No | Pages of 100 LinkedIn ads to scan, newest first. Default 20. | |
| campaign_ids | No | Optional wizard campaign ids to restrict the scan to. |