Hi, I am wondering can I changed maxCPC on keyword layer? And for changing keyword status, I know that it might be used for samples like client.enums.AdGroupCriterionStatusEnum.ENABLED I want to change keyword status by an input pd data frame filed with the column of ad_gorup_id, criterion_id, criterion_status. Therefore, I am wondering what is the input format that I need to contact for client.enums.AdGroupCriterionStatusEnum.ENABLED ? I am not quite understanding the field mask and enums, the operations I am using are below. Thanks
def get_keyword_status_operations(client, customer_id, df_input): operations = [] agc_service = client.get_service("AdGroupCriterionService") for index, row in df_input.iterrows(): # resource name customers/{customer_id}/adGroupCriteria/{ad_group_id}~{criterion_id} ad_group_criterion_operation = client.get_type("AdGroupCriterionOperation") ad_group_criterion = ad_group_criterion_operation.update ad_group.resource_name = ad_group_criterion_service.ad_group_path( customer_id, row['Ad Group ID'], row['Keyword ID']) # is this line for changin keyword status? ad_group_criterion.status = client.enums.AdGroupCriterionStatusEnum.ENABLED client.copy_from( ad_group_criterion_operation.update_mask, protobuf_helpers.field_mask(None, ad_group_criterion._pb),) operations.append(ad_group_operation) return operations agc_service = client.get_service("AdGropBidModifierService") while len(operations)>0: cur_operations = operations[0:500] #print(cur_operations) agc_response = agc_service.mutate_ad_group_criteria( customer_id=customer_id, operations=[cur_operations],) operations = operations[500:] On Thursday, March 10, 2022 at 6:42:54 PM UTC-8 adsapi wrote: > Hi, > > Thank you for your reply and additional details. > > For keywords metrics, you can use the keyword_view > <https://developers.google.com/google-ads/api/fields/v10/keyword_view?hl=en> > and include attributes from the ad_group_criterion > <https://developers.google.com/google-ads/api/fields/v10/ad_group_criterion?hl=en> > > resource in your query, since this is an *Attributed resource* of the > said keyword report. You can also use the query builder > <https://developers.google.com/google-ads/api/fields/v10/overview_query_builder?hl=en> > > and query validator > <https://developers.google.com/google-ads/api/fields/v10/query_validator?hl=en> > > tools, to help you construct your queries. Let me know if this helps. > > Best regards, > > [image: Google Logo] > Peter Laurence > Google Ads API Team > > > ref:_00D1U1174p._5004Q2XmeLo:ref > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/1c989648-219b-410f-8a97-172150b797d6n%40googlegroups.com.