Ads · Ad Campaigns

Edit a Google campaign's device, location, excluded location, or language targeting

Edits a Google campaign's device, location, excluded location, or language targeting. Works with Google Ads.

PUThttps://api.pozy.ai/v1/ads/campaigns/{campaignId}/targeting
Google WorkspaceupdateCampaignTargeting

Guide: Google Ads

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication

Path parameters

NameTypeNotes
campaignIdrequiredstring

Request body

application/json, required

  • platformstringrequired

    One of google.

  • targetingobjectrequired
    • devicesarray of string or object

      One of:

      string
      Option 2 (2 fields)
      • devicestringrequired

        One of MOBILE, DESKTOP, TABLET, CONNECTED_TV.

      • bidModifiernumberrequired
    • locationsarray of string or object

      One of:

      array of string
      Option 2 (5 fields)
      • countriesarray of string
      • regionsarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • citiesarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • zipsarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • metrosarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
    • languagesarray of string
    • excludedLocationsarray of string or object

      One of:

      array of string
      Option 2 (5 fields)
      • countriesarray of string
      • regionsarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • citiesarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • zipsarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
      • metrosarray of string or object

        One of:

        string
        Option 2 (2 fields)
        • keystringrequired
        • namestring
    • locationTargetingTypestring

      One of presence, presence_or_interest.

Example

curl -X PUT "https://api.pozy.ai/v1/ads/campaigns/65a3737dd8b11ea61f199e6e/targeting" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "platform": "google",
  "targeting": {
    "devices": [
      "MOBILE"
    ],
    "locations": [
      "string"
    ],
    "languages": [
      "string"
    ]
  }
}'

Response

200 on success

  • campaignIdstring
  • adGroupIdstring
  • updatedarray of string

    Each item: one of devices, locations, excludedLocations, languages, locationTargetingType.

  • locationTargetingTypestring

    One of presence, presence_or_interest. Can be null.

  • devicesarray of object
    • devicestring

      One of MOBILE, DESKTOP, TABLET, CONNECTED_TV.

    • includedboolean
    • bidModifiernumber

      Can be null.

  • locationsarray of object
    • geoTargetIdstring
    • negativeboolean
    • namestring

      Can be null.

    • canonicalNamestring

      Can be null.

    • typestring

      Can be null.

    • countryCodestring

      Can be null.

  • excludedLocationsarray of object
    • geoTargetIdstring
    • negativeboolean
    • namestring

      Can be null.

    • canonicalNamestring

      Can be null.

    • typestring

      Can be null.

    • countryCodestring

      Can be null.

  • languagesarray of object
    • codestring
    • idstring
    • namestring
200 response
{
  "campaignId": "65a3737dd8b11ea61f199e6e",
  "adGroupId": "6ad180be375f36f2c328e52b",
  "updated": [
    "devices"
  ],
  "locationTargetingType": "presence",
  "devices": [
    {
      "device": "MOBILE",
      "included": true,
      "bidModifier": 12.5
    }
  ],
  "locations": [
    {
      "geoTargetId": "686554da543721f04aabf2a9",
      "negative": true,
      "name": "Acme",
      "canonicalName": "Acme",
      "type": "string",
      "countryCode": "US"
    }
  ],
  "excludedLocations": [
    {
      "geoTargetId": "686554da543721f04aabf2a9",
      "negative": true,
      "name": "Acme",
      "canonicalName": "Acme",
      "type": "string",
      "countryCode": "US"
    }
  ],
  "languages": [
    {
      "code": "string",
      "id": "6bfebd43ddc270f6d2c56fc5",
      "name": "Acme"
    }
  ]
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
404not_foundNothing with that id exists in your workspace.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Ad Campaigns

GETList adsGETList Google Ads recommendationsPOSTApply Google Ads recommendationsPOSTDismiss Google Ads recommendationsGETList portfolio bid strategiesPOSTCreate portfolio bid strategyPATCHUpdate portfolio bid strategyGETList shared budgetsPOSTCreate a shared budgetGETList Search keywordsPOSTAdd Search ad-group keywordsPATCHPause or enable a Search keywordDELRemove a Search keywordGETList campaignsPOSTCreate a standalone campaignPUTPause or resume a campaignGETRead a campaign's ad schedule (dayparting)PUTReplace a campaign's ad schedule (dayparting)GETRead a campaign's current biddingGETGet live campaign detailsPUTUpdate a campaignDELDelete a campaignGETList campaign-level negative keywordsPUTReplace campaign-level negative keywordsPOSTPause or resume many campaignsPOSTDuplicate a campaignGETRead a Google campaign's device, location, excluded location, and language targetingGETList ad setsPOSTCreate a standalone ad groupPOSTDuplicate an ad setPOSTDuplicate an adGETGet live ad-set detailsPUTUpdate an ad setDELDelete an ad setGETRead a Reddit ad group's targeting and schedulePUTPause or resume a single ad setGETGet campaign treeGETGet daily account metricsGETGet ad detailsPUTUpdate adDELCancel an adPUTPause or resume a single adGETList campaign assetsPOSTAttach campaign assetsPUTUpdate campaign assetsDELRemove campaign assetsGETList ad-group assetsPOSTAttach ad-group assetsPUTUpdate ad-group assetsDELRemove ad-group assetsGETRead the platform's review verdict for an adGETReview status of each creative in a TikTok Smart+ adGETList ads that need attentionPOSTDismiss an ads alertGETReview status of every TikTok Smart+ ad of an advertiserGETList campaign negative listsPUTReplace campaign negative listsPOSTBoost post as adGETList Performance Max asset groupsPOSTCreate a Performance Max asset groupGETGet a Performance Max asset groupPATCHUpdate a Performance Max asset groupDELRemove a Performance Max asset groupPOSTLink or unlink asset group assetsPUTReplace an asset group's listing-group treePOSTCreate standalone adGETGet campaign conversion goalsPATCHUpdate campaign conversion goals