$campaignService = $user->GetService('CampaignService', ADWORDS_VERSION); // Create campaign using an existing ID. $campaign = new Campaign(); $campaign->id = $campaignId; $campaign->status = 'PAUSED'; // Create operation. $operation = new CampaignOperation(); $operation->operand = $campaign; $operation->operator = 'SET'; $operations = array($operation); // Make the mutate request. $result = $campaignService->mutate($operations); // Display result. $campaign = $result->value[0]; printf("Campaign with ID '%s' was paused.\n", $campaign->id); } // Don't run the example if the file is being included. if (__FILE__ != realpath($_SERVER['PHP_SELF'])) { return; } try { // Get AdWordsUser from credentials in "../auth.ini" // relative to the AdWordsUser.php file's directory. $user = new AdWordsUser(); // Log every SOAP XML request and response. $user->LogAll(); // Run the example. UpdateCampaignExample($user, $campaignId); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testUpdateCampaignExample() { $campaignId = $this->testUtils->CreateCampaign(); UpdateCampaignExample($this->user, $campaignId); }