ad_group_ad_service = client.get_service('AdGroupAdService', version='v1')
ad_group_service = client.get_service('AdGroupService', version='v1')
# Create ad group ad.
ad_group_ad_operation = client.get_type('AdGroupAdOperation', version='v1')
ad_group_ad = ad_group_ad_operation.create
ad_group_ad.ad_group.value = ad_group_service.ad_group_path(customer_id, adgroup_id)
ad_group_ad.status = client.get_type('AdGroupAdStatusEnum',version='v1').PAUSED
## 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 "
Hi,
Thank you for reaching out. Since you want to create a ResponsiveDisplayAds, you may refer this sample code for creating expanded text ads. You just need to replace the expanded_text_ad to responsive_display_ad. Additionally, these are the fields that can be populated with responsive display ad.
Let me know if this helps. Feel free to write back if you have further clarifications.
Regards,
Dave
Google Ads API Team
Hi,
Unfortunately, there isn't any sample code that is particular for creating responsive display ads yet. As I have said, you may refer to the sample code for expanded text ads as it is almost the same with responsive display ads. You need only to replace expanded text ads fields with responsive display ads fields and you can refer to the documentation to determine which fields are required.
Regards,
Dave
Google Ads API Team
As I said I have done all the due diligence before asking the question on forum. Also it is not a direct one to one replacement that can be done looking at expanded text ads. Considering I have provided the snippet I have tried and failed is there no one who can validate and correct it? Only hope asking something out here is that there are people in the other end who can advise above the docs?
Hopefully that stands true here.
Thanks and Regards,
Vinutha
resp_image = ad_group_ad.ad.responsive_display_ad.marketing_images.add()
resp_image.asset.value = 'Landscape Image'
I am getting following error with this :
[2019-05-24 12:37:39,834 - WARNING] Request made: ClientCustomerId: , Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v1.services.AdGroupAdService/MutateAdGroupAds, RequestId: 5EIz_vb9mEhLlTLm0P HYbQ, IsFault: True, FaultMessage: Resource name 'Landscape Image' is malformed: expected 'customers/{customer_id}/assets/{part_1}'. Request with ID "5EIz_vb9mEhLlTLm0PHYbQ" failed with status "INVALID_ARGUMENT" and includes the following errors: Error with message "Resource name 'Landscape Image' is malformed: expected 'customers/{customer_id}/assets/{part_1}'.". On field: operations On field: create On field: ad On field: responsive_display_ad On field: marketing_images On field: asset