OverviewPlatformsAPI ReferenceResources
Accounts & Ops

Attach a Google Ads label

POSThttps://zernio.com/api/v1/ads/labels/{labelId}/assignments

Attaches a Google Ads label to campaigns, ad groups, ads and keywords in one call, skipping any that already have it.

The label goes to campaigns, ad groups, ads and keywords (Google CampaignLabel, AdGroupLabel, AdGroupAdLabel and AdGroupCriterionLabel) in one mutate.

Idempotent: a target that already carries the label is counted in unchanged instead of failing the call.

PlatformsGoogle

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

labelIdstringRequired

Google label id

Body

application/json

What every request needs

accountIdstringRequired

Zernio SocialAccount id (Google Ads)

Optional parameters6 fields
adAccountIdstring

Google customer id. Required when the connection has multiple customers.

customerIdDeprecatedstring

Alias of adAccountId

campaignIdsarray of strings

Google campaign ids

adSetIdsarray of strings

Google ad group ids

adIdsarray of strings

Google ad group ad ids, {adGroupId}~{adId}

keywordIdsarray of strings

Google keyword criterion ids, {adGroupId}~{criterionId}

Responses

Success· the request worked

Errors· the request failed

How it behaves

Ids

All ids are Google's own. Ads and keywords use the composite id Google puts in their resource names:

  • Ads: {adGroupId}~{adId}
  • Keywords: {adGroupId}~{criterionId} (the tail of resourceName on GET /v1/ads/keywords)
POST/v1/ads/labels/{labelId}/assignments
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.adaccounts.attachAdLabel({  path: {    labelId: 'label_abc123',  },  body: {    accountId: 'account_abc123',  },});console.log(data);
{  "customerId": "string",  "labelId": "string",  "attached": 0,  "unchanged": 0}
OpenAPI specification
Was this page helpful?