Class AdWordTrafficEstimatorService

Description

AdWords Lib Traffic Estimator Service Class

Provides keyword traffic estimates for new or existing keywords, ad groups, and campaigns

Located in /services/AdWordTrafficEstimatorService.inc

AdWordService
   |
   --AdWordTrafficEstimatorService
Method Summary
 AdWordTrafficEstimatorService AdWordTrafficEstimatorService (string $soapToolkit)
 array|false checkKeywordTraffic (array $keywordTrafficRequests, [string $clientEmail = ''])
 array|false estimateAdGroupList (array $adGroupRequests, [string $clientEmail = ''])
 array|false estimateCampaignList (array $campaignRequests, [string $clientEmail = ''])
 array|false estimateKeywordList (array $keywordRequests, [string $clientEmail = ''])
Methods

AdWordTrafficEstimatorService Constructor. It takes one parameter - name of a supported by AdWords Lib SOAP toolkit

Example:

  1.  <?php
  2.  ?>
Please use defined constants for supported by AdWords Lib toolkit names

AdWordTrafficEstimatorService AdWordTrafficEstimatorService (string $soapToolkit)
  • string $soapToolkit: name of a supported by AdWords Lib SOAP Toolkit

Check a batch of keywords to see whether they will get any traffic.

If a keyword is not expected to get any traffic, you more than likely don't want to bother adding it. Also, if a keyword is not expected to get any traffic, it is probably not worth calling estimateKeywordList on it.

Example:

  1.  <?php
  2.  $trafService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  //$keywordTrafficRequests is array of objects of class AdWordKeywordTrafficRequest
  4.  $response $trafService->checkKeywordTraffic($keywordTrafficRequests);
  5.  if ($response === false// if an error appears
  6.          $errr $classKW->getLastError()//get error object
  7.          echo $errr->toString()//output error
  8.          exit();
  9.  }
  10.  //$response is an array of objects of class AdWordKeywordTraffic
  11.  ?>

array|false checkKeywordTraffic (array $keywordTrafficRequests, [string $clientEmail = ''])
  • array $keywordTrafficRequests: array of objects of class AdWordKeywordTrafficRequest
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns traffic estimates for the requested set of new or existing ad groups.

All of the ad groups must be new or all of the ad groups must be from the same campaign. New ad groups are estimated as if they were part of a new campaign with global targeting

Example:

  1.  <?php
  2.  $trafService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  //$adgroupReq1, $adgroupReq2 are objects of class AdWordAdGroupRequest
  4.  $adGroupRequests array($adgroupReq1$adgroupReq2);
  5.  $response $trafService->estimateAdGroupList($adGroupRequests);
  6.  if ($response === false// if an error appears
  7.          $errr $classKW->getLastError()//get error object
  8.          echo $errr->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is an array of objects of class AdWordAdGroupEstimate
  12.  ?>

array|false estimateAdGroupList (array $adGroupRequests, [string $clientEmail = ''])
  • array $adGroupRequests: array of objects of class AdWordAdGroupRequest
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns traffic estimates for the requested set of new and/or existing campaigns

Example:

  1.  <?php
  2.  $trafService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  //$campReq1, $campReq2 are objects of class AdWordCampaignRequest
  4.  $campaignRequests array($campReq1$campReq2);
  5.  $response $trafService->estimateCampaignList($campaignRequests);
  6.  if ($response === false// if an error appears
  7.          $errr $classKW->getLastError()//get error object
  8.          echo $errr->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is an array of objects of class AdWordCampaignEstimate
  12.  ?>

array|false estimateCampaignList (array $campaignRequests, [string $clientEmail = ''])
  • array $campaignRequests: array of objects of class AdWordCampaignRequest
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns traffic estimates for the requested set of new keywords.

All of the keywords must be new. New keywords are estimated as if they were part of a single new ad group in a single new campaign with global targeting.

Example:

  1.  <?php
  2.  $trafService->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  //$keywReq1, $keywReq2 are objects of class AdWordKeywordRequest
  4.  $keywordRequests array($keywReq1$keywReq2);
  5.  $response $trafService->estimateKeywordList($keywordRequests);
  6.  if ($response === false// if an error appears
  7.          $errr $classKW->getLastError()//get error object
  8.          echo $errr->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is an array of objects of class AdWordKeywordEstimate
  12.  ?>

array|false estimateKeywordList (array $keywordRequests, [string $clientEmail = ''])
  • array $keywordRequests: array of objects of class AdWordKeywordRequest
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Inherited Methods

Inherited From AdWordService

 AdWordService::AdWordService()
 AdWordService::callService()
 AdWordService::getAccount()
 AdWordService::getClientCustomerId()
 AdWordService::getClientEmail()
 AdWordService::getLastError()
 AdWordService::getResponseHeaders()
 AdWordService::setAccount()
 AdWordService::setClientCustomerId()
 AdWordService::setClientEmail()

Documentation generated on Mon, 10 Sep 2007 15:07:29 +0300 by phpDocumentor 1.3.2