List Manager account and sub-account separately

41 views
Skip to first unread message

Shivam Kumar

unread,
Jun 21, 2024, 9:14:10 AM6/21/24
to Google Ads API and AdWords API Forum
Hi there, 
I want to list manager account and sub-account separately. How I can? I am using below query but list all account together. It doesn't separated Manager accounts and ads accounts separately.

---------------------------------------------------

client = GoogleAdsClient.load_from_dict(
            credentials, version="v15")
        customer_service = client.get_service("CustomerService")
        accessible_customers = customer_service.list_accessible_customers()

---------------------------------------------------------



query = f"""
                    SELECT
                    customer_client.descriptive_name,
                    customer_client.id
                    FROM customer_client
                    WHERE customer_client.level < 1 AND customer_client.id = {resource_name.split("/")[1]}
                """
---------------------------------------------------

query = """SELECT
                    customer_client.descriptive_name,
                    customer_client.id
                    FROM customer_client """

----------------------------------------

I want to implement attached files functionality.



Screenshot 2024-06-21 at 9.00.18 AM.png
Screenshot 2024-06-21 at 9.01.02 AM.png

Google Ads API Forum Advisor

unread,
Jun 21, 2024, 2:13:01 PM6/21/24
to shiv...@vaticai.com, adwor...@googlegroups.com
Hi,

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

Based on the provided information, you need to separate the manager and sub accounts separately using customer_client resource. Kindly note that we are getting a successful run on the same query and only the manager account is returned based on the manager account ID. Please modify your query to get the manager accounts dynamically.

You can try making a request using the Method: customers.googleAds.search.
SELECT customer_client.descriptive_name, customer_client.id, customer.manager, customer.status,
 customer_client.level, customer_client.manager, customer_client.status FROM customer_client 
WHERE customer_client.level < 1 AND customer_client.id = (manager account ID)

Also, you can use Query Builder to create your query and Query Validator to validate your query. If the issue persists, then you may provide us with the complete request and response logs with request ID and request header generated on your end to better assist you further.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.
 

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJQcI:ref" (ADR-00243211)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages