Class awAdGroupService

Description

AdWords 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/AdGroupService.php

awService
   |
   --awAdGroupService
Method Summary
 awAdGroupService awAdGroupService ([boolean $useSandbox = false])
 awAdGroupReturnValue addAdGroup (int $campaignId, object awAdGroup $newAdGroup, [string $clientEmail = ''])
 awAdGroupReturnValue addAdGroupList (int $campaignId, array $newAdGroups, [string $clientEmail = ''])
 awAdGroupPage get (awAdGroupSelector $adGroup, [ $clientEmail = ''])
 awAdGroupPage getActiveAdGroups (float $campaignId, [string $clientEmail = ''])
 awAdGroupPage getAdGroup (float $adGroupId, [string $clientEmail = ''])
 awAdGroupPage getAdGroupList ( $adgroupIds, [string $clientEmail = ''], array $adgroupIDs)
 awAdGroupPage getAllAdGroups (int $campaignId, [string $clientEmail = ''])
 awAdGroupReturnValue mutate (array $adGroupOperations, [ $clientEmail = ''])
 awAdGroupReturnValue updateAdGroup (object awAdGroup $adGroup, [string $clientEmail = ''])
 awAdGroupReturnValue updateAdGroupList (array $adGroups, [string $clientEmail = ''])
 void _getServiceHeaders ([ $clientEmail = ''])
Methods

awAdGroupService Constructor

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  ?>

awAdGroupService awAdGroupService ([boolean $useSandbox = false])
  • boolean $useSandbox: should we use the sandbox

Adds a new AdGroup to a Campaign.

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$campaignId - ID of the Campaign to which new AdGroup will be added
  5.  //$newAdGroup is an object of class awAdGroup
  6.  $response $adgroupService->addAdGroup($campaignId$newAdGroup);
  7.  //$response is an object of class awAdGroup which holds the new
  8.  //created AdGroup
  9.  ?>

awAdGroupReturnValue addAdGroup (int $campaignId, object awAdGroup $newAdGroup, [string $clientEmail = ''])
  • int $campaignId: ID of the Campaign to which new AdGroup will be added
  • object awAdGroup $newAdGroup: an object of class awAdGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Adds new AdGroups to a Campaign.

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$campaignId - ID of the Campaign to which new AdGroups will be added
  5.  //$adgroup1, $adgroup2 are objects of class awAdGroup
  6.  $newAdGroups array($adgroup1$adgroup2);
  7.  $response $adgroupService->addAdGroupList($campaignId$newAdGroups);
  8.  //$response is an array of objects of class awAdGroup which
  9.  //holds the new created AdGroups
  10.  ?>

awAdGroupReturnValue addAdGroupList (int $campaignId, array $newAdGroups, [string $clientEmail = ''])
  • int $campaignId: ID of the Campaign to which new AdGroups will be added
  • array $newAdGroups: array of objects of class awAdGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns a list of all the ad groups specified by the ad group selector from the target customer's account.

awAdGroupPage get (awAdGroupSelector $adGroup, [ $clientEmail = ''])
  • awAdGroupSelector $adGroup: A selector used to specify which adgroups should be returned.
  • $clientEmail

Get all information about the Active ad groups associated with a campaign.

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$campaignId - Campaigns's ID
  5.  $response $adgroupService->getActiveAdGroups($campaignId);
  6.  //$response is an object of class awAdGroup
  7.  ?>

awAdGroupPage getActiveAdGroups (float $campaignId, [string $clientEmail = ''])
  • float $campaignId: The campaign whose ad groups will be retrieved.
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns all information about the specified AdGroup

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$adgroupId - AdGroup's ID
  5.  $response $adgroupService->getAdGroup($adgroupId);
  6.  //$response is an object of class awAdGroup
  7.  ?>

awAdGroupPage getAdGroup (float $adGroupId, [string $clientEmail = ''])
  • float $adGroupId: ID of the AdGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Returns a list of AdGroups

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$adgroupId1, $adgroupId2 - AdGroups' IDs
  5.  $adgroupIDs array($adgroupId1$adgroupId2);
  6.  $response $adgroupService->getAdGroupList($adgroupIDs);
  7.  //$response is an array of objects of class awAdGroup
  8.  ?>

awAdGroupPage getAdGroupList ( $adgroupIds, [string $clientEmail = ''], array $adgroupIDs)
  • array $adgroupIDs: array of adGroups' IDs
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account
  • $adgroupIds

Returns all AdGroups from a Campaign. If there are no AdGroups in this Campaign, an empty array will be returned

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$campaignId - ID of the Campaign
  5.  $response $adgroupService->getAllAdGroups($campaignId);
  6.  //$response is an array of objects of class awAdGroup
  7.  ?>

awAdGroupPage getAllAdGroups (int $campaignId, [string $clientEmail = ''])
  • int $campaignId: ID of the Campaign
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Mutates (add, remove and set) ad groups as specified by the operations. Note: to REMOVE use SET and mark status to DELETE.

awAdGroupReturnValue mutate (array $adGroupOperations, [ $clientEmail = ''])
  • array $adGroupOperations: array of objects of class AdGroupOperation
  • $clientEmail

Updates the fields of an existing AdGroup

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$adgroup is an object of class awAdGroup
  5.  $response $adgroupService->updateAdGroup($adgroup);
  6.  //$response == true
  7.  ?>

awAdGroupReturnValue updateAdGroup (object awAdGroup $adGroup, [string $clientEmail = ''])
  • object awAdGroup $adGroup: object of class awAdGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Updates the fields of multiple existing AdGroups

Example:

  1.  <?php
  2.  $adgroupService new awAdGroupService();
  3.  $adgroupService->setTokens($authToken$developerToken);
  4.  //$adgroup1, $adgroup2 are objects of class awAdGroup
  5.  $adGroups array($adgroup1$adgroup2);
  6.  $response $adgroupService->updateAdGroupList($adGroups);
  7.  //$response == true
  8.  ?>

awAdGroupReturnValue updateAdGroupList (array $adGroups, [string $clientEmail = ''])
  • array $adGroups: array of objects of class awAdGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account
void _getServiceHeaders ([ $clientEmail = ''])
  • $clientEmail

Inherited Methods

Inherited From awService

 awService::__construct()
 awService::callService()
 awService::checkArray()
 awService::checkArrayOf()
 awService::checkObjectOf()
 awService::getAccount()
 awService::getClientCustomerId()
 awService::getClientEmail()
 awService::getResponseHeaders()
 awService::getToolkit()
 awService::setAccount()
 awService::setClientCustomerId()
 awService::setClientEmail()
 awService::setTokens()
 awService::setUserAgent()
 awService::_getServiceHeadersV2009()
 awService::_returnResponseAsArrayOf()
 awService::_returnResponseAsObjectOf()

Documentation generated on Thu, 15 Apr 2010 19:06:08 +0300 by phpDocumentor 1.4.3