{"id":14602,"library":"google-ads-admanager","title":"Google Ads Ad Manager API Client Library","description":"This is an official Python client library for interacting with the Google Ad Manager API. It provides a programmatic interface to manage ad campaigns, inventory, and other Ad Manager features. The current version is 0.9.0 and it is part of the broader `googleapis/google-cloud-python` monorepo, which typically sees frequent updates, though this specific client's release cadence appears less frequent.","status":"active","version":"0.9.0","language":"en","source_language":"en","source_url":"https://github.com/googleapis/google-cloud-python/tree/main/packages/google-ads-admanager","tags":["google","admanager","ads","api-client","advertising","dfp"],"install":[{"cmd":"pip install google-ads-admanager","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Required for protobuf message serialization/deserialization.","package":"proto-plus","optional":false},{"reason":"Core library for Google API clients, including gRPC support.","package":"google-api-core[grpc]","optional":false},{"reason":"Handles authentication with Google APIs.","package":"google-auth","optional":false}],"imports":[{"note":"The API version (e.g., `v202311`) is an explicit part of the import path and must be specified. This changes with new Ad Manager API releases.","wrong":"from google.ads.admanager.services.network_service import NetworkServiceClient","symbol":"NetworkServiceClient","correct":"from google.ads.admanager_v202311.services.network_service import NetworkServiceClient"}],"quickstart":{"code":"import os\nfrom google.ads.admanager_v202311.services.network_service import NetworkServiceClient\n\ndef get_admanager_network_info():\n    try:\n        # Authenticate using Application Default Credentials (ADC).\n        # Ensure GOOGLE_APPLICATION_CREDENTIALS env var is set or gcloud is configured.\n        # For Ad Manager, ensure your credentials have the necessary Ad Manager scope.\n        client = NetworkServiceClient()\n\n        # Get the current network.\n        network = client.get_current_network()\n\n        print(f\"Current Ad Manager Network:\")\n        print(f\"  Network Code: {network.network_code}\")\n        print(f\"  Display Name: {network.display_name}\")\n        print(f\"  Time Zone: {network.time_zone}\")\n        print(f\"  Primary Ad Exchange Id: {network.primary_ad_exchange_id}\")\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        # Consider detailed error handling based on API response codes.\n\nif __name__ == '__main__':\n    get_admanager_network_info()","lang":"python","description":"This quickstart demonstrates how to instantiate the `NetworkServiceClient` and retrieve information about the current Ad Manager network. It assumes Application Default Credentials (ADC) are configured, typically via `GOOGLE_APPLICATION_CREDENTIALS` environment variable or `gcloud auth application-default login`."},"warnings":[{"fix":"Always check the specific API version directory (e.g., `google/ads/admanager_vYYYYMM/`) after an upgrade and update your import statements accordingly.","message":"The Ad Manager API version is embedded directly into the Python import path (e.g., `admanager_v202311`). Upgrading the `google-ads-admanager` library might introduce a newer API version in the import path (e.g., `v202402`), requiring code changes even if the library's own major version (0.x.x) remains the same.","severity":"breaking","affected_versions":"All pre-1.0 versions"},{"fix":"Ensure you are using the correct library for your project. This library (from `google.ads.admanager_vYYYYMM`) follows a more 'Google Cloud'-like pattern, while the older library used `from googleads import dfp`.","message":"This `google-ads-admanager` library is a distinct client for the Google Ad Manager API and should not be confused with the older `googleads-python-lib` (which also supported DFP/Ad Manager). They have different import paths, authentication methods, and underlying API interactions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Pin the library version (e.g., `google-ads-admanager==0.9.0`) and thoroughly test your application after any version upgrade before deploying to production.","message":"As a pre-1.0 version (currently 0.9.0), the API stability is not guaranteed. Breaking changes in methods, object structures, or underlying API behavior can occur in minor or patch releases.","severity":"gotcha","affected_versions":"<1.0.0"},{"fix":"Verify that your Google Cloud Project's service account (or the user account for local development) has the necessary Ad Manager permissions and that the correct scopes are included when generating credentials if not using standard ADC with a sufficiently scoped service account.","message":"While this library uses `google-auth` for authentication, connecting to the Ad Manager API typically requires specific OAuth 2.0 scopes (e.g., `https://www.googleapis.com/auth/dfp`) and an Ad Manager network ID. Ensure your service account or user credentials have been properly granted these scopes within Google Ad Manager.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official Google Ad Manager API documentation for details on service operations, object structures, and field definitions when facing complex API interactions or unexpected behavior.","message":"The Google Ad Manager API is a SOAP-based API. While this Python library aims to abstract away the XML/SOAP complexity, understanding the underlying SOAP structures (e.g., WSDL definitions) can be helpful for advanced usage, debugging, or when implementing features not directly exposed by the client methods.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[],"ecosystem":"pypi"}