Getting Errors from a Campaign Mutate - Google Ads API (V2) - PHP

528 views
Skip to first unread message

Dan GTD

unread,
Nov 7, 2019, 4:37:04 PM11/7/19
to AdWords API and Google Ads API Forum
Hi!

So i'm uploading a number of CampaignCriterionOperations using mutateCampaignCriteria and I need to act on any errors for the individual operations that may arise. So at the moment i'm getting the following error responses:


ApiException was thrown with message '{

    "message": "Request contains an invalid argument.",

    "code": 3,

    "status": "INVALID_ARGUMENT",

    "details": [

        {

            "@type": 0,

            "data": "type.googleapis.com\/google.ads.googleads.v2.errors.GoogleAdsFailure"

        },

        {

            "@type": 0,

            "data": [

                {

                    "errorCode": {

                        "resourceCountLimitExceededError": "CAMPAIGN_LIMIT"

                    },

                    "message": "Indicates that this request would exceed the number of allowed resources in a Campaign. The exact resource type and limit being checked can be inferred from accountLimitType, and the numeric id of the Campaign involved is given by enclosingId.",

                    "trigger": {

                        "stringValue": ""

                    },

                    "location": {

                        "fieldPathElements": [

                            {

                                "fieldName": "operations",

                                "index": "7"

                            }

                        ]

                    }

                },



How do I get the ID of the campaign that had the error and the exact resource type and limit? I can't see any way/example to use accountLimitType? Or enclosingId?

I have also tried adding ['partialFailure' => true] but that just gives an error:

Error occurred during parsing: Class google.ads.googleads.v2.errors.GoogleAdsFailure hasn't been added to descriptor pool


Any pointers would be great!

Thanks

Dan.

Google Ads API Forum Advisor Prod

unread,
Nov 7, 2019, 9:40:35 PM11/7/19
to d...@greatthings.agency, adwor...@googlegroups.com
Hello Dan, 

The CAMPAIGN_LIMIT error usually occurs if it is hitting any campaign specific limits. Please refer to this guide for more information on the campaign criteria limits. If you could share the complete request and response logs, we will be happy to take a look. You can share the details privately via Reply privately to author option.

Regards,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UMWauF:ref

Dan GTD

unread,
Nov 7, 2019, 10:19:57 PM11/7/19
to AdWords API and Google Ads API Forum
Thanks, I’m pretty sure what limits are being hit but I want to know how to find that out via the errors. As you can see in my email it doesn’t give specifics, like which campaign(s) had the error(s) and what campaign limit specifically was hit. The errors just say this:

Indicates that this request would exceed the number of allowed resources in a Campaign. The exact resource type and limit being checked can be inferred from accountLimitType, and the numeric id of the Campaign involved is given by enclosingId.

How do you check the accountLimitType and enclosingId?

Thanks

Dan

Google Ads API Forum Advisor Prod

unread,
Nov 11, 2019, 3:40:31 PM11/11/19
to d...@greatthings.agency, adwor...@googlegroups.com
Hi Dan, 

Regret the delay as I was checking this internally with the team. Could you please share the sample logs for both AdWords API and Google Ads API to provide a helpful answer for these errors? You can share the details privately via Reply privately to author option. 

Thanks,

Dan GTD

unread,
Nov 12, 2019, 11:48:20 AM11/12/19
to AdWords API and Google Ads API Forum
You should hopefully have my private response? Please confirm.

Thank

Dan.

Google Ads API Forum Advisor Prod

unread,
Nov 12, 2019, 3:04:42 PM11/12/19
to d...@greatthings.agency, adwor...@googlegroups.com
Hi Dan, 

I reached out to you privately requesting the details as I did not receive the logs shared. Could you please share the details on the private thread so we can investigate further and continue the discussion here?
Reply all
Reply to author
Forward
0 new messages