AdWordAdGroupServiceAdWords Lib AdGroup Class
Use this class to work with Google AdWords AdGroup Service. AdGroupService provides operations for accessing, modifying, and creating AdGroups
Located in /services/AdWordAdGroupService.inc
AdWordService | --AdWordAdGroupService
object|false
addAdGroup
(int $campaignID, object AdWordAdGroup $newAdGroup, [string $clientEmail = ''])
array|false
getAdGroupStats
(int $campaignId, array $adGroupIds, string $start, string $end, [string $clientEmail = ''])
AdWordAdGroupService Constructor. It takes one parameter - name of a supported by AdWords Lib SOAP toolkit
Example:
- <?php
- ?>
Adds a new AdGroup to a Campaign.
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignID - ID of the Campaign to which new AdGroup will be added
- //$newAdGroup is an object of class AdWordAdGroup
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an object of class AdWordAdGroup which holds the new
- //created AdGroup
- ?>
Adds new AdGroups to a Campaign.
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignID - ID of the Campaign to which new AdGroups will be added
- //$adgroup1, $adgroup2 are objects of class AdWordAdGroup
- $newAdGroups = array($adgroup1, $adgroup2);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAdGroup which
- //holds the new created AdGroups
- ?>
Returns all information about the specified AdGroup
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$adgroupId - AdGroup's ID
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an object of class AdWordAdGroup
- ?>
Returns a list of AdGroups
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$adgroupId1, $adgroupId2 - AdGroups' IDs
- $adgroupIDs = array($adgroupId1, $adgroupId2);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAdGroup
- ?>
Gets statistics for a list of ad groups in a Campaign for a period of time
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignID - ID of the Campaign
- //$adgroup1, $adgroup2 are objects of class AdWordAdGroup
- $adGroupIds = array($adgroup1, $adgroup2);
- $start = '2005-01-01T00:00:00Z';
- $end = '2005-02-01T00:00:00Z';
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordStatsRecord
- ?>
Returns all AdGroups from a Campaign. If there are no AdGroups in this Campaign, an empty array will be returned
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignID - ID of the Campaign
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAdGroup
- ?>
Removed from AdWords API.
Returns all changed AdGroups from a Campaign. If there are no AdGroups in this Campaign, an empty array will be returned
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignID - ID of the Campaign
- $since = '2005-01-01T00:00:00Z';
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordAdGroup
- ?>
Updates the fields of an existing AdGroup
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$adgroup is an object of class AdWordAdGroup
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response == true
- ?>
Updates the fields of multiple existing AdGroups
Example:
- <?php
- $adgroupService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$adgroup1, $adgroup2 are objects of class AdWordAdGroup
- $adGroups = array($adgroup1, $adgroup2);
- 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:12 +0300 by phpDocumentor 1.3.2