lads_get_creative_analytics
LinkedIn Ads read low risk
Part of the LinkedIn Campaign Manager Agent.
What it does
Per-creative performance, pivoting on CREATIVE via GET /rest/adAnalytics. Returns one row per creative (urn:li:sponsoredCreative) with impressions, clicks, costInUsd/costInLocalCurrency, landingPageClicks, oneClickLeads, externalWebsiteConversions, videoViews and videoCompletions, plus a derived block per row (lp_ctr, lp_cpc, cpv as decimal strings). ACCURACY NOTES: compare each creative on its FORMAT-APPROPRIATE metric (LP CTR for inbound/TL, view-rate/quartiles for video, open/click for messaging) and never on one blended CTR across formats. Cost fields are strings (parse to Decimal; no micros). Reconciles to Campaign Manager. Optional prior-period delta per creative.
When to use it
During a full account audit, start with lads_audit_account — it defines the checks, benchmarks, and severity rules this tool's data feeds.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
account | urn:li:sponsoredAccount|string | yes | Owning account (must be in bearer scope). Bare id wrapped to urn:li:sponsoredAccount:{id}. |
creatives | array<urn:li:sponsoredCreative|int> | no | Specific creatives; omit to report all creatives under the campaigns/account scope. Bare ids wrapped to URNs. |
campaigns | array<urn:li:sponsoredCampaign|int> | no | Optional campaign filter to scope which creatives are reported. |
date_range | string|object | yes | Inclusive window {start:{year,month,day},end:{...}}. Accepts either "YYYY-MM-DD,YYYY-MM-DD" (or a single "YYYY-MM-DD" = start only) OR the object {start:{year,month,day}[, end:{year,month,day}]}; month/day are 1-based integers. |
time_granularity | enum(ALL|DAILY|MONTHLY|YEARLY) | no | Default ALL. DAILY multiplies element count across creatives. |
fields | array<string> | no | Override metric list (max 18 metrics; pivotValues and dateRange are always added and do not count). It REPLACES the default set, so list every default metric you still want. Default: pivotValues, dateRange, impressions, clicks, costInLocalCurrency, costInUsd, landingPageClicks, oneClickLeads, externalWebsiteConversions, videoViews, videoCompletions. |
include_prior_period | bool | no | If true, a second call covers the equal-length window immediately before date_range (which must be 'YYYY-MM-DD,YYYY-MM-DD') and each element gains prior_period {date_range, metrics, delta_pct} matched by pivot; a zero prior yields null, never 0. A DAILY/MONTHLY/YEARLY time series (several rows per entity) skips the deltas with a warning: use time_granularity ALL. |
Safeguards
Policy
Rank and report creatives only for the authorizing client; treat each ad format as a distinct entity with its own metric/benchmark and never blend formats when comparing creatives. AI-generated creative must be disclosed and must not depict deepfakes of real people.
Reminder
Use the per-format metric (LP CTR / quartiles / opens), match Campaign Manager, parse cost strings to Decimal, and retain no member-level data.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CREATIVE_NOT_FOUND | One or more creative URNs do not exist or are not in this account. | Verify creative ids; drop unknown ids before retry. | no |
INVALID_ARGUMENT | LinkedIn rejected a parameter (surfaced verbatim), e.g. un-encoded URN or bad dateRange. | Surface the message; correct the param. Do not guess. | no |
TOKEN_REVOKED | Token expired/revoked (HTTP 401). | Refresh once and retry; else needs_reauth. | yes |
PERMISSION_DENIED | Missing r_ads_reporting or out-of-scope account (HTTP 403). | Confirm scope and authorization. | no |
RATE_LIMITED | Daily reporting quota exceeded (HTTP 429). | Exponential backoff 5/10/20s cap 60s honoring X-RateLimit-Reset. | yes |
PLATFORM_UNAVAILABLE | LinkedIn returned a 5xx. | Retry with backoff. | yes |
Edge cases
- No activity in the window, or no read access to the data -> success with no elements and a note: report no delivery, not zeros.
- LinkedIn returns at most 15,000 rows and does not page: an answer that reaches the cap (many creatives x DAILY) carries a warning that it may be cut short; narrow the window.
- Video creatives report videoViews and videoCompletions by default, plus derived.cpv when they have cost; quartile completions (videoFirstQuartileCompletions, videoMidpointCompletions, videoThirdQuartileCompletions) need fields.
- There is no frequency metric: impressions / approximateMemberReach (request it via fields; windows of 92 days or less) gives a directional frequency for fatigue analysis, not exact reach.
- Cost strings -> Decimal.
- Rows are per creative, not grouped by format: compare creatives within one format, never in a single cross-format ranking.
- Expired token -> refresh and retry once.