$criterion->id = $criterionId; // Create ad group criterion. $adGroupCriterion = new AdGroupCriterion(); $adGroupCriterion->adGroupId = $adGroupId; $adGroupCriterion->criterion = new Criterion($criterionId); // Create operation. $operation = new AdGroupCriterionOperation(); $operation->operand = $adGroupCriterion; $operation->operator = 'REMOVE'; $operations = array($operation); // Make the mutate request. $result = $adGroupCriterionService->mutate($operations); // Display result. $adGroupCriterion = $result->value[0]; printf("Keyword with ID '%s' was deleted.\n", $adGroupCriterion->criterion->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. DeleteKeywordExample($user, $adGroupId, $criterionId); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testDeleteKeywordExample() { $criterionId = $this->testUtils->CreateKeyword($this->adGroupId); DeleteKeywordExample($this->user, $this->adGroupId, $criterionId); }