remove multiple assets in one query

432 views
Skip to first unread message

Evgeniy Lepikov

unread,
May 25, 2022, 6:46:56 AM5/25/22
to Google Ads API and AdWords API Forum
Hi there! 
I'm looking for a way to delete multiple assets in one query. The corresponding code example using python library shows how to perform the operation to remove one asset.

resource_name = ad_group_ad_service.ad_group_ad_path(
     customer_id, ad_group_id, ad_id
)


How should I change the code to remove not one ad_id but several - ad_ids = [2435565, 24356543, 76534234] ?

Google Ads API Forum Advisor

unread,
May 26, 2022, 3:18:25 AM5/26/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

Thank you for reaching out to our API support team.

Could you clarify whether you wish to remove assets or ads? I asked because the AssetService (see operations) currently does not support a remove operation.

Also since you are inquiring on code implementation with the link (remove_ad.py) you sent, I would recommend that you reach out instead to the Python client library owners via this link, as they should be better equipped in providing guidance on code level approaches.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDKdy:ref

Evgeniy Lepikov

unread,
May 26, 2022, 7:10:23 AM5/26/22
to Google Ads API and AdWords API Forum
Thank you for help!
I really confused the concepts of assets and ads. Thank you for clarifying this point. Since there is no way to remove assets, I tried removing ad.
The first question is, do I understand correctly that deleting ad will delete all the associated assets?
And second - when I try to delete ad I get an error

error_code {
ad_group_ad_error: AD_TYPE_CANNOT_BE_REMOVED
}
message: "Cannot remove an adgroup ad with this ad type."

So the ad type is APP_AD

Is this a limitation of the API or can it be removed?

In the end, my task is to remove one or more ads from a ad_group with several ads in it. Is it possible?


четверг, 26 мая 2022 г. в 09:18:25 UTC+2, adsapi:

Evgeniy Lepikov

unread,
May 26, 2022, 8:04:46 AM5/26/22
to Google Ads API and AdWords API Forum
upd for clarification

My goal is to find a way to remove all the assets associated with a particular ad. I.e. to get the same result that I get in the google panel interface by manually deleting the assets inside the group.
sample image

As AssetOperation does not support delete operations, I am looking for a way to do this via AdGroupAdOperation if possible for my ad type.


четверг, 26 мая 2022 г. в 13:10:23 UTC+2, Evgeniy Lepikov:

Google Ads API Forum Advisor

unread,
May 27, 2022, 6:40:01 AM5/27/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

I am Carmela, also a member of the Google Ads API team.

Moving forward to your concern, please see the statements below:
  • do I understand correctly that deleting ad will delete all the associated assets? - Kindly note that if you remove or delete ads, it doesn't also delete the asset associated but it should remove their link instead
  • In relation to your second question and follow up email which you mentioned that you've encountered an error and to deleting the assets, could you provide first the complete request and response logs with request ID and request header generated on your end? You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDKdy:ref

Evgeniy Lepikov

unread,
May 27, 2022, 7:17:29 AM5/27/22
to Google Ads API and AdWords API Forum
Hi Carmela, thank you
About do I understand correctly that deleting ad will delete all the associated assets?   Yes, exactly. 
That is, I  want help on the first question, which tool (as I have already understood it cannot be used  AssetService cose it does not support a remove operation, and AdGroupAdService cose it  not suitable for ad with type = APP_AD) can be used to delete ad with delete all the associated assets. For example, I have ad_group Ad_group1, it has 2 ads (let it be youtube video) video_ad1 and video_ad2, each ad has 4 different resolutions(assets)
I need to remove only video_ad1 and its related assets( video_ad1_asset1, video_ad1_asset2, video_ad1_asset3, video_ad1_asset4) from the ad_group, so that they are not active in the google marketing UI panel as in the image.
sample

пятница, 27 мая 2022 г. в 12:40:01 UTC+2, adsapi:

Evgeniy Lepikov

unread,
May 30, 2022, 2:11:49 AM5/30/22
to Google Ads API and AdWords API Forum
steel need help

пятница, 27 мая 2022 г. в 13:17:29 UTC+2, Evgeniy Lepikov:

Google Ads API Forum Advisor

unread,
May 30, 2022, 9:11:29 AM5/30/22
to lepil...@gmail.com, adwor...@googlegroups.com

Hi Evgeniy,

Thanks for getting back to us.

Assets can't be removed. To stop an asset from serving, remove the link to the campaign, ad group, and so on. You may use ad-level operations to manage the associations between individual assets and ads. However, note that Google Ads API permits only reporting of video ads, and does not support mutates on Video campaign, Ad Group and Ads in the Ads API, as mentioned in the Campaign Management overview. For this you may use UI to disassociate the links. 

Furthermore, I already raised a feature request to support remove operation for Asset operation. With this, I would suggest keeping an eye on this blog as we will post any relevant updates when they become supported.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDKdy:ref

Evgeniy Lepikov

unread,
May 30, 2022, 12:49:29 PM5/30/22
to Google Ads API and AdWords API Forum
Thanks for help
But I still can't find a solution. It's now clear that I have to remove the link between the asset and the ad. But how to do it? With what? What type of Service and Operation to use (e.g. AdGroupAdService AdGroupAdOperation and the like)? I can't find any examples in google api documentation describing how to remove link between aset and ad.
понедельник, 30 мая 2022 г. в 15:11:29 UTC+2, adsapi:

Evgeniy Lepikov

unread,
May 31, 2022, 4:21:20 PM5/31/22
to Google Ads API and AdWords API Forum
the question is still relevant

понедельник, 30 мая 2022 г. в 18:49:29 UTC+2, Evgeniy Lepikov:

Google Ads API Forum Advisor

unread,
May 31, 2022, 11:31:29 PM5/31/22
to lepil...@gmail.com, adwor...@googlegroups.com
Hi Evgeniy,

Thank you for the reply. I am also a member of the Google Ads API team and let me provide support to your concern.

With regard to your concern, I am afraid that there is no sample code for updating the link of assets and ads. However, the service that needs to use is the AdService and the operation should be the update AdOperation if you want to remove some of the assets from specific ads.

Let me know if you have further questions.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


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