Google Ads API: Updating app_ad - adding video assets

141 views
Skip to first unread message

Aleksei Krizhanovskii

unread,
Oct 16, 2021, 5:06:27 PM10/16/21
to AdWords API and Google Ads API Forum
Hello,

I am trying to update the ad within an app campaign (ACi).
More specifically I am trying to add youtube video assets.
I have got the code samples for app campaigns creation, ad_group creation, and ad creation. But I cannot work out how to modify ad_group_ad and how to add assets to it.
I tried it this way:
  ad_operation = client.get_type('AdOperation') 
  ad = ad_operation.update
  ad.resource_name = resource_name
  video = ad.app_ad.youtube_videos.add()

And this causes an AttributeError:
---> video = ad.app_ad.youtube_videos.add()
AttributeError: 'RepeatedComposite' object has no attribute 'add'

Any advice would be highly appreciated as I have no ideas how this can be done. 
And it would be extremely helpful to get a code sample of modifying an app ad in terms of adding or removing assets.

Thank you in advance,
Aleksei

Google Ads API Forum Advisor

unread,
Oct 18, 2021, 1:32:41 PM10/18/21
to aleksei_kr...@belkatechnologies.com, adwor...@googlegroups.com
Hi Aleksei,

App Ads aren't mutable.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PKEdm:ref

Aleksei Krizhanovskii

unread,
Oct 20, 2021, 11:49:22 AM10/20/21
to AdWords API and Google Ads API Forum
Thank you for the response.
That was actually not the case. Found the solution in another place.

I simply should have used 'extend' instead of 'add' which was correct for earlier API versions.
Another thing was to use the field mask in mutate_ads operation.
And the usage of ad service and ad operation instead of the ad_group_ad ones makes everything work perfectly.

Google Ads API Forum Advisor

unread,
Oct 21, 2021, 2:36:06 AM10/21/21
to aleksei_kr...@belkatechnologies.com, adwor...@googlegroups.com
Hi Aleksei,

Thank you for your reply.

As my colleague Aryeh earlier mentioned, and as per the documentation he included, App Ads are not mutable. Therefore, mutating ads of this type would not be possible even when using the AdService.

That being said, so that our team can better understand the scenario you encountered, could you provide our team with the complete request and response logs, with the request-id, generated from the solution you mentioned?

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

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


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