Issue deleting the audience for GoogleAds.

49 views
Skip to first unread message

Shrinivasmurthy Grampurohit

unread,
May 17, 2023, 8:06:24 AM5/17/23
to Google Ads API and AdWords API Forum
Hi  ,
With Python 3.7+ , googleads=37.0.0, I am unable to delete the GoogleAds audience by passing ID and getting error:
AttributeError: module 'googleads' has no attribute 'GoogleAdsClient'
Following is the code:

import  googleads  
 CLIENT_ID = '<client_id>'
 CLIENT_SECRET = '<client_secret>'
 REFRESH_TOKEN = '<refresh_token>'

 service = googleads.GoogleAdsClient( client_id=CLIENT_ID, client_secret=CLIENT_SECRET, refresh_token=REFRESH_TOKEN)

 audience_id = 'INSERT_AUDIENCE_ID_HERE'

 service.audiences().delete(audience_id=audience_id).execute()

 if response.status_code == 200:
print('Audience deleted successfully')
 else:
print('Error deleting audience')

Is this not supported ?  How can we achieve this v13/12 of GoogleAds. Please suggest. Thank you!

Google Ads API Forum Advisor

unread,
May 18, 2023, 3:00:34 AM5/18/23
to grampuroh...@gmail.com, adwor...@googlegroups.com
Hi Shrinivasmurthy,

Thank you for reaching out to the Google Ads API support team. I hope that you are doing well today.

Moving forward to your concern, based on the Overview for Python client library, the library requires Python 3.7 or above. For more information, you may check the Overview for Python client library here (https://developers.google.com/google-ads/api/docs/client-libs/python).

You may also check the supported API versions here (https://developers.google.com/google-ads/api/docs/client-libs#supported_api_versions).

Lastly, if in the event that you are still encountering the error, you may provide us the complete request and response logs with request ID and request header generated on your end. If you haven't enabled the logging yet, logging in Python can be enabled by following the guide here (https://developers.google.com/google-ads/api/docs/client-libs/python/logging).

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Reference links:
Kind regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2lInrt:ref
Reply all
Reply to author
Forward
0 new messages