Google Ads API - Set Bide - update_ad_group

35 views
Skip to first unread message

Liad Barak

unread,
Oct 7, 2020, 2:48:28 AM10/7/20
to AdWords API and Google Ads API Forum
I'm trying to update ad_group.cpc_bid_micros using Google documentation:
Google Ads API Guide: docs/campaigns/bidding/set-bids
Google Repository: update_ad_group.py

I keep getting error in the code at line #39ad_group.cpc_bid_micros = cpc_bid_micro_amount
Error: AttributeError: Assignment not allowed to field "cpc_bid_micros" in protocol message object.

I believe the error indicates on wrong value assignment (e.g - mistakenly sent string instead of int etc).
But I have tried different variations and still do not know what is wrong.

Can you help me understand - what am I missing?
Thank you.

------------------------------------------------------------------------------------------------------------------------
Example data I've sent (there are additional examples I tried, the same error always) :
customer_id = '1270565523'
ad_group_id = '108190607168'
cpc_bid_micro_amount = 42730000

Liad Barak

unread,
Oct 7, 2020, 5:51:36 AM10/7/20
to AdWords API and Google Ads API Forum
Hi
It supposes to be ad_group.cpc_bid_micros.value = cpc_bid_micro_amount

You need to update the documentation :)

Google Ads API Forum Advisor Prod

unread,
Oct 7, 2020, 11:13:55 AM10/7/20
to adwor...@googlegroups.com

Hi Liad,

Thank you for reaching out. It’s most likely you have installed a client library version prior to v5. In the v5, the cpc_bid_micros has been changed to int64 primitive type. However, in the earlier versions, the cpc_bid_micros has the Int64Value type whose object instance contains the value filed.

Thanks and regards,
Xiaoming, Google Ads API Team

 

Google Logo
Xiaoming
Google Ads API Team
 


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