Guides
Campaigns

Targeting

The targetingCriteria format, the facet rules, how to discover values, estimate the audience and look up bid limits.

A campaign's targeting lives in targetingCriteria: an include with clauses AND'ed together, each with facets and values OR'ed, and an optional exclude.

json
{
  "include": {
    "and": [
      { "or": { "urn:li:adTargetingFacet:locations": ["urn:li:geo:106057199"] } },
      { "or": { "urn:li:adTargetingFacet:interfaceLocales": ["urn:li:locale:pt_BR"] } },
      { "or": { "urn:li:adTargetingFacet:seniorities": ["urn:li:seniority:5", "urn:li:seniority:6"] } }
    ]
  },
  "exclude": { "or": { "urn:li:adTargetingFacet:industries": ["urn:li:industry:75"] } }
}

It reads: in Brazil and using LinkedIn in Portuguese and with seniority Manager or Director, excluding one industry.

Rules

RuleError
interfaceLocales and exactly one of locations and profileLocations are requiredMISSING_FIELD (parameterPath /Campaign/targetingCriteria/include urn:li:adTargetingFacet:locations)
include can't be empty; exclude has a single or, no andINVALID_VALUE_FOR_FIELD
A facet can't be in both include and excludeFIELD_CANNOT_BE_BOTH_IN_INCLUDED_AND_EXCLUDED_TARGETING
ageRanges, genders, groups and interfaceLocales are include-onlyINVALID_VALUE_FOR_FIELD
industries/staffCountRanges with employers; seniorities/jobFunctions with titlesINCOMPATIBLE_TARGETING_COMBINATION
Unknown facet or value, or a value of the wrong typeFIELD_VALUE_DOES_NOT_EXIST
Repeated valueINVALID_VALUE_DUPLICATE_EXIST
Segment facets (audienceMatchingSegments, dynamicSegments)501 (Matched Audiences out of scope)

On a DRAFT campaign, the completeness check waits for activation.

Discover facets and values

List targeting facets returns each facet with its URN and the finders that list its values:

json
{ "facetName": "Locations", "adTargetingFacetUrn": "urn:li:adTargetingFacet:locations", "entityTypes": ["GEO"], "availableEntityFinders": ["AD_TARGETING_FACET", "TYPEAHEAD"] }

Search values by prefix, accent-insensitive:

bash
curl -s 'https://linkedin-ads.mimicr.dev/rest/adTargetingEntities?q=typeahead&facet=urn%3Ali%3AadTargetingFacet%3Alocations&query=s%C3%A3o' \
  --header 'Authorization: Bearer <token>' --header 'LinkedIn-Version: 202610' --header 'X-Restli-Protocol-Version: 2.0.0'
json
{
  "elements": [
    { "urn": "urn:li:geo:900000025", "facetUrn": "urn:li:adTargetingFacet:locations", "name": "São Paulo, Brasil" },
    { "urn": "urn:li:geo:900000101", "facetUrn": "urn:li:adTargetingFacet:locations", "name": "São Paulo, São Paulo, Brasil" }
  ],
  "paging": { "start": 0, "count": 10, "links": [], "total": 2 }
}

There is also q=adTargetingFacet (every value of a facet) and q=urns (names of URNs you already have). Any 3-legged token works, no extra scope.

Mimicr's catalog is a subset. Brazil (urn:li:geo:106057199) and the United States (urn:li:geo:103644278) are real LinkedIn ids; the 27 states and the capitals use sandbox-only ids (urn:li:geo:900000…). Seniorities (urn:li:seniority:1 to 10), company size, age and gender ranges follow the docs; the other facets have synthetic values. Don't store sandbox ids as if they were LinkedIn's.

Estimate the audience

bash
curl -s 'https://linkedin-ads.mimicr.dev/rest/audienceCounts?q=targetingCriteriaV2&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Ageo%3A106057199))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Apt_BR))))))' \
  --header 'Authorization: Bearer <token>' --header 'LinkedIn-Version: 202610' --header 'X-Restli-Protocol-Version: 2.0.0'
json
{ "elements": [ { "active": 0, "total": 69700000 } ], "paging": { "start": 0, "count": 10, "links": [] } }

In the query, the targeting becomes a Rest.li record: URNs are encoded and the structural (, ), : and , aren't (see Rest.li 2.0). total is 0 under 300 members; a campaign needs 300 to be activated (AUDIENCE_SIZE_TOO_SMALL), and below that it gets the CAMPAIGN_AUDIENCE_COUNT_HOLD hold. active is always 0, as in LinkedIn's sample. In Mimicr the estimate is deterministic: each value has a seeded population, OR adds with overlap, AND multiplies and exclusion subtracts. The [audiencia-pequena] trigger in the campaign name forces 120.

Bid and budget limits

bash
curl -s 'https://linkedin-ads.mimicr.dev/rest/adBudgetPricing?q=criteriaV2&account=urn%3Ali%3AsponsoredAccount%3A521119150&campaignType=SPONSORED_UPDATES&bidType=CPM&matchType=EXACT&currency=BRL&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3Alocations:List(urn%3Ali%3Ageo%3A106057199))),(or:(urn%3Ali%3AadTargetingFacet%3AinterfaceLocales:List(urn%3Ali%3Alocale%3Apt_BR))))))' \
  --header 'Authorization: Bearer <token>' --header 'LinkedIn-Version: 202610' --header 'X-Restli-Protocol-Version: 2.0.0'
json
{
  "elements": [
    {
      "bidLimits": { "min": { "amount": "10.00", "currencyCode": "BRL" }, "max": { "amount": "1000.00", "currencyCode": "BRL" } },
      "suggestedBid": { "min": { "amount": "12.00", "currencyCode": "BRL" }, "default": { "amount": "20.00", "currencyCode": "BRL" }, "max": { "amount": "35.00", "currencyCode": "BRL" } },
      "dailyBudgetLimits": { "min": { "amount": "50.00", "currencyCode": "BRL" }, "max": { "amount": "1000000.00", "currencyCode": "BRL" }, "default": { "amount": "100.00", "currencyCode": "BRL" } }
    }
  ],
  "paging": { "start": 0, "count": 10, "links": [] }
}

The values come from the per-currency minimums and Mimicr's delivery model. Use bidLimits.min as the floor of unitCost and dailyBudgetLimits.min as the minimum dailyBudget (see Groups and campaigns).

Change the targeting

targetingCriteria can change on an active campaign, with a partial update that replaces the whole object:

json
{ "patch": { "$set": { "targetingCriteria": { "include": { "and": [ { "or": { "urn:li:adTargetingFacet:locations": ["urn:li:geo:106057199"] } }, { "or": { "urn:li:adTargetingFacet:interfaceLocales": ["urn:li:locale:pt_BR"] } } ] } } } } }

The old targeting field answers 400 TARGETING_FIELD_DEPRECATED.