fieldMaskError: "FIELD_HAS_SUBFIELDS" when updating campaign bidding strategy

315 views
Skip to first unread message

Quan Zhang

unread,
Sep 16, 2021, 4:14:18 PM9/16/21
to AdWords API and Google Ads API Forum
Hi,

I'm using .NET sdk to create and update a Google Campaign and met the following issue:

I'm using the following way to create a campaign with MaxClicks bidding scheme and everything goes well:
campaign.BiddingStrategyType = BiddingStrategyType.TargetSpend;
campaign.TargetSpend = new TargetSpend();

However, when I try to update a campaign (without any actual) like:
campaign.ResourceName = campaignResourceName;
campaign.BiddingStrategyType = BiddingStrategyType.TargetSpend;
campaign.TargetSpend = new TargetSpend();

The API returns the error:
errors": [
      {
        "errorCode": {
          "fieldMaskError": "FIELD_HAS_SUBFIELDS"
        },
        "message": "The field mask updated a field with subfields: 'target_spend'.",
        "location": {
          "fieldPathElements": [
            {
              "fieldName": "operations",
              "index": 0
            }
          ]

But I don't receive the error when setting "campaign.TargetSpend.CpcBidCeilingMicros" to some value in the update call. 

I'm using the following way to call:
            return new CampaignOperation()
            {
                Update = CampaignToUpdate,
                UpdateMask = FieldMasks.AllSetFieldsOf(CampaignToUpdate)
            };

Is the behavior expected?

Google Ads API Forum Advisor

unread,
Sep 17, 2021, 2:32:01 AM9/17/21
to adwor...@googlegroups.com
Hi Quan,

In order for our team to take a closer look at the error you encountered, could you also provide the complete request and response logs, with the request-id?

If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. For .NET, you can check out this other link instead.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2NUqn4:ref

quan zhang

unread,
Nov 9, 2021, 4:09:24 PM11/9/21
to AdWords API and Google Ads API Forum
Hi,

What is the default value of the  campaign.TargetSpend.CpcBidCeilingMicros ?  It seems I must set some value to bypass this issue. Can I put the value to be 0 if I don't want to specify a  CpcBidCeilingMicros ?

Thanks,
Quan

Google Ads API Forum Advisor

unread,
Nov 10, 2021, 12:19:52 AM11/10/21
to qzhan...@gmail.com, adwor...@googlegroups.com
Hi Quan,

Thank you for the reply. I am also a member of the Google Ads API team and let me provide support to your concern.

Yes, you may try to set 0 to that field. Let me know how it goes after.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2NUqn4:ref

quan zhang

unread,
Nov 10, 2021, 2:44:55 PM11/10/21
to AdWords API and Google Ads API Forum
Hi Ernie,

Thanks for your reply. One more follow-up question. Can I set the  campaign.TargetSpend.CpcBidCeilingMicros = long.MAXVALUE  instead of 0 if I don't want to have the bid ceiling? Setting to 0 still gives me the error I showed in my original post

Quan

Google Ads API Forum Advisor

unread,
Nov 11, 2021, 1:05:39 AM11/11/21
to qzhan...@gmail.com, adwor...@googlegroups.com
Hi Quan,

To investigate and to provide suggestions to your concern, could you provide the complete request and response logs with request ID and request header generated on your end with error when applying 0 to the CpcBidCeilingMicros?

You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Franklin Buitron

unread,
Jan 20, 2023, 12:21:41 PM1/20/23
to Google Ads API and AdWords API Forum
We are facing the same issue.
Before setting a cpc bid limit was optional.

I guess now is required?

Did you all solved this issue?

Google Ads API Forum Advisor

unread,
Jan 22, 2023, 9:40:55 PM1/22/23
to fbui...@tangocode.com, adwor...@googlegroups.com
Hi Franklin,

Thank you for reaching out to us.

For our team to further investigate first, could you also please provide us with the complete API logs (request and response with request-id) generated on your end?

You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

And for this, "Before setting a cpc bid limit was optional. I guess now is required?"
- This is still an optional field entered by the advertiser and specified in local micros. You may check this reference for more details.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


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