How add YouTube video to UAC campaign programmatically?

34 views
Skip to first unread message

Sama Ra

unread,
Jan 22, 2020, 4:29:25 AM1/22/20
to AdWords API and Google Ads API Forum
I have UAC campaign and YouTube video.
I wanna to add this video to campaign.
Is there is a way to do it programmatically?
I see that i need AssetId of this video (YouTubeVideoAsset), but hot to retrieve it for a given YouTube video?
Thanks in advance

Google Ads API Forum Advisor Prod

unread,
Jan 22, 2020, 3:14:13 PM1/22/20
to qw4...@gmail.com, adwor...@googlegroups.com

Hi Sama,

Thank you for reaching out. In Adwords, if you would like to add YouTube video to UAC campaign, you need to manually set the campaign's YouTube Video assets through the Google Ads UI. If you already have YouTube Video assets in the Google Ads UI, you will be able use the MediaService.get() to retrieve the MediaId of the youtubeMedia. Then you could use the CampaignService.mutate() to create a UAC campaign with the setting as UniversalAppCampaignSetting including the youtubeVideoMediaIds. Please let me know if you have any further questions. 

Thanks and regards,
Xiaoming, Google Ads API Team



 

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