$biddingStrategyConfiguration->bids[] = $bid; $adGroupCriterion->biddingStrategyConfiguration = $biddingStrategyConfiguration; $adGroupCriteria[] = $adGroupCriterion; // Create operation. $operation = new AdGroupCriterionOperation(); $operation->operand = $adGroupCriterion; $operation->operator = 'ADD'; $operations[] = $operation; } // Make the mutate request. $result = $adGroupCriterionService->mutate($operations); // Display results. foreach ($result->value as $adGroupCriterion) { printf("Keyword with text '%s', match type '%s', and ID '%s' was added.\n", $adGroupCriterion->criterion->text, $adGroupCriterion->criterion->matchType, $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. AddKeywordsExample($user, $adGroupId); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testAddKeywordsExample() { AddKeywordsExample($this->user, $this->adGroupId); }