Class awAdGroupCriterionService

Description

AdWords Lib Criterion Class

Use this class to work with Google AdWords Criterion Service CriterionService provides operations for accessing, modifying, and creating Criteria (Keywords and Websites) in an AdGroup.

Located in /services/AdGroupCriterionService.php

awService
   |
   --awAdGroupCriterionService
Method Summary
 awAdGroupCriterionService awAdGroupCriterionService ([boolean $useSandbox = false])
 awAdGroupCriterionReturnValue addCriteria (array $newCriteria, [string $clientEmail = ''])
 awAdGroupCriterionPage get (awAdGroupCriterionSelector $selector, [ $clientEmail = ''])
 awAdGroupCriterionPage getAllCriteria (int $adGroupId, [string $clientEmail = ''])
 awAdGroupCriterionPage getCampaignNegativeCriteria (int $campaignId, [string $clientEmail = ''])
 awAdGroupCriterionPage getCriteria (int $adGroupId, array $criterionIds, [string $clientEmail = ''])
 awAdGroupCriterionReturnValue mutate ( $criterionOperations, [ $clientEmail = ''], array $adGroupOperations)
 awAdGroupCriterionReturnValue removeCriteria (int $adGroupId, array $criterionIds, [string $clientEmail = ''])
 awAdGroupCriterionReturnValue updateCriteria (array $criteria, [string $clientEmail = ''])
 void _getServiceHeaders ([ $clientEmail = ''])
Methods

awAdGroupCriterionService Constructor

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  ?>

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

Adds a new Criteria to an AdGroup.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$newCriteria is an array of objects of class awCriterion
  5.  $response $criterionService->addCriteria($newCriteria);
  6.  //$response is an array of objects of class awCriterion which hold the new created criteria
  7.  ?>

awAdGroupCriterionReturnValue addCriteria (array $newCriteria, [string $clientEmail = ''])
  • array $newCriteria: array of objects of class awCriterion
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Gets adgroup criteria.

awAdGroupCriterionPage get (awAdGroupCriterionSelector $selector, [ $clientEmail = ''])

Return a list of criteria associated with this AdGroup.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$adGroupId - ID of the adGroup
  5.  $response $criterionService->getAllCriteria($adGroupId);
  6.  //$response is an array of objects of class awCriterion
  7.  ?>

awAdGroupCriterionPage getAllCriteria (int $adGroupId, [string $clientEmail = ''])
  • int $adGroupId: ID of the adGroup
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Gets a list of the negative criteria associated with a campaign.

Negative criteria determine where the ads in the campaign will not be displayed. Negative website criteria indicate websites where the ads will not appear. Negative keyword criteria indicate keywords that cause the ads to be excluded from display.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$campaignId - ID of the campaign
  5.  $response $criterionService->getCampaignNegativeCriteria($campaignId);
  6.  //$response is an array of objects of class awCriterion
  7.  ?>

awAdGroupCriterionPage getCampaignNegativeCriteria (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

Return a list of criteria with the specified IDs associated with this AdGroup.

This function will only return criteria associated with one AdGroup at a time. Invalid IDs are ignored.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$adGroupId - ID of the adGroup
  5.  //$criterionId1, $criterionId2 - Criterion IDs
  6.  $criterionIds array($criterionId1$criterionId2);
  7.  $response $criterionService->getCriteria($adGroupId$criterionIds);
  8.  //$response is an array of objects of class awCriterion
  9.  ?>

awAdGroupCriterionPage getCriteria (int $adGroupId, array $criterionIds, [string $clientEmail = ''])
  • int $adGroupId: ID of the adGroup
  • array $criterionIds: array of Criterion IDs
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Adds, removes or updates adgroup criteria.

awAdGroupCriterionReturnValue mutate ( $criterionOperations, [ $clientEmail = ''], array $adGroupOperations)

Remove a list of Criteria from an AdGroup.

Note that there is no 'undo' for this operation.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$adGroupId - ID of the adGroup
  5.  //$criterionId1, $criterionId2 - Criterion IDs
  6.  $criterionIds array($criterionId1$criterionId2);
  7.  $response $criterionService->removeCriteria($adGroupId$criterionIds);
  8.  //$response == true
  9.  ?>

awAdGroupCriterionReturnValue removeCriteria (int $adGroupId, array $criterionIds, [string $clientEmail = ''])
  • int $adGroupId: ID of the adGroup
  • array $criterionIds: Criterion IDs
  • string $clientEmail: provide the clientEmail when you want to edit a client's account rather than your own account

Update all mutable fields associated with these Criteria.

Only the maxCpc, maxCpm, negative, and destinationUrl fields are mutable.

Example:

  1.  <?php
  2.  $criterionService new awAdGroupCriterionService();
  3.  $criterionService->setTokens($authToken$developerToken);
  4.  //$criterion1, $criterion2 is an object of class awCriterion
  5.  $criteria array($criterion1$criterion2);
  6.  $response $criterionService->updateKeywordList($criteria);
  7.  //$response == true
  8.  ?>

awAdGroupCriterionReturnValue updateCriteria (array $criteria, [string $clientEmail = ''])
  • array $criteria: array of objects of class awCriterion
  • 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