Code sample for the creation of Responsive Display Ad with Google Ads API

86 views
Skip to first unread message

l.sem...@likereply.it

unread,
Apr 4, 2019, 3:16:43 PM4/4/19
to AdWords API and Google Ads API Forum
Does anyone have an example of the code for creating a Display Ad with the new Google Ads API? 
Because in the new libraries don't have any example of the creation of Add other than the Text Search.

googleadsapi...@google.com

unread,
Apr 4, 2019, 5:13:53 PM4/4/19
to AdWords API and Google Ads API Forum
Hello Luca, 

I was able to create a ResponsiveDisplayAd successfully by passing just the values as below in Java:

ResponsiveDisplayAdInfo responsiveDisplayAdInfo =
ResponsiveDisplayAdInfo.newBuilder()
.setShortHeadline(StringValue.of("I am short headline"))
.setLongHeadline(StringValue.of("I am long headline"))
.setDescription(StringValue.of("I am desc"))
.setBusinessName(StringValue.of("I am bus name"))
.setMarketingImage(StringValue.of("customers/<customerid>/mediaFiles/<mediafileid>"))
.build();

Ad ad =
Ad.newBuilder()
.setResponsiveDisplayAd(responsiveDisplayAdInfo)
.addFinalUrls(StringValue.of("http://www.example.com"))
.build();

Code samples in other languages are not yet available. Could you please give it a try and let me know if you have any other questions?

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages