How to remotely (API) update CpvBid of an AdGroup (Python Google Ads Lib.)

29 views
Skip to first unread message

jorge....@kimiagroup.com

unread,
Nov 27, 2018, 1:55:24 AM11/27/18
to AdWords API and Google Ads API Forum
Hi,

I would like to remotely update CpvBid of an AdGroup but I can't find a way in the API to do it.
I'm working with Python Client and have already tried with:

# Initialize appropriate service.
ad_group_service = client.GetService('AdGroupService', version='v201802')

# Construct operations and update an ad group.
operations = [{
'operator': 'SET',
'operand': {
'id': ad_group_id,
'biddingStrategyConfiguration' : {
'bids': {
'xsi_type': 'CpvBid',
'bid': {
'microAmount': data,
}
}
}
}
}]

print("Trying to update adGroupId: {} \n with params: \n {}".format(ad_group_id, operations))

ad_groups = ad_group_service.mutate(operations)


# Getting the following error:
[2018-11-26 18:36:12,072: ERROR/Worker-2] (CpvBid) not-found
[2018-11-26 18:36:12,073: ERROR/Worker-2] path: "CpvBid", not-found
[2018-11-26 18:36:12,073: ERROR/Worker-2] (ns0:CpvBid) not-found
[2018-11-26 18:36:12,073: ERROR/Worker-2] path: "ns0:CpvBid", not-found

Peter Oliquino (AdWords API Team)

unread,
Nov 27, 2018, 2:42:30 AM11/27/18
to AdWords API and Google Ads API Forum
Hi Jorge,

There is currently no CpvBid that is supported by the AdWords API's services. CpvBid is only available via the reports. For all other bids, you can update them by referring to this example in Python.

I hope this helps.

Thanks and regards,
Peter
AdWords API Team

jorge....@kimiagroup.com

unread,
Nov 27, 2018, 4:53:40 AM11/27/18
to AdWords API and Google Ads API Forum
Hi,

Referring to the possibility of updating remotely the CpvBid, is it possible to do a bulkUpload of a modified report in Python, as it could be done in JavaScript?

Here is the way it is done in JS:

var adGroupsChecked = {};
var adgroupReport = AdWordsApp.report(AWQL_AdGroup(), API_VERSION_0).rows();

while (adgroupReport.hasNext()) {
    var row = adgroupReport.next();
    adGroupsChecked[row.AdGroupId]['CpvBid'] = row.CpvBid;

var report = AdWordsApp.report(AWQL_Criteria(), API_VERSION_0);

// Create an upload with the report columns.
var upload = AdWordsApp.bulkUploads().newCsvUpload([
    report.getColumnHeader('CampaignId').getBulkUploadColumnName(),
    report.getColumnHeader('AdGroupId').getBulkUploadColumnName(),
    report.getColumnHeader('CpvBid').getBulkUploadColumnName()
]/*,{moneyInMicros: false}*/);

upload.forCampaignManagement();

Thanks!

Peter Oliquino (AdWords API Team)

unread,
Nov 27, 2018, 5:06:37 AM11/27/18
to AdWords API and Google Ads API Forum
Hi Jorge,

My apologies as the Adwords API does not support javascript, the CpvBid object, and the AdWords UI Bulk Upload feature. If you wish to use the AdWords Scripts for this, you can get in touch with their team via this link for further assistance.

Thanks and regards,
Peter
AdWords API Team

Reply all
Reply to author
Forward
0 new messages