ad_group_criterion_operation - field_mask_error: FIELD_MASK_MISSING

76 views
Skip to first unread message

Nathan Caspar

unread,
Jul 23, 2020, 2:20:00 PM7/23/20
to AdWords API and Google Ads API Forum
Hi,

I'm trying to generate a field mask for pausing keywords in a particular ad group, but keep getting a field mask missing error, which I can't find much if any useful documentation about.

I'm using the GoogleAdsService to handle mutate operations and am generating the update mask in this manner

{
    'ad_group_criterion_operation': {
          'update': {
               'resource_name': f'customers/{customer_id}/adGroupCriteria/{ad_group_id}~{keyword_id}',
                'status': google_ads_client.get_type('AdGroupCriterionStatusEnum').PAUSED
          }
     }
}

but am getting the following response
Fault: errors {
    error_code {
      field_mask_error: FIELD_MASK_MISSING
    }
    message: "Cannot use empty field mask in update operation."
    location {
      field_path_elements {
        field_name: "mutate_operations"
        index {
        }
      }
      field_path_elements {
        field_name: "ad_group_criterion_operation"
      }
    }
}

A similar method works fine for creating keywords, any thoughts about what is going wrong?

Nate

Google Ads API Forum Advisor Prod

unread,
Jul 23, 2020, 4:47:34 PM7/23/20
to nca...@atlassian.com, adwor...@googlegroups.com
Hi Nathan,

Thanks for reaching out. With regards to your concern, you can follow the update keywords example and update status using AdGroupcriterion service set status as PAUSED. From the logs, you can see that you need to use update_mask field to perform update operation. Please refer to this guide for more information on field mask and code sample to update keyword. Let us know if you need additional information.

Regards,
Nirmita Patel Google Ads API Team


 

ref:_00D1U1174p._5004Q22YbsS:ref
Reply all
Reply to author
Forward
0 new messages