本文整理汇总了PHP中AdWordsUser::LogDefaults方法的典型用法代码示例。如果您正苦于以下问题:PHP AdWordsUser::LogDefaults方法的具体用法?PHP AdWordsUser::LogDefaults怎么用?PHP AdWordsUser::LogDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdWordsUser
的用法示例。
在下文中一共展示了AdWordsUser::LogDefaults方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateUser
/**
* Creates an AdWordsUser from the test auth and settings files.
* @param $defaultVersion the default version of the API the user should use
* @return AdWordsUser the new user
*/
public static function CreateUser($defaultVersion = NULL)
{
$testDataPath = dirname(__FILE__) . '/../../../../../../test_data/';
$authFile = $testDataPath . 'test_auth.ini';
$settingsFile = $testDataPath . 'test_settings.ini';
$user = new AdWordsUser($authFile, NULL, NULL, NULL, NULL, NULL, NULL, $settingsFile);
$user->SetDefaultVersion($defaultVersion);
$user->LogDefaults();
return $user;
}
示例2: addCampaign
public function addCampaign($name = 'Campaign #', $stategy_type = Core_Util_Adwords::STRATEGY_DEFAULT_TYPE)
{
$user = new AdWordsUser();
// Optionally, enable logging to capture the content of SOAP requests and
// responses.
$user->LogDefaults();
// Instantiate the desired service class by calling the get***Service method on
// the AdWordsUser instance.
$campaignService = $user->GetService('CampaignService', Core_Util_Adwords::ADWORDS_VERSION);
// Create data objects and invoke methods on the service class instance. The
// data objects and methods map directly to the data objects and requests for
// the corresponding web service.
// Create new campaign structure.
$campaign = new Campaign();
$campaign->name = $name;
$campaign->status = 'ACTIVE';
$campaign->biddingStrategyConfiguration = new BiddingStrategyConfiguration();
$campaign->biddingStrategyConfiguration->biddingStrategyType = $stategy_type;
$budget_id = uniqid();
$budget = new Budget($budget_id);
$budget->name = 'Budget #' . $budget_id;
$budget->period = 'DAILY';
$budget->amount = new Money(1000);
$budget->deliveryMethod = 'STANDARD';
$campaign->budget = $budget;
//$campaign->budget = new Budget('123', 'default budget', 'DAILY', new Money(10000), 'STANDARD');
$operation = new CampaignOperation();
$operation->operand = $campaign;
$operation->operator = 'ADD';
$operations[] = $operation;
// Add campaign.
$campaignReturnValue = $campaignService->mutate($operations);
return $campaignReturnValue;
/* foreach ($result->value as $campaign) {
printf("Campaign with name '%s' and ID '%s' was added.\n", $campaign->name,
$campaign->id);
}
*/
}