$adGroupCriterion = new BiddableAdGroupCriterion(); $adGroupCriterion->adGroupId = $adGroupId; $adGroupCriterion->criterion = $criterion; // Update destination URL. $adGroupCriterion->destinationUrl = 'http://www.example.com/new'; // Create operation. $operation = new AdGroupCriterionOperation(); $operation->operand = $adGroupCriterion; $operation->operator = 'SET'; $operations = array($operation); // Make the mutate request. $result = $adGroupCriterionService->mutate($operations); // Display result. $adGroupCriterion = $result->value[0]; printf("Placement with ID '%s' has updated destination URL '%s'.\n", $adGroupCriterion->criterion->id, $adGroupCriterion->destinationUrl); } // 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. UpdatePlacementExample($user, $adGroupId, $criterionId); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testUpdatePlacementExample() { $criterionId = $this->testUtils->CreatePlacement($this->adGroupId); UpdatePlacementExample($this->user, $this->adGroupId, $criterionId); }