Hello!
I'm having some issues when i try to get the audiences data from API.
The code I'm using is:
from google.ads.googleads.client import GoogleAdsClient
client_g = GoogleAdsClient.load_from_storage(version="v9")
ga_service = client_g.get_service("GoogleAdsService")
client_customer_id = 'my great ID'
query = """
SELECT
audience.id,
audience.resource_name,
audience.name,
audience.status,
audience.description,
audience.dimensions,
audience.exclusion_dimension
FROM audience
"""
search_request = client_g.get_type("SearchGoogleAdsStreamRequest")
search_request.customer_id = client_customer_id
search_request.query = query
stream = ga_service.search_stream(search_request)
ERROR: Request made:, Host:
googleads.googleapis.com, Method: /google.ads.googleads.v9.services.GoogleAdsService/SearchStream,, IsFault: True, FaultMessage: Unrecognized fields in the query: 'audience.exclusion_dimension', 'audience.status', 'audience.dimensions', 'audience.description', 'audience.resource_name', '
audience.id', '
audience.name'.
And the example of the code here:
What I don't understand is: if I've found all this in the documentation, it supposed to work, not fail. And I tried to run with 'campaign', 'adgroup' instead of 'audience' and it worked. What should I do?