Ejemplo n.º 1
0
        $realTimeBiddingSetting = new RealTimeBiddingSetting();
        $realTimeBiddingSetting->optIn = TRUE;
        $campaign->settings[] = $realTimeBiddingSetting;
        // Create operation.
        $operation = new CampaignOperation();
        $operation->operand = $campaign;
        $operation->operator = 'ADD';
        $operations[] = $operation;
    }
    // Make the mutate request.
    $result = $campaignService->mutate($operations);
    // Display results.
    foreach ($result->value as $campaign) {
        printf("Campaign with name '%s' and ID '%s' was added.\n", $campaign->name, $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.
    AddCampaignsExample($user);
} catch (Exception $e) {
    printf("An error has occurred: %s\n", $e->getMessage());
}
 public function testAddCampaignsExample()
 {
     AddCampaignsExample($this->user);
 }