I am trying to use the Google Ads API but my understanding of this library 
is limited.  
I have created a client and am trying to update cpc_bid_micros.  


I am getting the following output and am unable to diagnosis it any 
further.  Any help would be appreciated.

ad_group_criterion.resource_name 
customers/5420633870/adGroupCriteria/67392656629~1734040956
ad_group_criterion 0
ad_group_criterion 2560000
Request made: ClientCustomerId: 5420633870, Host: 
googleads.googleapis.com:443, Method: 
/google.ads.googleads.v1.services.AdGroupCriterionService/MutateAdGroupCriteria,
 
RequestId: rr-awPlHu-PMzNzOJULvOQ, IsFault: True, FaultMessage: Resource 
was not found.
Request with ID "rr-awPlHu-PMzNzOJULvOQ" failed with status 
"INVALID_ARGUMENT" and includes the following errors:
        Error with message "Resource was not found.".
                On field: operations
                On field: update
                On field: resource_name



def main(client, customer_id, ad_group_id, criterion_id):
>     agc_service = client.get_service('AdGroupCriterionService', version='v1')
>
>     ad_group_criterion_operation = 
> client.get_type('AdGroupCriterionOperation',
>                                                    version='v1')
>
>
>     ad_group_criterion = ad_group_criterion_operation.update
>     ad_group_criterion.resource_name = agc_service.ad_group_criteria_path(
>         customer_id, ResourceName.format_composite(ad_group_id, criterion_id))
>     print("ad_group_criterion.resource_name", 
> ad_group_criterion.resource_name)
>     print('ad_group_criterion', ad_group_criterion.cpc_bid_micros.value)
>     ad_group_criterion.status = client.get_type('AdGroupCriterionStatusEnum', 
> version='v1').ENABLED
>     ad_group_criterion.cpc_bid_micros.value = 2560000
>     print('ad_group_criterion', ad_group_criterion.cpc_bid_micros.value)
>     fm = protobuf_helpers.field_mask(None, ad_group_criterion)
>     ad_group_criterion_operation.update_mask.CopyFrom(fm)
>
>
>
>     try:
>         #
>         agc_response = agc_service.mutate_ad_group_criteria(
>             customer_id, [ad_group_criterion_operation])
>     except google.ads.google_ads.errors.GoogleAdsException as ex:
>         print('Request with ID "%s" failed with status "%s" and includes the '
>               'following errors:' % (ex.request_id, ex.error.code().name))
>         for error in ex.failure.errors:
>             print('\tError with message "%s".' % error.message)
>             if error.location:
>                 for field_path_element in error.location.field_path_elements:
>                     print('\t\tOn field: %s' % field_path_element.field_name)
>         sys.exit(1)
>
>     print('Updated keyword %s.' % agc_response.results[0].resource_name)
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads 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/c12a3d49-8c12-40ae-9a05-73c2f570e993%40googlegroups.com.

Reply via email to