Google Ads API: how to remove cpcBid from keyword/ad group criterion (Python)

103 views
Skip to first unread message

Mat

unread,
May 17, 2019, 9:30:44 AM5/17/19
to AdWords API and Google Ads API Forum
Hi,

how can we remove a cpcBid from a keyword (or any other ad_group_criterion), to make the adGroup cpcBid the source of the cpcBid, using the Google Ads API with the Python library?

In the legacy AdWords API, we used to set the criterion cpcBid = 0, but this does not seem to work anymore.

Based on this example, I've tried several approaches, but none ot them worked:

ad_group_criterion.cpc_bid_micros.value = 0:

errors {
  error_code {
    field_error: INVALID_VALUE
  }
  message: "The field\'s value is invalid."
  trigger {
    int64_value: 0
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
        value: 12
      }
    }
    field_path_elements {
      field_name: "update"
    }
    field_path_elements {
      field_name: "cpc_bid_micros"
    }
  }
}



ad_group_criterion.cpc_bid_micros.value = int():

errors {
  error_code {
    field_error: INVALID_VALUE
  }
  message: "The field\'s value is invalid."
  trigger {
    int64_value: 0
  }
  location {
    field_path_elements {
      field_name: "operations"
      index {
        value: 12
      }
    }
    field_path_elements {
      field_name: "update"
    }
    field_path_elements {
      field_name: "cpc_bid_micros"
    }
  }
}


ad_group_criterion.cpc_bid_micros.value = None:

TypeError: None has type NoneType, but expected one of: int, long


Can you help me?

Regards
Mat

googleadsapi...@google.com

unread,
May 20, 2019, 12:38:39 AM5/20/19
to AdWords API and Google Ads API Forum
Hi Mat,

Thank you for reaching out. The INVALID_VALUE error occurs if you try to fit an incorrect value into a field. As per the documentation, cpc_bid_micros should be an Int64Value. Upon checking the examples you provided, it seems like you are not passing an Int64Value into cpc_bid_micros. This being said, can you try passing an Int64Value and retry your request? Feel free to write back if the error persists

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/0aedf22e-c5ab-40c1-be59-7a1d22f7a102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mat

unread,
May 20, 2019, 1:42:39 AM5/20/19
to AdWords API and Google Ads API Forum
Hi Dave,

thx for the response.

However - I think that 0 is well within the limits of INT64:

ad_group_criterion.cpc_bid_micros.value = 0

(see my first example in the op)

Regards 
Mat

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 4:26:42 AM5/20/19
to adwor...@googlegroups.com

Hi Mat,

I've tried this on my end and confirmed that you can't explicitly set 0 as an Int64Value.

See below sample code in java:
Screenshot from 2019-05-20 16-09-52

Feel free to write back if you have further clarifications.



Regards,
Dave
Google Ads API Team



ref:_00D1U1174p._5001UAq7Vw:ref

Mat

unread,
May 20, 2019, 5:23:12 AM5/20/19
to AdWords API and Google Ads API Forum
Hi Dave,

unfortunately, I can't open/see the screenshot with the java sample code.

Regards
Mat

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 6:13:11 AM5/20/19
to adwor...@googlegroups.com

Hi Mat,

My apologies for that. Re-sending the image file.



Regards,
Dave
Google Ads API Team



ref:_00D1U1174p._5001UAq7Vw:ref
Screenshot from 2019-05-20 16-09-52.png
Reply all
Reply to author
Forward
0 new messages