I'm uploading offline conversions.  Most are successful (and I can see them 
in the Google Ads UI).  Some are not.  I'm having difficulty getting an 
error message for the unsuccessful ones.

Here's my Python code:

# create conversion
click_conversion = client.get_type("ClickConversion")
click_conversion.conversion_action = conversion_action
click_conversion.gclid = click_id
if conversion_value is not None:
    click_conversion.conversion_value = float(conversion_value)
click_conversion.conversion_date_time = conversion_time
click_conversion.currency_code = conversion_currency_code

# upload conversion
conversion_upload_service = client.get_service("ConversionUploadService")
request = client.get_type("UploadClickConversionsRequest")
request.customer_id = customer_id
request.conversions.append(click_conversion)
request.partial_failure = True
offline_conversion_responses = 
conversion_upload_service.upload_click_conversions(request=request).results

# process response
for response in offline_conversion_responses:
    partial_failure = getattr(response, "partial_failure_error", None)
    code = getattr(partial_failure, "code", None)
    if code != 0:
        error_details = getattr(partial_failure, "details", [])
        errors = []
        for error_detail in error_details:
            failure_message = client.get_type("GoogleAdsFailure")
            GoogleAdsFailure = type(failure_message)
            failure_object = 
GoogleAdsFailure.deserialize(error_detail.value)
            for error in failure_object.errors:
                errors.append(error.message)
        error_message = 'Unknown Error' if len(errors) == 0 else '; 
'.join(errors)

The problem is partial_failure always seems to be None regardless of 
whether it was successful.

Any suggestions?

Thanks,
Walter

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/eb1a64c1-acc3-4243-b815-baf7e93cb86bn%40googlegroups.com.
  • Tr... Walter Bodwell
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
      • ... Walter Bodwell

Reply via email to