Set/Unset Ad Group Criterion Gender Targets

157 views
Skip to first unread message

jca...@katanatechworks.com

unread,
May 27, 2022, 2:04:27 PM5/27/22
to Google Ads API and AdWords API Forum
Hello Team,

I am trying to set or under gender criterion to ad group but it is not working.

Adding gender:
            ad_group_criterion_operation = google_client.get_type('AdGroupCriterionOperation')
            ad_group_criterion = ad_group_criterion_operation.create
            ad_group_criterion.ad_group = ad_group_service.ad_group_path(
                self.customer_id, ad_group_id
            )
            ad_group_criterion.gender.type_ = google_client.enums.GenderTypeEnum.FEMALE
Error: 
            message: "The field attempted to be mutated is immutable."

Unset gender:
           ad_group_criterion_operation.remove = f"customers/{self.customer_id}/adGroupCriteria/{ad_group_id}~20"

Error:
          mutate_error: RESOURCE_NOT_FOUND
         }
         message: "Resource was not found."
         trigger {
            int64_value: 20
         }

Regards


Google Ads API Forum Advisor

unread,
May 30, 2022, 5:49:57 AM5/30/22
to jca...@katanatechworks.com, adwor...@googlegroups.com
Hi Jca,

Thank you for reaching out to us.

For our team to further investigate the error you are encountering, could you please provide the complete API logs (request and response logs with request ID)  generated on your end so our team can check it?

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bELIN:ref

jca...@katanatechworks.com

unread,
Jun 3, 2022, 10:40:54 PM6/3/22
to Google Ads API and AdWords API Forum
Hello Team,

It looks like ad_group_criterion.gender.type is a IMMUTABLE_FIELD

I just what to know if it is possible to update Adgroup Gender Audience using the api (see image) ?

Screen Shot 2022-06-04 at 10.38.59 AM.png
UPDATE operation
errors {
  error_code {
    request_error: IMMUTABLE_FIELD
  }
  message: "Field \'ad_group\' cannot be modified by \'UPDATE\' operation."
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "update"
    }
    field_path_elements {
      field_name: "ad_group"
    }
  }
}

CREATE operation
errors {
  error_code {
    field_error: IMMUTABLE_FIELD

  }
  message: "The field attempted to be mutated is immutable."
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "negative"
    }
  }
}

Regards

Google Ads API Forum Advisor

unread,
Jun 5, 2022, 9:24:37 PM6/5/22
to jca...@katanatechworks.com, adwor...@googlegroups.com
Hi John,

Thank you for providing more details to your concern. I am also a member of the Google Ads API team and let me provide support to your concern.

I am afraid that the operations you tried are not possible as according to this document for gender, by default a new campaign will contain no gender criteria, which means that all genders are included. Only negative criteria are supported at the campaign level. At the ad group level, you can bid on or exclude genders. This means that you don't need to add genders as they are already included in the ad group as well and you can only update the field negative to exclude specific gender.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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