Avoiding CUSTOMER_NOT_ENABLED error

229 views
Skip to first unread message

Oksana Sulyma

unread,
Jan 21, 2022, 11:09:17 AM1/21/22
to Google Ads API and AdWords API Forum
Hello Google Ads API team,
I'm using Google-ads-php library and following this example:

In this code part I get an error for at line 235 for code

foreach ($stream->iterateAllElements() as $googleAdsRow) ...


Error is:

Fatal error: Uncaught TypeError: Given value is not an instance of Google\Protobuf\Any. in ...google/common-protos/src/Rpc/Status.php:64

From the fetch logs I see call fault:

Fault
-------
Status code: 7
Details: The caller does not have permission
Failure: {"errors":[{"errorCode":{"authorizationError":"CUSTOMER_NOT_ENABLED"},"message":"The customer can't be used because it isn't enabled."}],"requestId":"Pn8ta2UONRLjpkCqgIPQtA"}  

And my question is how can I check that customer is enabled with separate API call may be?

I take customers list from $customerServiceClient->listAccessibleCustomers() response. I get 19 customers ids as response and 2 of them are 'not enabled'. Can provide account details in private message. Basically I'm interested in info how can I catch this error preventively. 

Thanks in advance!

Oksana

Google Ads API Forum Advisor

unread,
Jan 24, 2022, 12:38:04 AM1/24/22
to adwor...@googlegroups.com
Hi Oksana,

Thank you for reaching out and for providing these details.

However, in order for our team to investigate further the cause of the CUSTOMER_NOT_ENABLED error, could you also provide the complete request and response logs, with the request-id?

If you haven't yet, logging can be enabled by referring to this PHP logging guide. You may then send the requested information via the Reply privately to author option, and if this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

In addition, could you also confirm if the account in your API request is cancelled or inactive? If yes, you will need to reactivate them first before you may manage its details via the API.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOH6Z:ref

Oksana Sulyma

unread,
Jan 24, 2022, 7:39:03 AM1/24/22
to Google Ads API and AdWords API Forum
Hi Peter,
Thanks for responding, I've just sent debugging info in private message.
However it might be not worth to check that details as I'm interested in general adswer:

The problem is I see Failure: {"errors":[{"errorCode":{"authorizationError":"CUSTOMER_NOT_ENABLED"},"message":"The customer can't be used because it isn't enabled."}],"requestId":"*"}  
and I get only 'Given value is not an instance of Google\Protobuf\Any.' message when I try - catch:
try {
$accounts_hierarchy += $this->createCustomerClientToHierarchy($root_customer_id);
} catch (Throwable $error) {
print_r($error->getMessage()); -> outputs  'Given value is not an instance of Google\Protobuf\Any.'
}

I wonder how can I modify the code to get exact error info ""errors":[{"errorCode":{"authorizationError":"CUSTOMER_NOT_ENABLED"},"message":"The customer can't be used because it isn't enabled."}" ?

Thanks!

Google Ads API Forum Advisor

unread,
Jan 25, 2022, 12:28:57 AM1/25/22
to adwor...@googlegroups.com
Hi Oksana,

Thank you for providing more details to your concern.

Upon checking the account where you want to retrieve the report, I can see that it's setup is not complete yet. With this, I would suggest to complete setting up of that account and retry the API report again.

As for your concern about retrieving the error in try-catch, since this concern is more code related, then I would suggest reaching out to the author of the PHP client library via this link as they are more equipped with this topic.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VOH6Z:ref
Reply all
Reply to author
Forward
0 new messages