当前位置: 首页>>代码示例>>PHP>>正文


PHP AdWordsUser::LogDefaults方法代码示例

本文整理汇总了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;
 }
开发者ID:fertandil87,项目名称:adwords-php-client,代码行数:15,代码来源:TestUtils.php

示例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);
           }
         */
 }
开发者ID:randyibarrola,项目名称:active,代码行数:39,代码来源:Adwords.php


注:本文中的AdWordsUser::LogDefaults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。