Hi,
I am trying to get campaign bid modifiers using the GAQL (also using the google ads api) and i am not getting any results.
When trying to get ad_group bid adjustments for the same campaign i am able to see the bid adjustments and the "ad_group_bid_modifier.bid_modifier_source":"CAMPAIGN".
couple of question:
1. Why I am not getting anything querying the campaign_bid_modifier and do get it under the ad_group_bid_modifier , when it is set on the campaign level?
here is the script I run :
const campaignId = 15366453339
function print(rows, entity){
if(!rows.hasNext()){
console.log('No result found for ' + entity)
}else{
while (rows.hasNext()) {
var e = rows.next();
console.log(JSON.stringify(e))
}
}
}
function main() {
console.log(`getting campaign bid modifier for campaign ${campaignId}`)
const campaign_bid_modifier = AdsApp.report(`SELECT campaign_bid_modifier.bid_modifier, campaign_bid_modifier.criterion_id, campaign_bid_modifier.resource_name FROM campaign_bid_modifier WHERE campaign.id = 15366453339`)
print(campaign_bid_modifier.rows(), "campaign_bid_modifier")
console.log(`getting ad_group bid modifier for campaign ${campaignId}`)
const ad_group_bid_modifier = AdsApp.report(`SELECT ad_group_bid_modifier.bid_modifier, ad_group_bid_modifier.bid_modifier_source, ad_group_bid_modifier.criterion_id, ad_group_bid_modifier.ad_group, ad_group_bid_modifier.resource_name FROM ad_group_bid_modifier WHERE campaign.id = 15366453339`)
print(ad_group_bid_modifier.rows(), "ad_group_bid_modifier")
}
resulting :
getting campaign bid modifier for campaign 15366453339
No result found for campaign_bid_modifier
getting ad_group bid modifier for campaign 15366453339
{"ad_group_bid_modifier.criterion_id":"30000","ad_group_bid_modifier.ad_group":........
{"ad_group_bid_modifier.criterion_id":"30001","ad_group_bid_modifier.ad_group":"customers/93.....
script can be found here:
script name: bid_adjustments
** Additional question I have but not directly regarding the google ads scripts:
When i am using the google ads api, I am not able to get any results using the campaign_bid_modifier entity, but do get it under the ad_group_bid_modifier , then using the resource_name trying to modify the bid_adjustment which fails with "Resource not found". I learned that indeed that resource (ad_group_bid_adjustment) does not exist (because it is campaign level) . But also cant change the bid_adjustment using campaign_bid_modifier entity. So basically I have no way to modify it, but to actually create ad_group_bid_modifier at adgroup level and "override" campaign level? which is not cool :).
Thanks for the help !!!