Ads API Code Sample: response ads in python

119 views
Skip to first unread message

Matthew Fleming

unread,
Sep 18, 2019, 12:33:18 PM9/18/19
to AdWords API and Google Ads API Forum
Hi,

Are there any python samples available for creating responsive display ads? If not, can someone create a very simple example for setting variable values?

I've done a fair bit of Googling (including this thread) and the expanded text ad example isn't really cutting it in terms of documentation.

I've followed this code for setting var values, but it's producing an error "AttributeError: 'google.protobuf.pyext._message.RepeatedCompositeCo' object has no attribute 'asset'"

## setting variable values.
ad_group_ad.ad.responsive_display_ad.marketing_images.asset.value = '<image name>'
ad_group_ad.ad.responsive_display_ad.headlines.text.value = "headline1 text"
ad_group_ad.ad.responsive_display_ad.headlines.pinned_field = client.get_type('ServedAssetFieldTypeEnum',version='v1').HEADLINE_1
ad_group_ad.ad.long_headline.text.value = "long_headline text "
ad_group_ad.ad.long_headline.pinned_field = client.get_type('ServedAssetFieldTypeEnum',version='v1').HEADLINE_2
ad_group_ad.ad.descriptions.text.value = " Descriptions text "
ad_group_ad.ad.descriptions.pinned_field = client.get_type('ServedAssetFieldTypeEnum', version='v1').DESCRIPTION_1
ad_group_ad.ad.business_name.value = "Buisness name text "

Thanks!
-Matt

Google Ads API Forum Advisor Prod

unread,
Sep 19, 2019, 9:27:21 AM9/19/19
to adwor...@googlegroups.com
Hi Matthew, 

We do not have the Python code samples available to create Responsive Display Ads. We will be happy to walk you through the process. Could you please share details on the errors you are receiving while creating the Responsive Display ads?

Thanks,
Bharani, Google Ads API Team

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