Error handling for Ad Text

59 views
Skip to first unread message

cv

unread,
Jan 10, 2018, 1:06:53 AM1/10/18
to AdWords API Forum
Hello,

When we have more than one type of error for adtext, API is not throwing all the error at once.
Like if I have error with MISSING_PROTOCOL_IN_FINAL_URL and POLICY VIOLATION then only Missing protocol error was thrown.

Please let me know how I can capture all the error at once.


Thanks,

Vincent Racaza (AdWords API Team)

unread,
Jan 10, 2018, 3:04:05 AM1/10/18
to AdWords API Forum
Hi,

You can set the partialFailure to true to commit all the successful operations and get/handle all the errors from the failed operations in one request. You can check in the link the supported services for this feature. You can also see the code examples here.

Please try this and let me know if this works for you.

Thanks,
Vincent
AdWords API Team

cv

unread,
Jan 10, 2018, 7:13:27 AM1/10/18
to AdWords API Forum
Hello Vincent,

Thanks for your reply.

I am assuming that partial failure is not giving me errors for those ads who fails. But without error ads will be submitted to Adwords. Right?
what about when I do not wants to post all the ads when any of the Ads with error?

That is why I tried using validate adtext before posting.

Anyway I can get those ads also which has policy violation error along with basic errors?

Thanks,

Josh Radcliff (AdWords API Team)

unread,
Jan 10, 2018, 4:15:26 PM1/10/18
to AdWords API Forum
Hi,

If you have partialFailure=true, then each operation without errors will be applied, but operations with errors will be returned. With partialFailure=false (or not specified), all operations in a request will fail if any operation in the request has errors.

The basic validation checks on operations occur before any policy violation checks, so if you have fields that hit basic validation issues, you'll only get back those errors in the response. If all of an ad's fields pass the basic validation checks, then I would expect you to get back all of the policy violation errors for each ad in the error response. One reason for this is that performing more complex validation checks when there are basic validation issues could produce confusing or meaningless errors. For example, if a final URL has an invalid protocol, it wouldn't be very helpful if the AdWords API also returned an error to indicate that the final URL was unreachable.

In the particular case you mentioned, the missing protocol in the final URL falls into the basic validation category, so you'd have to correct that before you'll get back policy violation errors. If you frequently encounter specific basic validation errors, then you may want to add validation within your application to avoid submitting those operations.

As an alternative, you could submit your request with validateOnly=true, which will perform most of the validation steps for your request, but won't actually apply the changes. This would allow you to identify problematic operations, fix them, and then send the corrected operations in a second request with validateOnly=false.

Thanks,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages