Hello,
Thank you, it worked. Here is the corresponding python version if anyone is 
interested:

GA_CLIENT = GoogleAdsClient.load_from_storage('/path/')
api_service = GA_CLIENT.get_service('CampaignService', version='v2')
operation = GA_CLIENT.get_type('CampaignOperation', version='v2')

campaign_data = operation.update
campaign_data.resource_name = 'customers/xxx/campaigns/yyy'

operation.update_mask.CopyFrom(protobuf_helpers.field_mask(None, 
operation.update))

operation.update_mask.paths.append('selective_optimization.conversion_actions')

api_service.mutate_campaigns('<account_id>', [operation])


On Wednesday, December 18, 2019 at 9:20:55 AM UTC-8, adsapiforumadvisor 
wrote:
>
> Hi Sergiy,
>
> Thank you for your patience. I was trying to remove the selective 
> optimization field for the campaigns within my account and was successfully 
> able to achieve that using mutate method of CampaignService 
> <https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v2.services#google.ads.googleads.v2.services.MutateCampaignsRequest>
>  
> via API. Please find below the code snippet used (in Java) to achieve this 
> via API for your reference. Also, please refer to this 
> <https://developers.google.com/google-ads/api/docs/samples/update-campaign> 
> code sample used to update the campaigns. You need to use the Field Mask 
> <https://developers.google.com/google-ads/api/docs/client-libs/python/field-masks>
>  
> in Python to specify the fields that you want to update via API and update 
> the selective optimization with new empty value. This way you will be able 
> to set the 'selective_optimization' field to blank by removing the old 
> value while updating the campaign. Let us know if you need any additional 
> information.
>
> // Creates a Campaign object with the proper resource name and any other 
> changes.
>
> Campaign campaign = Campaign.newBuilder()
>                                     
>  .setResourceName(ResourceNames.campaign(customerId, campaignId))
>                                     
>  .setSelectiveOptimization(SelectiveOptimization.newBuilder().build())
>                                      .build();
> FieldMask fieldMask = FieldMask.newBuilder()
>                                       
>  .addPaths("selective_optimization.conversion_actions")
>                                        .build();
> CampaignOperation operation = CampaignOperation.newBuilder()
>                                                      .setUpdate(campaign)
>                                                   
>    .setUpdateMask(fieldMask)
>                                                      .build();
>
> Regards,
> Nikisha Patel, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UOEfuS:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c778bbb5-61c3-496b-826a-f85af97f0207%40googlegroups.com.

Reply via email to