Class AdWordSiteSuggestionService

Description

AdWords Lib Site Suggestion Service Class

Provides operations for getting web site suggestions by category, topics, URLs or demographics.

Located in /services/AdWordSiteSuggestionService.inc

AdWordService
   |
   --AdWordSiteSuggestionService
Method Summary
 AdWordSiteSuggestionService AdWordSiteSuggestionService (string $soapToolkit)
 array|false getSitesByCategoryName (string $categoryName, object $targeting, [string $clientEmail = ''])
 array|false getSitesByDemographics (object $demo, object $targeting, [string $clientEmail = ''])
 array|false getSitesByTopics (array $topics, object $targeting, [string $clientEmail = ''])
 array|false getSitesByUrls (array $urls, object $targeting, [string $clientEmail = ''])
Methods

AdWordSiteSuggestionService 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

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

Returns site suggestions based on the specified category name.

Each suggestion contains useful information such as the URL, accepted ad formats and page views.

Example:

  1.  <?php
  2.  $service->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  // $targeting is object of class AdWordLanguageGeoTargeting
  4.  $response $service->getSitesByCategoryName('Animals'$targeting);
  5.  if ($response === false// if an error appears
  6.          $err $service->getLastError()//get error object
  7.          echo $err->toString()//output error
  8.          exit();
  9.  }
  10.  //$response is an array of objects of class AdWordSiteSuggestion
  11.  ?>

array|false getSitesByCategoryName (string $categoryName, object $targeting, [string $clientEmail = ''])
  • string $categoryName: the name of a category
  • object $targeting: object of class AdWordLanguageGeoTargeting
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns site suggestions based on the specified demographics criteria, including gender, age, income, ethnicity and whether there are children in the household.

Each suggestion contains useful information such as the URL, accepted ad formats and page views.

Example:

  1.  <?php
  2.  $service->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  // $demo is object of class AdWordDemographicsTarget
  4.  // $targeting is object of class AdWordLanguageGeoTargeting
  5.  $response $service->getSitesByDemographics($demo$targeting);
  6.  if ($response === false// if an error appears
  7.          $err $service->getLastError()//get error object
  8.          echo $err->toString()//output error
  9.          exit();
  10.  }
  11.  //$response is an array of objects of class AdWordSiteSuggestion
  12.  ?>

array|false getSitesByDemographics (object $demo, object $targeting, [string $clientEmail = ''])

Returns site suggestions based on the specified topics.

Each suggestion contains useful information such as the URL, accepted ad formats and page views.

Example:

  1.  <?php
  2.  $service->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  // $targeting is object of class AdWordLanguageGeoTargeting
  4.  $response $service->getSitesByTopics(array('car''flower')$targeting);
  5.  if ($response === false// if an error appears
  6.          $err $service->getLastError()//get error object
  7.          echo $err->toString()//output error
  8.          exit();
  9.  }
  10.  //$response is an array of objects of class AdWordSiteSuggestion
  11.  ?>

array|false getSitesByTopics (array $topics, object $targeting, [string $clientEmail = ''])
  • array $topics: a list of keywords, each of which can be a word or phrase
  • object $targeting: object of class AdWordLanguageGeoTargeting
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns site suggestions based on the specified URLs.

Each suggestion contains useful information such as the URL, accepted ad formats and page views.

Example:

  1.  <?php
  2.  $service->setAccount($myEmail$myPass$myUserAgent$myDeveloperToken$myApplicationToken);
  3.  // $targeting is object of class AdWordLanguageGeoTargeting
  4.  $response $service->getSitesByUrls(array('http://google.com''http://yahoo.com')$targeting);
  5.  if ($response === false// if an error appears
  6.          $err $service->getLastError()//get error object
  7.          echo $err->toString()//output error
  8.          exit();
  9.  }
  10.  //$response is an array of objects of class AdWordSiteSuggestion
  11.  ?>

array|false getSitesByUrls (array $urls, object $targeting, [string $clientEmail = ''])
  • array $urls: a list of seed URLs
  • object $targeting: object of class AdWordLanguageGeoTargeting
  • 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:28 +0300 by phpDocumentor 1.3.2