Using python3 for campaigns report

38 views
Skip to first unread message

Олеся Васина

unread,
Feb 12, 2020, 11:01:15 AM2/12/20
to AdWords API and Google Ads API Forum
Hello!
I am trying to get stats from campaign report and got an error module 'google.ads.google_ads.v2.proto.errors' has no attribute 'errors_pb2'.

Here is a part of code:

client = GoogleAdsClient.load_from_string(yaml.safe_dump(adwords_client_config))


ga_service
= client.get_service('GoogleAdsService', version='v2')

query
= """
    SELECT
      campaign.name,
      campaign.status,
      segments.device,
      metrics.impressions,
      metrics.clicks,
      metrics.ctr,
      metrics.average_cpc,
      metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
"""
response = ga_service.search(client_customer_id, query, 1000)
for row in response:
   
print(row)

Please help me with this error.

Thanks a lot!

Olesya

Google Ads API Forum Advisor Prod

unread,
Feb 12, 2020, 4:00:32 PM2/12/20
to lesy...@gmail.com, adwor...@googlegroups.com
Hi Olesya,

Could you please try the following:
 
   1. pip uninstalled googled-ads
   2. pip3.7 installed google-ads

Please let me know if the issues persists.

Thanks and regards,
Xiaoming, Google Ads API Team


 


ref:_00D1U1174p._5001UV0bNE:ref

davi...@google.com

unread,
Feb 13, 2020, 6:43:02 AM2/13/20
to AdWords API and Google Ads API Forum
See https://github.com/googleads/google-ads-python/issues/200 for a solution. The new version will be posted to PyPi by the end of the month.
Reply all
Reply to author
Forward
0 new messages