Hello Team,
I am trying to query or retrieve reports from the googleAds api such as
geo_perfromance_report, keywords_performance_report using the newest
version, so far Im unsuccessful in retrieving them.
this is one of the error that i
*get IsFault: True, FaultMessage: Error in GEO_PERFORMANCE_REPORT: is not
a valid resource name.*
any support or guidance is appreciated.
def main(client, customer_id):
start_date = datetime.today().date().isoformat().replace("-", "")
end_date = datetime.now() + timedelta(days=- 28)
end_date = end_date.date().isoformat().replace("-", "")
ga_service = client.get_service("GoogleAdsService")
query = """SELECT
segments.date
FROM GEO_PERFORMANCE_REPORT WHERE segments.date DURING LAST_7_DAYS
ORDER BY metrics.impressions DESC
LIMIT 50"""
stream = ga_service.search_stream(customer_id=customer_id, query=query)
for batch in stream:
for row in batch.results:
print(
f"Campaign with ID {row.Attribute.adGroupID} and name "
f'"{row.Attribute.adGroupID}" was found.'
)
if __name__ == "__main__":
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
googleads_client = GoogleAdsClient.load_from_storage(path="path",
version="v8")
try:
main( googleads_client, "customer_id")
except GoogleAdsException as ex:
print(
f'Request with ID "{ex.request_id}" failed with status '
f'"{ex.error.code().name}" and includes the following errors:'
)
for error in ex.failure.errors:
print(f'\tError with message "{error.message}".')
if error.location:
for field_path_element in error.location.field_path_elements:
print(f"\t\tOn field: {field_path_element.field_name}")
sys.exit(1)
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/0aa9ea3b-f5b1-4d25-9e9f-9606d9081d0an%40googlegroups.com.