Upload Images in Ad Group

222 views
Skip to first unread message

Tirth Barochia

unread,
Jul 17, 2023, 8:25:29 AM7/17/23
to Google Ads API and AdWords API Forum
Hello,

I have Ad group id and I have images as assets but I try so much but I am not able to find how can I add my PNG images to ad group using ads API in python. Can you give me demo of it.

Google Ads API Forum Advisor

unread,
Jul 17, 2023, 12:29:31 PM7/17/23
to tirth.accu...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to Google Ads API Forum.

You may need to use MutateAdGroupAssets (MutateAdGroupAssetsRequest) via AdGroupAssetService to link your AdGroup to your image assets. You may refer to this code example (https://developers.google.com/google-ads/api/samples/upload-image-asset#python) for uploading an image asset using Python. However, there is no available sample code example to add asset based image extensions at ad group level in Python. 

Please let us know if you have further questions.

This message is in relation to case "ref:_00D1U1174p._5004Q2n8R6U:ref"

Thanks,
 
Google Logo Google Ads API Team


Tirth Barochia

unread,
Jul 18, 2023, 1:12:50 AM7/18/23
to Google Ads API and AdWords API Forum
As you said I tried but it is not working so can you please provide me code of upload PNG images in specific ad group using Python.

Google Ads API Forum Advisor

unread,
Jul 18, 2023, 4:06:47 AM7/18/23
to tirth.accu...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

In order for us to investigate further, can you share with us the whole Google Ads UI screenshot (without cropping) of the data in the Google Ads UI you are trying to set via API? This is so we can check on our end as well and provide more appropriate answers accordingly.

Can you also provide more context when you mentioned it is not working? If you are encountering API errors on your end, can you provide us with the complete API logs (request and response with request-id and request header) generated on your end when you encountered the issue you mentioned? You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

For the client libraries, logging can be enabled by navigating to the Client libraries > Your client library (ex Java) > Logging documentation, which you can access from this link (https://developers.google.com/google-ads/api/docs/client-libs). 

Reference links included in this email:

Tirth Barochia

unread,
Jul 18, 2023, 6:46:24 AM7/18/23
to Google Ads API and AdWords API Forum
code : in attachment

error:

Uploaded file: customers/customer_id/assets/asset_id
Traceback (most recent call last):
  File "/home/projects/tirth.com/Podcast Project/podcast/podcastapp/view/test.py", line 61, in <module>
    main(googleads_client, "customer_id")
  File "/home/projects/tirth.com/Podcast Project/podcast/podcastapp/view/test.py", line 40, in main
    ad_group_ad.ad.image_asset = asset_resource_name
  File "/home/tirth/.local/lib/python3.8/site-packages/proto/message.py", line 772, in __setattr__
    raise AttributeError(
AttributeError: Unknown field for Ad: image_asset
test.py

Google Ads API Forum Advisor

unread,
Jul 18, 2023, 7:02:42 AM7/18/23
to tirth.accu...@gmail.com, adwor...@googlegroups.com
Hello Tirth,

Thank you for the response.

However, it appears that the information you provided is not sufficient to proceed with the investigation. Would you kindly provide us more context when you are experiencing this error? If you are encountering API errors on your end, can you provide us with the complete API logs (request and response with request-id and request header) generated on your end when you encountered the issue you mentioned? You can provide it via the Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Tirth Barochia

unread,
Jul 18, 2023, 7:13:44 AM7/18/23
to Google Ads API and AdWords API Forum
Hello,

I am not facing issue regarding API. I am facing issue related to boosting images to ad account. I am using same code which is mentioned in below link


But in this I am only able to send my images to assets not in specific ad group. I want to send this images to ad group but I can not find any data related to this. 

What I want?
-> I want to send png images to specific ad group in google ads account using google ads api using python.

Can you please provide me code for the same

Google Ads API Forum Advisor

unread,
Jul 18, 2023, 10:33:45 AM7/18/23
to tirth.accu...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for getting back to us.

I want to send png images to specific ad group in google ads account using google ads api using python. Can you please provide me code for the same

>> Unfortunately, the link we shared previously is the only official code example available in uploading an image asset. Since your concern is more on the code implementation of the Google Ads API python client library, I would recommend reaching out to the developer who maintains our client libraries Python (Github Issues) via this link (https://github.com/googleads/google-ads-python/issues) . 

Reply all
Reply to author
Forward
0 new messages