Guides
Campaigns

Edit and pause

Updates with updateMask, pausing and re-enabling, changing budget and dates, removing campaigns and reading the serving status.

Pause and re-enable

bash
curl --request POST \
  --url https://google-ads.mimicr.dev/v26/customers/2220330728/googleAds:mutate \
  --header 'Authorization: Bearer <token>' \
  --header 'login-customer-id: 6446154552' \
  --header 'Content-Type: application/json' \
  --data '{
    "mutateOperations": [{
      "campaignOperation": {
        "update": { "resourceName": "customers/2220330728/campaigns/54542599977", "status": "ENABLED" },
        "updateMask": "status"
      }
    }]
  }'

status toggles between ENABLED and PAUSED. The same applies to ad groups, ads and keywords.

How updateMask works

  • It is a comma-separated list of paths. snake_case and camelCase are both accepted (end_date_time or endDateTime); subfields use a dot (network_settings.target_search_network).
  • Every path in the mask is written: with the value from the body or, if absent from the body, cleared.
  • Body fields outside the mask are ignored.
  • No updateMask: fieldMaskError: FIELD_MASK_MISSING. Unknown path: fieldMaskError: FIELD_NOT_FOUND. Immutable field: IMMUTABLE_FIELD. No resourceName: requestError: RESOURCE_NAME_MISSING.

Budget and dates

json
{
  "mutateOperations": [
    { "campaignBudgetOperation": {
      "update": { "resourceName": "customers/2220330728/campaignBudgets/54542599976", "amountMicros": "80000000" },
      "updateMask": "amount_micros"
    } },
    { "campaignOperation": {
      "update": { "resourceName": "customers/2220330728/campaigns/54542599977" },
      "updateMask": "end_date_time"
    } }
  ]
}

The second operation lists end_date_time in the mask without sending the field: this clears the end date and the campaign runs indefinitely. Changing startDateTime after the campaign has started gives campaignError: CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED.

On the campaign, the mutable fields are: name, status, campaignBudget, the bidding strategy, networkSettings.*, startDateTime (before it starts), endDateTime, geoTargetTypeSetting.*, trackingUrlTemplate, finalUrlSuffix and containsEuPoliticalAdvertising. advertisingChannelType is immutable.

A budget or status change only affects delivery in the following hours; hours already generated are not recalculated.

Remove

json
{ "mutateOperations": [{ "campaignOperation": { "remove": "customers/2220330728/campaigns/54542599977" } }] }

Removing is permanent: the campaign becomes REMOVED, cannot be re-enabled and an update on it answers mutateError: RESOURCE_NOT_FOUND. It keeps showing up in GAQL with its historical metrics. A non-shared budget is removed along with it. Removing a budget still in use gives campaignBudgetError: CAMPAIGN_BUDGET_IN_USE. Assets have no remove: unlink them with campaignAssetOperation.remove.

Serving status

bash
curl --request POST \
  --url https://google-ads.mimicr.dev/v26/customers/2220330728/googleAds:search \
  --header 'Authorization: Bearer <token>' \
  --header 'login-customer-id: 6446154552' \
  --header 'Content-Type: application/json' \
  --data '{ "query": "SELECT campaign.status, campaign.serving_status, campaign.primary_status, campaign.primary_status_reasons FROM campaign WHERE campaign.id = 54542599977" }'

primaryStatus and servingStatus are computed on read. The first matching row wins:

SituationprimaryStatusprimaryStatusReasons
RemovedREMOVEDCAMPAIGN_REMOVED
PausedPAUSEDCAMPAIGN_PAUSED
Suspended account or declined paymentNOT_ELIGIBLE(empty), servingStatus: SUSPENDED
End date has passedENDEDCAMPAIGN_ENDED
Start in the futurePENDINGCAMPAIGN_PENDING
Budget removedMISCONFIGUREDBUDGET_MISCONFIGURED
Performance Max without asset groupsNOT_ELIGIBLENO_ASSET_GROUPS
No ad group, paused ad groups, no keyword, no adNOT_ELIGIBLENO_AD_GROUPS, AD_GROUPS_PAUSED, NO_KEYWORDS, NO_AD_GROUP_ADS
All ads disapprovedNOT_ELIGIBLEHAS_ADS_DISAPPROVED
Most ads under reviewPENDINGMOST_ADS_UNDER_REVIEW
Some ads disapproved or limitedLIMITEDHAS_ADS_DISAPPROVED, HAS_ADS_LIMITED_BY_POLICY
Daily spend at 95% of the budgetLIMITEDBUDGET_CONSTRAINED
Smart bidding for less than 7 daysLEARNINGBIDDING_STRATEGY_LEARNING
OtherwiseELIGIBLE(empty)

This table is Mimicr's rule; the enum values are Google's.

Concurrent modification

Two mutates on the same campaign at the same time answer 409 databaseError: CONCURRENT_MODIFICATION "Multiple requests were attempting to modify the same resource at once. Retry the request.". Retry with increasing backoff. To test it: [concorrente] in the campaign name or chaos.concurrent_modification.