ad type name

85 views
Skip to first unread message

Yonatan

unread,
Jul 9, 2023, 5:11:25 AM7/9/23
to Google Ads API and AdWords API Forum
Hi,

Previously, it was possible to retrieve the name of an ad type using the following code:

ga_service = client.get_service("GoogleAdsService")
perf_dict = defaultdict(dict)
query = f"""
  SELECT
    ad_group_ad.ad.system_managed_resource_source,
    ad_group_ad.ad.type,
.....
response = ga_service.search_stream(search_request)
for batch in response:
    for row in batch.results:
         ad_type_name = row.ad_group_ad.ad.type_.name.upper()

However, this code is no longer functioning and produces the following error:
AttributeError: 'int' object has no attribute 'name'

Is there an alternative method to retrieve the value?





Google Ads API Forum Advisor

unread,
Jul 10, 2023, 6:51:58 AM7/10/23
to yon...@upsolver.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.

It appears that you have a concern with regards to retrieving the name of an ad type. With this, could you provide us with the complete request and response logs with the request ID and request header generated on your end showing the error? This is so our team could further check and provide more appropriate guidance. 

You may then send the requested information privately via the Reply to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Reference Links:

This message is in relation to case "ref:_00D1U1174p._5004Q2msxw8:ref"

Thanks,
 
Google Logo Google Ads API Team


Yonatan

unread,
Jul 11, 2023, 3:51:21 AM7/11/23
to Google Ads API and AdWords API Forum
this is the part that doesn't work

ad_type_name = row.ad_group_ad.ad.type_.name.upper()

Google Ads API Forum Advisor

unread,
Jul 11, 2023, 4:49:08 AM7/11/23
to yon...@upsolver.com, adwor...@googlegroups.com

Hi,

Thank you for getting back to us.

I understand that you are having trouble with the upper() function. Please note that this is a Python client library function. Our team specializes in Google Ads API related concerns and technical implementations only. Since this concern is related to a client library function. You may try reaching out to the Python client library owner by filing an issue here on the Issues tab of the client library you are using on github as they should be more equipped to provide guidance on this matter when it comes to Google Ads API client library concerns and inquiries.

Reply all
Reply to author
Forward
0 new messages