Login-customer-id

922 views
Skip to first unread message

Matan Shavit

unread,
Apr 11, 2022, 3:55:44 AM4/11/22
to Google Ads API and AdWords API Forum
Hey, I need to add login-customer-id header to the request I send,
when trying to get the relevant manager id I send List accessible customers request, and query the returning customers to get the account hierarchy, none of the accessible customers aren enabled so I get permission denied, since it didnt require login-customer-id in the previous api it didnt fail. What are my options?

request_id: \"AKJx3VdC9FDKJ5Ibr41KGA

Failure message: errors {\n  error_code {\n    authorization_error: CUSTOMER_NOT_ENABLED\n  }\n  message: \"The customer can\\'t be used because it isn\\'t enabled.\"\n}\\"\n\nStatus: Status{code=PERMISSION_DENIED, description=The caller does not have permission, cause=null}.

Body: customer_id: \"2494702650\"\nquery: \"SELECT customer_client.manager, customer_client.descriptive_name, customer_client.id FROM customer_client WHERE customer_client.level <= 1

Google Ads API Forum Advisor

unread,
Apr 11, 2022, 10:37:03 AM4/11/22
to adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Upon checking the error, it seems that it is related to CUSTOMER_NOT_ENABLED . Please note that it is not possible to make API requests against canceled / not enabled accounts unless you will reactivate it by following this guide .

If you are using active account and getting an error, could you please provide the complete request and response logs, with the request-id?If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZLlRO:ref

AJ Duncanson

unread,
Apr 12, 2022, 2:47:20 AM4/12/22
to Google Ads API and AdWords API Forum
Having similar problems. Credentials work on Adwords API but do not work on Google Ads API and we get "The caller does not have permission."

The Adwords credentials contain a customer_id, not a Manager Account ID, so (i) why would this fail and (ii) is there a way to make these same credentials work on the Google Ads API or do we have to generate a whole new token?

Google Ads API Forum Advisor

unread,
Apr 12, 2022, 3:11:44 AM4/12/22
to aj.dun...@futurenet.com, adwor...@googlegroups.com
Hi AJ,

Thank you for the reply.

Please note that you can use the same developer token that you used with the AdWords API, and whatever level of access you had for the AdWords API will carry over to the Google Ads API. You can check this documentation for more details.

Also, could you please confirm if you've used login-customer-id in your request? The login-customer-id is a new required header in Google Ads API when using a manager account to access an operating customer account. If accessing an operating customer account directly, the login-customer-id header is not required.

And for our team to better check it, could you please provide the complete API logs (request and response logs with request ID ) so our team can identify the exact error and provide possible recommendations?

Best regards,
Google Logo
Heidi
Google Ads API Team
 
​​​​​​​

ref:_00D1U1174p._5004Q2ZLlRO:ref

Google Ads API Forum Advisor

unread,
Apr 12, 2022, 3:17:26 AM4/12/22
to adwor...@googlegroups.com, aj.dun...@futurenet.com
Hi AJ,

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

don....@gmail.com

unread,
Apr 22, 2022, 2:47:07 AM4/22/22
to Google Ads API and AdWords API Forum
Hello I had similar problem and I understand that we need now login-customer-id for the calls if auhtorized user is from management account
I'm struggling to understand how to get information of login-customer-id from the authorized user from the API reference docs...could you suggest?
I see only possibility how to get list of all listAccessibleCustomers  but how to know exactly one that authorized? As its possible authorization has access to > 1 manager account

Thank you in advance for the help!

Google Ads API Forum Advisor

unread,
Apr 24, 2022, 10:07:16 PM4/24/22
to don....@gmail.com, adwor...@googlegroups.com
Hi Don,


Thank you for the reply.

It is correct that you can use the listAccessibleCustomers for your scenario / use case. However, it will return a list of all accounts that you are able to act upon directly given your current credentials. It will only include accounts where your authenticated user has been added with admin or other rights in the account.

However, could you clarify or provide further details why you want to get only one account using this feature? 

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZLlRO:ref

don....@gmail.com

unread,
Apr 29, 2022, 7:20:08 AM4/29/22
to Google Ads API and AdWords API Forum
Hello Ernie, here is the case:

client authenticates with our app and specify one from many Google Ads Accounts which client wants us to use for reporting

if client authenticated with user from MCC account we need to specify this mcc account id the header login-customer-id when query Google Ads account client specified as should be used.
What is the most efficient way to find out id of MCC account? Because its possible that listAccessibleCustomers  could return us even many MCC accounts if there is a tree like MCC Top -> MCC 1 -> Ads Account available for authenticated user. Hope my question makes sense

Thank you!

Google Ads API Forum Advisor

unread,
May 2, 2022, 11:44:29 AM5/2/22
to don....@gmail.com, adwor...@googlegroups.com
Hi Don,

The highest accessible MCC should be the one selected for the login customer ID. This should be the first listed ID in your ListAccessibleCustomers request. You may also refer to the Account Hierarchy example.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


 

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