I am using the new Search Ads 360 Reporting API and am trying to get all our client account id's under the manager account. There is some limited information here that says this is possible, but I am unable to figure out how to make the API call using the Python client library.
Anyone able to help out on this?
Solved! Go to Solution.
Hi @jenser I understand you're having trouble retrieving all client account IDs under a manager account using the new Search Ads 360 Reporting API with the Python client library. This can indeed be a bit tricky. Here’s a step-by-step guide that might help you out:
Step-by-Step Guide
Install the Client Library: Ensure you have the Google Ads API client library installed. You can do this using pip:
pip install google-ads
Authenticate: Set up authentication by creating a google-ads.yaml configuration file with your API credentials.
Retrieve Customer IDs: You can use the CustomerService to list all accessible customer IDs.
from google.ads.google_ads.client import GoogleAdsClient
from google.ads.google_ads.errors import GoogleAdsException
def main(client):
customer_service = client.get_service("CustomerService", version="v10")
accessible_customers = customer_service.list_accessible_customers()
print("Accessible customer IDs:")
for resource_name in accessible_customers.resource_names:
print(resource_name)
if __name__ == "__main__":
google_ads_client = GoogleAdsClient.load_from_storage()
main(google_ads_client)
This script will list all accessible customer IDs for your manager account. You can then use these IDs to fetch detailed reports for each client account.
Alternative Solution
If you're looking for a more streamlined way to manage and report on your Search Ads 360 data, there are several data integration tools available that can help simplify this process. Personally, I’ve used Windsor.ai for this purpose because it fit well within our budget. It supports Search Ads 360 and provides an extensive list of fields, making it easier to manage and retrieve the data you need. You might look for this tool or any other one out there in the market, which are several indeed. Hope this helps!
Hi @jenser I understand you're having trouble retrieving all client account IDs under a manager account using the new Search Ads 360 Reporting API with the Python client library. This can indeed be a bit tricky. Here’s a step-by-step guide that might help you out:
Step-by-Step Guide
Install the Client Library: Ensure you have the Google Ads API client library installed. You can do this using pip:
pip install google-ads
Authenticate: Set up authentication by creating a google-ads.yaml configuration file with your API credentials.
Retrieve Customer IDs: You can use the CustomerService to list all accessible customer IDs.
from google.ads.google_ads.client import GoogleAdsClient
from google.ads.google_ads.errors import GoogleAdsException
def main(client):
customer_service = client.get_service("CustomerService", version="v10")
accessible_customers = customer_service.list_accessible_customers()
print("Accessible customer IDs:")
for resource_name in accessible_customers.resource_names:
print(resource_name)
if __name__ == "__main__":
google_ads_client = GoogleAdsClient.load_from_storage()
main(google_ads_client)
This script will list all accessible customer IDs for your manager account. You can then use these IDs to fetch detailed reports for each client account.
Alternative Solution
If you're looking for a more streamlined way to manage and report on your Search Ads 360 data, there are several data integration tools available that can help simplify this process. Personally, I’ve used Windsor.ai for this purpose because it fit well within our budget. It supports Search Ads 360 and provides an extensive list of fields, making it easier to manage and retrieve the data you need. You might look for this tool or any other one out there in the market, which are several indeed. Hope this helps!
User | Count |
---|---|
3 | |
3 | |
2 | |
1 | |
1 |