Cant get campaign bid modifier also are set

46 views
Skip to first unread message

Alex Portnoy

unread,
Feb 17, 2022, 5:12:08 AM2/17/22
to Google Ads Scripts Forum
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:
customer id: 9362310631
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 :).

Screen Shot 2022-02-17 at 12.10.08.png
Thanks for the help !!!


Google Ads Scripts Forum Advisor

unread,
Feb 18, 2022, 4:25:10 AM2/18/22
to adwords...@googlegroups.com
Hi Alex,

For us to have a closer look, could you please provide the following details via Reply privately to author option?
  • CID
  • Script Name
In case you encounter an error when using the mentioned option, you can send the requested information on this email (googleadsscr...@google.com) instead, then let us know here once sent.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2WwaLn:ref

Alex Portnoy

unread,
Feb 18, 2022, 4:55:44 AM2/18/22
to Google Ads Scripts Forum on behalf of adsscripts
Hi , i did provide you with the CID and script name in my original email

customer id: 9362310631
script name: bid_adjustments
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/cUwG0lyh_xk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/NkX1r000000000000000000000000000000000000000000000R7HU5O00SL5cxLO-TNqp-3zUsPNa_w%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Feb 22, 2022, 2:49:40 AM2/22/22
to adwords...@googlegroups.com
Hi,

Thank you for getting back to us.

I've checked the script and the screenshot that you provided. The reason that you're getting result from ad_group_bid_modifier, but not in campaign_bid_modifier is due to those two report has different entity level. On your screenshot, the bid modifier were applied to Ad group level and not directly to campaign level.
Reply all
Reply to author
Forward
0 new messages