How to get manager name?

155 views
Skip to first unread message

林灿

unread,
Apr 20, 2023, 6:18:51 AM4/20/23
to Google Ads API and AdWords API Forum
 Hi,
        How to get "manager name" by customerId or managerId  using google ads java api?

Google Ads API Forum Advisor

unread,
Apr 20, 2023, 11:54:23 AM4/20/23
to lianc...@gmail.com, adwor...@googlegroups.com

Hi 林灿, 

Thanks for reaching out to the Google Ads API Team. I hope you are doing well today.

With regards to your concern, upon checking there is a duplicate email thread with the subject titled “How to get Manager Info?”. We already responded on that thread, see below for reference.

Assuming that you’re following the List Accessible Accounts guide, any account numbers can be accessed directly without a login customer Id header so you can pull a customer report for each of the CID/MCCID's and you can get the name from the customer.descriptive_name field.

Links included in the context above:

 
However, if I misunderstood your concern and you're looking for different data, then please share with us the UI screenshot of the data that you're expecting to retrieve so that we can assist you accordingly. You may send it via 'Reply privately to author' option. If this option is not available, then send it instead on this email address googleadsa...@google.com.


In line with this, please avoid creating multiple threads with the same topic. For now we will continue the discussion on that email thread, for better tracking of updates.

Have a great day.

Regards,

Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2koUHo:ref

林灿

unread,
Apr 23, 2023, 8:58:36 AM4/23/23
to Google Ads API and AdWords API Forum
Hi,
     The managerName cannot be obtained according to the above method. My application scenario is that a manager account authorizes his advertising account (customerId) to my account. At this time, I only know the customerId. How should I obtain the manager account id and manager account name corresponding to this customerId by java api?

Google Ads API Forum Advisor

unread,
Apr 24, 2023, 6:18:27 AM4/24/23
to lianc...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for your response.

In the Google Ads API, you may try to use the customer_manager_link (https://developers.google.com/google-ads/api/fields/v13/customer_manager_link) report and include the customer_manager_link.manager_customer (https://developers.google.com/google-ads/api/fields/v13/customer_manager_link#customer_manager_link.manager_customer) field. Please refer to the sample response below that you may get:

"resourceName": "customers/(yourCID)/customerManagerLinks/(managerId)~123456789"

On the other hand, you may refer to the code example in List Accessible Customer below:

List Accessible Customer - https://developers.google.com/google-ads/api/samples/list-accessible-customers

Moving forward in Google Ads UI, to obtain the manager account ID and manager account name that correspond to the used customer ID, you may login to your Google Ads (customerID) > Tools and Settings > Access and security > Managers.

Best regards,

Zweitze

unread,
Apr 24, 2023, 7:26:47 AM4/24/23
to Google Ads API and AdWords API Forum
Given just a GoogleAds client, and a customerid, you determine logincustomerid (the id of the MCC containing the requested customerid):

First, call CustomerService.ListAccessibleCustomers(). This returns a list of MCCs that the user can access.
Then, for each MCC returned, request a report on customer_client. In the results you check whether your requested account is returned - if you find it, you've got your logincustomerid.
If none of the MCCs knows this customerid, then the user does not have access to that account.

It's painful to go through every MCC, but, currently nobody can have hundreds of MCCs - so it shouldn't take too long.

Hope this helps.

Google Ads API Forum Advisor

unread,
Apr 24, 2023, 10:08:26 AM4/24/23
to zwe...@gmail.com, adwor...@googlegroups.com

Hi, 

Thank you for coming back to us. I hope you are doing well today.

@Zweitze
Thank you for sharing your insight, this is highly appreciated. 

@林灿
I hope this new information will also help you with your concern. Let us know how it goes.



Have a great day.

Regards,

Reply all
Reply to author
Forward
0 new messages