AdWordServiceAdWords Lib AdWordService
Base class for all AdWords Services Classes.
Located in /services/AdWordService.inc
| Class | Description |
|---|---|
AdWordAccountService
|
AdWords Lib Account Service Class |
AdWordAdGroupService
|
AdWords Lib AdGroup Class |
AdWordCampaignService
|
AdWords Lib Campaign Service Class |
AdWordCriterionService
|
AdWords Lib Criterion Class |
AdWordInfoService
|
AdWords Lib Info Service Class |
AdWordAdService
|
AdWords Lib Ad Class |
AdWordReportService
|
AdWords Lib Report Service Class |
AdWordTrafficEstimatorService
|
AdWords Lib Traffic Estimator Service Class |
AdWordKeywordToolService
|
AdWords Lib KeywordToolService Class |
AdWordSiteSuggestionService
|
AdWords Lib Site Suggestion Service Class |
mixed
callService
(string $command, string $paramsxml, [string $clientEmail = ''], [boolean $expectsArray = false])
void
setAccount
(string $accountEmail, string $accountPass, string $accountUserAgent, string $accountDeveloperToken, string $accountApplicationToken)
AdWordService Constructor. It takes two parameters - name of a supported by AdWords Lib SOAP toolkit and a service URL
Example:
- <?php
- ?>
Call a Google AdWords service
Example:
- <?php
- // $result holds response string from Google AdWords service or false on error
- ?>
Returns an array with Google AdWords account that was set by AdWordService::setAccount() function
Example:
- <?php
- ...
- //$account is an array with the account values set by AdWordService::setAccount() function
- ?>
Returns clientCustomerId that was set by AdWordService::setClientCustomerId() function
If no clientCustomerId was set, returns an empty string.
Example:
- <?php
- ...
- ?>
Returns clientEmail that was set by AdWordService::setClientEmail() function
If no clientEmail was set, returns an empty string.
Example:
- <?php
- ...
- ?>
Returns last error. If there is no error returns NULL
Example:
- <?php
- ...
- if ($result === false)
- ?>
Returns an array with AdWords response headers from the last operation.
The headers include requestId, responseTime, operations and units. Units contains the amount of quota used.
Example:
- <?php
- $keywordService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
-
- # $newKeyword is an object of class AdWordKeyword
- $response = $keywordService->addKeyword($newKeyword);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
-
- # print the response headers
- echo 'Request ID: ' . $responseHeaders['requestId'] . '<br>';
- echo 'Response Time: ' . $responseHeaders['responseTime'] . '<br>';
- echo 'Operations: ' . $responseHeaders['operations'] . '<br>';
- echo 'Units: ' . $responseHeaders['units'] . '<br>';
- ?>
Sets a google AdWords account to work with
Example:
- <?php
- ?>
Sets clientCustomerId to be used for a service
Provide the clientCustomerId when you want to edit a client's account rather than your own account. The client's customerId set by this function must be managed by account set by AdWordService::setAccount() function
Example:
- <?php
- // you can set a client's customerId and work with their account
- //you can still use same object to manage another client account
- ?>
Sets clientEmail to be used for a service
Provide the clientEmail when you want to edit a client's account rather than your own account. The client's email set by this function must be managed by account set by AdWordService::setAccount() function
Example:
- <?php
- // you can call a service command for a client
- // or you can set a client's email and work with their account
- //you can still use same object to manage another client account
- ?>
Documentation generated on Mon, 10 Sep 2007 15:07:27 +0300 by phpDocumentor 1.3.2