AdWordAdServiceAdWords Lib Ad Class
Use this class to work with Google AdWords Ad Service AdService provides operations for accessing, creating and modifying Ads in an AdGroup. Each Ad object is the visual representation of an ad. Each ad group has one or more ads, where an ad can be of many different formats (such as text ad or an image ad). An ad can be in following serving statuses: enabled, disabled, or paused. Only enabled ads will be served; a disabled or paused ad will not be served.
Located in /services/AdWordAdService.inc
AdWordService | --AdWordAdService
object|false
checkAds
(array $ads, [object AdWordLanguageTarget $languageTarget = ''], [object AdWordGeoTarget $geoTarget = ''], [string $clientEmail = ''])
object|false
findBusinesses
(string $name, string $address, string $countryCode, [string $clientEmail = ''])
object|false
getAdStats
(int $adGroupId, int $adIds, int $startDay, int $endDay, [string $clientEmail = ''])
AdWordAdService Constructor. It takes one parameter - name of a supported by AdWords Lib SOAP toolkit
Example:
- <?php
- ?>
Make a batch of new Ads.
The adGroupId field of the Ad indicates which AdGroup to add the Ad to. The adGroupId field is required, and the indicated AdGroup must exist already. The Ad's id and disapproved fields are set by the AdService -- if you fill them in they will be ignored. By default, Ads are enabled and will be served as soon as they are created. You can set the status field on the ad to either paused or disabled to prevent the ad from being active.
Example:
- <?php
- //$newAds is an array of objects of class AdWordAd or any of its descendants
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAd
- ?>
Check a batch of Ads for policy errors.
The number of Ads in the batch is limited to the maximum number of Ads per adgroup.
Example:
- <?php
- //$ads is an array of objects of class AdWordAd
- //$languageTarget is an object of class AdWordLanguageTarget
- //$geoTarget is an object of class AdWordGeoTarget
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class ApiError which hold a list of policy errors
- ?>
Searches for businesses with similar attributes.
This call is similar to querying Google Local Search. All parameters are required.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordBusiness
- ?>
Return all active Ads associated with the list of AdGroup ids specified.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAd
- ?>
Return information about one Ad.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAd
- ?>
Get statistics for a list of ads in an ad group.
The time granularity is one day.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordStatsRecord
- ?>
Return all Ads (enabled, disabled, or paused) associated with the list of AdGroup ids specified.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAd
- ?>
Returns the list of businesses registered to the user in the Local Business Center.
The user is determined by the clientEmail header if it is specified. Otherwise, the email header is used instead.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordBusiness
- ?>
Returns a list of all videos stored under the users account.
The user is determined by the clientEmail if specified. Otherwise, the email header is used.
Example:
- <?php
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordVideo
- ?>
Update a batch of ads.
Use the id field of the ad to indicate which ad to update. Currently only the status field is updateable, all other fields will be ignored.
Example:
- <?php
- $criterionService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$ad1, $ad2 is an object of class AdWordAd or any of its descendants
- $ads = array($ad1, $ad2);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response == true
- ?>
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:13 +0300 by phpDocumentor 1.3.2