adServingOptimizationStatusSpecified set to True when getting Campaigns

64 views
Skip to first unread message

Trevor Sanders

unread,
Mar 5, 2018, 3:25:35 PM3/5/18
to AdWords API Forum
When updating to v201802, I came across a migration issue that is associated with v201710. I am using the dotnet client library to get campaigns from the API, perform some updates to them, and make mutate requests. However, although I am not setting AdServingOptimizationStatus (which is deprecated at the campaign level), the campaigns automatically come back from the API with AdServingOptimizationStatusSpecified set to true. This needs to be set to false when reading any campaign in order to avoid CANNOT_SET_AD_ROTATION_MODE errors.

Vincent Racaza (AdWords API Team)

unread,
Mar 5, 2018, 11:11:49 PM3/5/18
to AdWords API Forum
Hi Trevor,

I could not see the adServingOptimizationStatusSpecified field in the campaign level, only the adServingOptimizationStatus field, and is not a Boolean type. This said, can you provide your complete SOAP request and response logs that shows your scenario via Reply privately to author so I can further check?

Also, in regards to adServingOptimizationStatus field, as you may know, starting from v201710, this field is now a read only field (as you can see here) and will default to OPTIMIZE during campaign creation. So in getting the campaign with this field, it will return its default value.

Thanks,
Vincent
AdWords API Team

Trevor Sanders

unread,
Mar 7, 2018, 11:05:56 AM3/7/18
to AdWords API Forum

I'm not sure I made the issue clear with my original post. I am using the AdWords C# SDK to get and modify campaign objects from the API. These are the steps I'm taking, and the issue I'm having:
  • Get a campaign by ID using the CampaignService.get(Selector) method.
  • This returns a C# Campaign object
    • By default the object has the field adServingOptimizationStatus set to OPTIMIZE.
    • The C# object also has an adServingOptimizationStatusSpecified field. This is set to TRUE automatically.
  • If I make changes to different fields on the Campaign, and then call CampaignService.mutate(operation[]), I get the error CANNOT_SET_AD_ROTATION_MODE.
  • As you said, the adServingOptimizationStatus field is read only as of v201710, so if the adServingOptimizationStatusSpecified field is set to TRUE, the operation fails.
  • As a work-around, whenever I get a campaign from the API, I have to set adServingOptimizationStatusSpecified on the C# Campaign object to FALSE before doing anything else.
It seems like this is pretty clearly a problem with the dotnet lib. 

Thanks,
Trevor

Vincent Racaza (AdWords API Team)

unread,
Mar 7, 2018, 10:52:33 PM3/7/18
to AdWords API Forum
Hi Trevor,

Thanks for explaining your scenario. It seems that this issue is more on the .NET client library as you mentioned that the C# object has adServingOptimizationStatusSpecified field which is set to true automatically, and this makes your request fail since if you are updating a field in your campaign, you are not supposed to include the adServingOptimizationStatus field. You can post this concern here as the library owners can provide further assistance in regards to this.

Also, if your main goal is to update different fields in your campaign, I recommend that you only include the fields that you wish to update so the request won't fail. You can refer to this example which includes the fields that can be updated.
Reply all
Reply to author
Forward
0 new messages