Can't set AdGroupAdRotationMode "Use campaign setting" with google ads api v9

36 views
Skip to first unread message

pn...@yrglm-vn.com

unread,
Nov 26, 2021, 4:27:32 AM11/26/21
to AdWords API and Google Ads API Forum
Hi Adwords api team,

I can set update ad rotation mode: OPTIMIZE, ROTATE_FOREVER but when I need reset to "Use campaign setting" => I can't set it by google ads api v9

=> Reason: With function "FieldMasks.allSetFieldsOf(adGroupNeedUpdate)" not visible "ad_rotation_mode"

Please support me answer why and suggest solution if you can. Thank you so much.


Can_Not_Set_AdGroupAdRotationMode_Use_campaign_Setting.png

* My sample code as below:
AdGroup adGroupNeedUpdate = adGroupConverterAdWords.convert(adGroup, getAbAccountList()).getAdGroup();
adGroupNeedUpdate.setAdRotationMode(AdGroupAdRotationMode.UNSPECIFIED);

AdGroupOperation operation = AdGroupOperation.newBuilder().setUpdate(adGroupNeedUpdate)                 .setUpdateMask(FieldMasks.allSetFieldsOf(adGroupNeedUpdate)).build();

Google Ads API Forum Advisor

unread,
Nov 28, 2021, 11:35:28 PM11/28/21
to pn...@yrglm-vn.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out.

To use the campaign setting, you will need to specify the settings instead via the ad_serving_optimization_status attribute of the campaign resource.

To disable this at the ad group level, have you tried setting the ad_rotation_mode to blank instead? So our team can also investigate further, could you 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.

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,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RwID4:ref

Google Ads API Forum Advisor

unread,
Nov 30, 2021, 2:27:30 PM11/30/21
to pn...@yrglm-vn.com, adwor...@googlegroups.com

Hi there,

I work with Peter and will assist you. I reproduced this behavior of .setAdRotationMode(AdGroupAdRotationModeEnum.AdGroupAdRotationMode.UNSPECIFIED) not being sent to server in the log and raised it with my team. We will get back to you as soon as possible.

In the meantime, here's a REST equivalent that flips rotation control back to  campaign:
curl -i --request POST https://googleads.googleapis.com/v9/customers/{CID}/adGroups:mutate \
--header "Content-Type: application/json" \
--header "login-customer-id: {LCID}" \
--header "developer-token: {DT}" \
--header "Authorization: Bearer {AT}" \
--data "{
  
 'operations': [
    {
        'updateMask': 
            
             'adRotationMode',
        'update': {
'resourceName': 'customers/{CID}/adGroups/{AG}',
  'adRotationMode': 'OPTIMIZE'
}
      },
 ],
'responseContentType': 'MUTABLE_RESOURCE'


}
"


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 

Regards,
​​​​​​​

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RwID4:ref

Google Ads API Forum Advisor

unread,
Nov 30, 2021, 7:28:42 PM11/30/21
to pn...@yrglm-vn.com, adwor...@googlegroups.com
Hi there,

I received the answer from my team.  To clear a field, you set the field mask in the update but don't send any value to the API. I tried this and it worked.
Reply all
Reply to author
Forward
0 new messages