Hello All,

I am looking to use the FieldMask attribute to overwrite the conversion 
threshold values that are preset for a customer ID and associated Campaign 
ID inorder to pause the campaign. Can you please help with the script that 
I can use for this?
I feel the script shared in this mail trail may be relevant, but I am unsure

Shafali

On Tuesday, March 2, 2021 at 1:54:16 AM UTC+5:30 Mohammad Ahmad wrote:

> Hi all i am also getting permission denied problem here is the code i am 
> using to pause campaign. I will really appreciate if you can have any 
> comment
>
> def pauseCampaign(client='someid.apps.googleusercontent.com', 
> customer_id='someid', campaign_id='campaignid'):
> campaign_service = client.get_service("CampaignService", version="v6")
> # Create campaign operation.
> campaign_operation = client.get_type("CampaignOperation", version="v6")
> campaign = campaign_operation.update
> campaign.resource_name = campaign_service.campaign_path(
> customer_id, campaign_id
> )
> campaign.status = client.get_type("CampaignStatusEnum", 
> version="v6").PAUSED
> campaign.network_settings.target_search_network = False
> # Retrieve a FieldMask for the fields configured in the campaign.
> fm = protobuf_helpers.field_mask(None, campaign)
> campaign_operation.update_mask.CopyFrom(fm)
>
> # Update the campaign.
> try:
> campaign_response = campaign_service.mutate_campaigns(
> customer_id, [campaign_operation]
> )
> except google.ads.google_ads.errors.GoogleAdsException as ex:
> print(
> 'Request with ID "%s" failed with status "%s" and includes the '
> "following errors:" % (ex.request_id, ex.error.code().name)
> )
> for error in ex.failure.errors:
> print('\tError with message "%s".' % error.message)
> if error.location:
> for field_path_element in error.location.field_path_elements:
> print("\t\tOn field: %s" % field_path_element.field_name)
> sys.exit(1)
>
> print("Updated campaign %s." % campaign_response.results[0].resource_name)
>
> On Tue, Mar 2, 2021 at 12:45 AM Phil Lachmann <
> phil.l...@ingagepartners.com> wrote:
>
>> Xiaoming,
>>
>>   Thank you. I have sent an email to the address you provided with the 
>> information that Ernie requested.
>>
>> Thank,
>> Phil Lachmann
>>
>> On Monday, March 1, 2021 at 1:00:17 PM UTC-5 adsapiforumadvisor wrote:
>>
> Hi Phil,
>>>
>>> Thank you for reaching out. I work with Ernie. If this is the case, 
>>> please send the requested information directly to our email alias at 
>>> googleadsa...@google.com.
>>>
>>
>>>
>>> Thanks and regards,
>>> Xiaoming, Google Ads API Team
>>>  
>>>
>>
>>> [image: Google Logo] 
>>> Xiaoming 
>>> Google Ads API Team 
>>>   
>>>
>>> ref:_00D1U1174p._5004Q2CSvqt:ref
>>>
>>
>>
>> The content of this message is confidential. If you have received it by 
>> mistake, please inform us by an email reply, delete the message, and do not 
>> forward the contents of this message to anyone. The integrity and security 
>> of this email cannot be guaranteed over the Internet. Therefore, the sender 
>> and company will not be held liable for any damage caused by the message. 
>> Finally, the opinions disclosed by the sender do not have to reflect those 
>> of the company, therefore the company refuses to take any liability for the 
>> damage caused by the content of this email.
>>
>> If it is not necessary to print this email, please help us keep the 
>> environment litter-free
>>
>> -- 
>> -- 
>> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>> 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...@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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/adwords-api/6b7ff554-afc0-45e9-b6ea-70ac7c81b6bbn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/adwords-api/6b7ff554-afc0-45e9-b6ea-70ac7c81b6bbn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a59715e3-8c45-45ea-a60a-cad2841e7d22n%40googlegroups.com.
  • Re... Shafali Kapoor
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to