I'm trying to update campaign budget

I can update the status & the name.

How can I update the budget:

        $campaign = new Campaign([
            'resource_name' => ResourceNames::forCampaign($customerId, 
$campaignId),
            'status' => CampaignStatus::PAUSED,
            'name' => 'Test ' . date( 'Y-m-d h:i' )
        ]);
        // Constructs an operation that will update the campaign with the 
specified resource name,
        // using the FieldMasks utility to derive the update mask. This 
mask tells the Google Ads
        // API which attributes of the campaign you want to change.
        $campaignOperation = new CampaignOperation();
        $campaignOperation->setUpdate($campaign);
        
$campaignOperation->setUpdateMask(FieldMasks::allSetFieldsOf($campaign));

        // Issues a mutate request to update the campaign.
        $campaignServiceClient = 
$googleAdsClient->getCampaignServiceClient();
        $response = $campaignServiceClient->mutateCampaigns(
            $customerId,
            [$campaignOperation]
        );

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/e009f935-5129-4c88-80dd-15326cb75078n%40googlegroups.com.
  • PH... Mike Behr
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to