Google APIlity Library Reference
The APIlity PHP Library provides an object-oriented way to easily access and manage the Google AdWords API from within PHP.This comes along with an abstraction from the SOAP and WSDL details.
This reference documents all functions offered by the library. The functions are categorized into several sections with different senses.
Please note: each section has its own color represented by a colored bar at the right side and the particular link color. Thus orientation is very easy.
Quicknavigator
|
APIlity structure
Click the images to resize the class organigram and/or the object hierarchy: |
Campaign.php
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Object Operations
getActiveAdGroups()
Returns all active AdGroups of a given Campaign.
Parameters:
NoneResponse:
[AdGroup] activeAdGroupObjectsSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getActiveAdGroups());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAdScheduling()
Returns the Campaign's ad schedule.
Parameters:
NoneResponse:
adScheduling = array(
'status',
'intervals' = array(
array(
'day',
'startHour',
'startMinute',
'endHour',
'endMinute',
'multiplier'
)
)
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getAdScheduling());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllAdGroups()
Returns all AdGroups of a given Campaign.
Parameters:
NoneResponse:
[AdGroup] allAdGroupObjectsSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getAllAdGroups());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getBelongsToClientEmail()
Returns the client email this Campaign belongs to.
Parameters:
NoneResponse:
String emailSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBelongsToClientEmail();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getBudgetAmount()
Returns the Campaign's budget amount.
Parameters:
NoneResponse:
Integer budgetAmountSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBudgetAmount();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getBudgetOptimizerSettings()
Returns the Campaign's budget optimizer settings.
Parameters:
NoneResponse:
budgetOptimizerSettings = array(
'bidCeiling',
'enabled',
'takeOnOptimizedBids'
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getBudgetOptimizerSettings());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getBudgetPeriod()
Returns the Campaign's budget period.
Parameters:
NoneResponse:
String budgetPeriodSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBudgetPeriod();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCampaignData()
Returns all the Campaign's attributes in one go.
Parameters:
NoneResponse:
campaignData = array(
'name',
'id',
'belongsToClientEmail',
'status',
'startDate',
'endDate',
'budgetAmount',
'budgetPeriod',
'networkTargeting',
'languages',
'geoTargets',
'isEnabledOptimizedAdServing'
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignData());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCampaignNegativeKeywordCriteria()
Returns the Campaign's Negative Keyword Criteria.
Parameters:
NoneResponse:
campaignNegativeKeywords = array(
array(
'text',
'type'
)
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignNegativeKeywordCriteria());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCampaignNegativeWebsiteCriteria()
Returns the Campaign's Negative Website Criteria.
Parameters:
NoneResponse:
campaignNegativeWebsites = array(
array(
'url',
)
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignNegativeWebsiteCriteria());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCampaignStats($startDate, $endDate)
Returns the statistical data for a Campaign during the given period of time.
Parameters:
String startDate
String endDateResponse:
campaignStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'name'
)Sample:
$yesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 1,
date("Y")
)
);
$dayBeforeYesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 2,
date("Y")
)
);
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignStats($dayBeforeYesterday, $yesterday));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getEndDate()
Returns the Campaign's end date.
Parameters:
NoneResponse:
String endDateSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getEndDate();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getEstimate()
Returns a performance estimate for the Campaign.
Parameters:
NoneResponse:
campaignEstimate = array(
array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
),
'campaignName',
'campaignId'
)Sample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getEstimate());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getGeoTargets()
Returns the Campaign's geo targetings.
Parameters:
NoneResponse:
[String] geoTargetsSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getGeoTargets());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getId()
Returns the Campaign's ID.
Parameters:
NoneResponse:
Integer id // for MySQL use BigIntSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getId();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getIsEnabledOptimizedAdServing()
Returns if the advertisment serving of the Campaign is being optimized.
Parameters:
NoneResponse:
Boolean isEnabledOptimizedAdServingSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getIsEnabledOptimizedAdServing();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getLanguages()
Returns the Campaign's language targeting.
Parameters:
NoneResponse:
[String] languagesSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getLanguages());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getName()
Returns the Campaign's name.
Parameters:
NoneResponse:
String nameSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getName();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getNetworkTargeting()
Returns the Campaign's network targeting.
Parameters:
NoneResponse:
[String] networkTargetingSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getNetworkTargeting());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getRecommendedBudget()
Returns the Campaign's recommended budget.
Parameters:
NoneResponse:
Budget recommendedBudgetSample:
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getRecommendedBudget());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getStartDate()
Returns the Campaign's start date.
Parameters:
NoneResponse:
String startDateSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getStartDate();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getStatus()
Returns the Campaign's status.
Parameters:
NoneResponse:
String statusSample:
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getStatus();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setAdScheduling($newAdScheduling)
Sets the Campaign's new ad schedule.
Parameters:
newAdScheduling = array(
'status',
'intervals' = array(
array(
'day',
'startHour',
'startMinute',
'endHour',
'endMinute',
'multiplier',
)
)
)None
Sample:
$interval1 = array();
$interval1['multiplier'] = 1.5;
$interval1['day'] = "Saturday";
$interval1['startHour'] = 13;
$interval1['startMinute'] = 0;
$interval1['endHour'] = 15;
$interval1['endMinute'] = 15;
$interval2 = array();
$interval2['multiplier'] = 0.7;
$interval2['day'] = "Sunday";
$interval2['startHour'] = 9;
$interval2['startMinute'] = 30;
$interval2['endHour'] = 10;
$interval2['endMinute'] = 45;
$adScheduling = array(
'status' => "Enabled",
'intervals' => array(
$interval1,
$interval2
)
);
$campaignObject = createCampaignObject(123456789);
$campaignObject->setAdScheduling($adScheduling);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setBudgetAmount($newBudgetAmount)
Sets a new Campaign budget amount.
Parameters:
Integer newBudgetAmountResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setBudgetAmount(1000);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setBudgetOptimizerSettings($newBudgetOptimizerSettings)
Sets the Campaign's budget optimizer settings.
Parameters:
newBudgetOptimizerSettings = array(
'bidCeiling',
'enabled',
'takeOnOptimizedBids'
)Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$budgetOptimizerSettings = array(
'bidCeiling' => 42,
'enabled' => true,
'takeOnOptimizedBids' => true
);
$campaignObject->setBudgetOptimizerSettings($budgetOptimizerSettings);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setBudgetPeriod($newBudgetPeriod)
Sets a new Campaign budget period.
Parameters:
String newBudgetPeriodResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setBudgetPeriod('Daily');
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setCampaignNegativeKeywordCriteria($newCampaignNegativeKeywords)
Sets new Campaign Negative Keyword Criteria. Already existing Campaign Negative Keyword Criteria will be overwritten. However, already existing Campaign Negative Website Criteria will be kept.
Parameters:
newCampaignNegativeKeywords = array(
array(
'text',
'type'
)
)Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$negativeCriterion1 = array('text' => "none", 'type' => "Broad");
$negativeCriterion2 = array('text' => "of these", 'type' => "Phrase");
$campaignObject->setCampaignNegativeKeywordCriteria(
array($negativeCriterion1, $negativeCriterion2)
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setCampaignNegativeWebsiteCriteria($newCampaignNegativeWebsites)
Sets new Campaign Negative Website Criteria. Already existing Campaign Negative Website Criteria will be overwritten. However, already existing Campaign Negative Keyword Criteria will be kept.
Parameters:
newCampaignNegativeWebsites = array(
array(
'url'
)
)Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$negativeCriterion1 = array('url' => "spiegel.de");
$negativeCriterion2 = array('url' => "aol.com");
$campaignObject->setCampaignNegativeWebsiteCriteria(
array($negativeCriterion1, $negativeCriterion2)
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setConversionOptimizerSettings($conversionOptimizerSettings)
Sets the Campaign's conversion optimizer settings.
Parameters:
newConversionOptimizerSettings = array(
'enabled',
'maxCpaBidForAllAdGroups'
)Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$conversionOptimizerSettings = array(
'enabled' => true,
'maxCpaBidForAllAdGroups' => 10
);
$campaignObject->setConversionOptimizerSettings($conversionOptimizerSettings);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setEndDate($newEndDate)
Sets a new Campaign end date.
Parameters:
String newEndDateResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setEndDate("2011-12-17");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setGeoTargets($newGeoTargets)
Sets new Campaign geo targets.
Parameters:
newGeoTargets = array(
'countryTargets' => array(
'countries' => array(),
'excludedCountries' => array()
),
'regionTargets' => array(
'regions' => array(),
'excludedRegions' => array()
),
'metroTargets' => array(
'metros' => array(),
'excludedMetros' => array()
),
'cityTargets' => array(
'cities' => array(),
'excludedCities' => array()
),
'proximityTargets' => array(
'circles' => array(
'latitudeMicroDegrees',
'longitudeMicroDegrees',
'radiusMeters'
)
),
'targetAll'
)Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$newGeoTargets = array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Reutlingen, BW DE",
"Karlsruhe, BW DE"
),
'excludedCities' => array(
"Hamburg, HH DE"
)
),
'proximityTargets' => array(
'circles' => array()
)
);
$campaignObject->setGeoTargets($newGeoTargets);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setIsEnabledOptimizedAdServing($newFlag)
Sets the flag to show if the advertisment serving of the Campaign is being optimized.
Parameters:
Boolean newFlagResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setIsEnabledOptimizedAdServing(true);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setLanguages($newLanguages)
Sets a new Campaign language targeting.
Parameters:
[String] newLanguages // Pass array("all") to select all languagesResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setLanguages(array("fr", "de"));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setName($newName)
Sets a new Campaign name.
Parameters:
String newNameResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setName("The new name");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setNetworkTargeting($networkTargeting)
Sets the Campaign's network targeting.
Parameters:
[String] networkTargeting // Valid values: GoogleSearch, SearchNetwork, ContentNetworkResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setNetworkTargeting(array("GoogleSearch", "SearchNetwork"));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setStatus($newStatus)
Sets a new Campaign Status.
Parameters:
String newStatus // Pass "Active" or "Paused"Response:
NoneSample:
$campaignObject = createCampaignObject(123456789);
$campaignObject->setStatus("Active");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
toXml()
Returns the Campaign in XML format.
Parameters:
NoneResponse:
String campaignXml // Contains the Campaign in XML formatSample:
$campaignObject = createCampaignObject(123456789);
echo htmlspecialchars($campaignObject->toXml());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Class Operations
addCampaign(
$name,
$status,
$startDate,
$endDate,
$budgetAmount,
$budgetPeriod,
$networkTargeting,
$languages,
$geoTargets,
$adScheduling,
$budgetOptimizerSettings
)
Adds a Campaign to the current customer's account.
Parameters:
String name
String status
String startDate // Pass "" in order to start the Campaign directly after creation
String endDate // Pass "" in order to get a Campaign that never ends
Integer budgetAmount
String budgetPeriod
[String] networkTargeting
[String] languages // Pass array("all") to select all languages
newGeoTargets = array(
'countryTargets' => array(
'countries' => array(),
'excludedCountries' => array(),
),
'regionTargets' => array(
'regions' => array(),
'excludedRegions' => array()
),
'metroTargets' => array(
'metros' => array(),
'excludedMetros' => array()
),
'cityTargets' => array(
'cities' => array(),
'excludedCities' => array(),
),
'proximityTargets' => array(
'circles' => array(
'latitudeMicroDegrees',
'longitudeMicroDegrees',
'radiusMeters'
)
),
'targetAll'
)
{AdScheduling adScheduling}
{BudgetOptimizerSettings budgetOptimizerSettings}Response:
Campaign campaignObjectSample:
$campaignObject = addCampaign(
"Test",
"Active",
"2007-01-01",
"2011-01-01",
50,
'Daily',
array("GoogleSearch", "ContentNetwork"),
array("fr", "de"),
array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array("Grenoble, V FR")
),
'proximityTargets' => array(
'circles' => array()
)
)
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addCampaignList($campaigns)
Adds a list of Campaigns to the current customer's account. Please
note: this will fail completely even if just one Campaign fails, but
the function causes no SOAP overhead. Parameters:
campaigns = array(
array(
'name',
'status',
'startDate', // Pass "" in order to start the Campaign directly after creation
'endDate', // Pass "" in order to get a Campaign that never ends
'budgetAmount',
'budgetPeriod',
'networkTargeting',
'languages', // Pass array("all") to select all languages
'geoTargets' = array(
'countryTargets' => array(
'countries' => array(),
'excludedCountries' => array()
),
'regionTargets' => array(
'regions' => array(),
'excludedRegions' => array()
),
'metroTargets' => array(
'metros' => array(),
'excludedMetros' => array()
),
'cityTargets' => array(
'cities' => array(),
'excludedCities' => array()
),
'proximityTargets' => array(
'circles' => array(
'latitudeMicroDegrees',
'longitudeMicroDegrees',
'radiusMeters'
)
),
'targetAll'
)
{'adScheduling'}
{'budgetOptimizerSettings'}
)
)Response:
[Campaign] campaignObjectsSample:
$campaign1 = array(
'name' => "Test1",
'status' => "Active",
'startDate' => "2007-01-01",
'endDate' => "2011-01-01",
'budgetAmount' => 50,
'budgetPeriod' => 'Daily',
'networkTargeting' => array("GoogleSearch", "ContentNetwork"),
'languages' => array("de", "en"),
'geoTargets' => array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Grenoble, V FR"
)
),
'proximityTargets' => array(
'circles' => array()
)
)
);
$campaign2 = array(
'name' => "Test2",
'status' => "Active",
'startDate' => "2007-01-01",
'endDate' => "2011-01-01",
'budgetAmount' => 50,
'budgetPeriod' => 'Daily',
'networkTargeting' => array("GoogleSearch", "ContentNetwork"),
'languages' => array("de"),
'geoTargets' => array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Grenoble, V FR"
)
),
'proximityTargets' => array(
'circles' => array()
)
)
);
$campaignObjects = addCampaignList(array($campaign1, $campaign2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addCampaignsOneByOne($campaigns)
Adds a list of Campaigns to the current customer's account. Please
note: this will not fail completely if just one Campaign fails, but the
function causes a lot of SOAP overhead. Parameters:
campaigns = array(
array(
'name',
'status',
'startDate', // Pass "" in order to start the Campaign directly after creation
'endDate', // Pass "" in order to get a Campaign that never ends
'budgetAmount',
'budgetPeriod',
'networkTargeting',
'languages', // Pass array("all") to select all languages
'geoTargets' = array(
'countryTargets' => array(
'countries' => array(),
'excludedCountries' => array()
),
'regionTargets' => array(
'regions' => array(),
'excludedRegions' => array()
),
'metroTargets' => array(
'metros' => array(),
'excludedMetros' => array()
),
'cityTargets' => array(
'cities' => array(),
'excludedCities' => array()
),
'proximityTargets' => array(
'circles' => array(
'latitudeMicroDegrees',
'longitudeMicroDegrees',
'radiusMeters'
)
),
'targetAll',
)
{'adScheduling'}
{'budgetOptimizerSettings'}
)
)Response:
[Campaign] campaignObjectsSample:
$campaign1 = array(
'name' => "Test1",
'status' => "Active",
'startDate' => "2007-01-01",
'endDate' => "2011-01-01",
'budgetAmount' => 50,
'budgetPeriod' => 'Daily',
'networkTargeting' => array("GoogleSearch", "ContentNetwork"),
'languages' => array("de", "en"),
'geoTargets' => array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Grenoble, V FR"
)
),
'proximityTargets' => array(
'circles' => array()
)
)
);
$campaign2 = array(
'name' => "Test2",
'status' => "Active",
'startDate' => "2007-01-01",
'endDate' => "2011-01-01",
'budgetAmount' => 50,
'budgetPeriod' => 'Daily',
'networkTargeting' => array("GoogleSearch", "ContentNetwork"),
'languages' => array("de"),
'geoTargets' => array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Grenoble, V FR"
)
),
'proximityTargets' => array(
'circles' => array()
)
)
);
$campaignObjects = addCampaignsOneByOne(array($campaign1, $campaign2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
createCampaignObject($givenCampaignId)
Creates a local Campaign object based on the Campaign's ID.
Parameters:
Integer givenCampaignIdResponse:
Campaign campaignObjectSample:
$campaignObject = createCampaignObject(123456789);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getActiveCampaigns()
Returns all active Campaigns of the current customer.
Parameters:
NoneResponse:
[Campaign] activeCampaignObjectsSample:
$activeCampaigns = getActiveCampaigns();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllCampaigns()
Returns all Campaigns of the current customer.
Parameters:
NoneResponse:
[Campaign] allCampaignObjectsSample:
$allCampaigns = getAllCampaigns();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCampaignList($givenCampaignIds)
Returns a list of Campaigns with the specified IDs.
Parameters:
[Integer] givenCampaignIdsResponse:
[Campaign] campaignObjectsSample:
$campaignIds = array(123456789, 987654321, 567891234);
$campaignObjects = getCampaignList($campaignIds);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
removeCampaign($campaignObject)
Removes a Campaign and unsets its object variable.
Parameters:
Campaign campaignObjectResponse:
NoneSample:
$campaignObject = createCampaignObject(123456789);
removeCampaign($campaignObject);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
AdGroup.php
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Object OperationsgetActiveAdsgetAdGroupData getAdGroupStats getAllAds getAllCriteria getBelongsToCampaignId getEstimate getId getKeywordContentMaxCpc getKeywordMaxCpc getMaxCpa getName getProxyKeywordMaxCpc getSiteMaxCpc getSiteMaxCpm getStatus setKeywordContentMaxCpc setKeywordMaxCpc setMaxCpa setName setSiteMaxCpc setSiteMaxCpm setStatus toXml |
Class OperationsaddAdGroupaddAdGroupList addAdGroupsOneByOne createAdGroupObject getActiveAdGroups getAdGroupList getAllAdGroups removeAdGroup |
| APIlity uses these native API AdGroup functions. | |
| These function are defined in the AdGroup Service WSDL. | |
Object Operations
getActiveAds()
Returns all active Ads of a given AdGroup.
Parameters:
NoneResponse:
[Ad] activeAdObjectsSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getActiveAds());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAdGroupData()
Returns all the AdGroup attributes at once.
Parameters:
NoneResponse:
adGroupData = array(
'name',
'id',
'belongsToCampaignId',
'keywordMaxCpc',
'siteMaxCpm',
'siteMaxCpc',
'maxCpa',
'keywordContentMaxCpc',
'status'
)Sample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAdGroupData());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAdGroupStats($startDate, $endDate)
Returns the statistical data for an AdGroup during the given period of time.
Parameters:
String startDate
String endDateResponse:
adGroupStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'name'
)Sample:
$yesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 1,
date("Y")
)
);
$dayBeforeYesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 2,
date("Y")
)
);
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAdGroupStats($dayBeforeYesterday, $yesterday));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllAds()
Returns all Ads of a given AdGroup.
Parameters:
NoneResponse:
[Ad] allAdObjectsSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAllAds());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllCriteria()
Returns all Criteria of a given AdGroup.
Parameters:
NoneResponse:
[Criteria] allCriterionObjectsSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAllCriteria());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getBelongsToCampaignId()
Returns the Campaign ID to which the AdGroup belongs.
Parameters:
NoneResponse:
Integer belongsToAdGroupId // for MySQL use BigIntSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getBelongsToAdGroupId();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getEstimate()
Returns a performance estimate for the AdGroup.
Parameters:
NoneResponse:
adGroupEstimate = array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
)Sample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getEstimate());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getId()
Returns the AdGroup's ID.
Parameters:
NoneResponse:
Integer id // for MySQL use BigIntSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getId();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getKeywordContentMaxCpc()
Returns the AdGroup's KeywordContentMaxCPC.
Parameters:
NoneResponse:
Integer keywordContentMaxCpcSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getKeywordContentMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getKeywordMaxCpc()
Returns the AdGroup's KeywordMaxCPC.
Parameters:
NoneResponse:
Integer keywordMaxCpcSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getKeywordMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getMaxCpa()
Returns the AdGroup's MaxCPA.
Parameters:
NoneResponse:
Integer maxCpaSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getMaxCpa();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getName()
Returns the AdGroup's name.
Parameters:
NoneResponse:
String nameSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getName();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getProxyKeywordMaxCpc()
Returns the AdGroup's ProxyKeywordMaxCPC.
Parameters:
NoneResponse:
Integer proxyKeywordMaxCpcSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getProxyKeywordMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getSiteMaxCpc()
Returns the AdGroup's SiteMaxCPC.
Parameters:
NoneResponse:
Integer siteMaxCpcSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getSiteMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getSiteMaxCpm()
Returns the AdGroup's SiteMaxCPM.
Parameters:
NoneResponse:
Integer siteMaxCpmSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getSiteMaxCpm();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getStatus()
Returns the AdGroup's status.
Parameters:
NoneResponse:
String status // Enabled, Paused, DeletedSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getStatus();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setKeywordContentMaxCpc($newKeywordContentMaxCpc)
Sets a new AdGroup KeywordContentMaxCPC.
Parameters:
Integer newKeywordContentMaxCpcResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setKeywordContentMaxCpc(0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setKeywordMaxCpc($newKeywordMaxCpc)
Sets a new AdGroup KeywordMaxCPC.
Parameters:
Integer newKeywordMaxCpcResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setKeywordMaxCpc(0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setMaxCpa($newMaxCpa)
Sets the AdGroup's MaxCPA.
Parameters:
Integer newMaxCpaResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setMaxCpa(10);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setName($newName)
Sets a new AdGroup name.
Parameters:
String newNameResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setName("The new name");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setSiteMaxCpc($newSiteMaxCpc)
Sets the AdGroup's SiteMaxCPC.
Parameters:
Integer newSiteMaxCpcResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setSiteMaxCpc(10);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setSiteMaxCpm($newMaxCpm)
Sets a new AdGroup SiteMaxCPM.
Parameters:
Integer newSiteMaxCpmResponse:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setSiteMaxCpm(0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setStatus($newStatus)
Sets a new AdGroup Status.
Parameters:
String newStatus // Pass "Enabled" or "Paused"Response:
NoneSample:
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setStatus("Paused");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
toXml()
Returns the AdGroup in XML format.
Parameters:
NoneResponse:
String adGroupXml // Contains the AdGroup in XML formatSample:
$adGroupObject = createAdGroupObject(123456789);
echo htmlspecialchars($adGroupObject->toXml());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Class Operations
addAdGroup($name, $campaignId, $status, $keywordMaxCpc)
Adds an AdGroup to the given Campaign. Please note: we need to have keywordMaxCpc XOR siteMaxCpm, so we need to set either keywordMaxCpc or siteMaxCpm to a value different from zero, but never both.
Parameters:
String name
Integer belongsToCampaignId
String status
Integer keywordMaxCpc
{Integer siteMaxCpm}
{Integer siteMaxCpc}
{Integer maxCpa}
{Integer keywordContentMaxCpc}Response:
AdGroup adGroupObjectSample:
$adGroupObject = addAdGroup("Test", 123456789, "Enabled", 0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addAdGroupList($adGroups)
Adds a list of AdGroups to the given Campaign. Please note: this will
fail completely even if just one AdGroup fails, but the function causes
no SOAP overhead. Parameters:
adGroups = array(
array(
'name',
'belongsToCampaignId',
'status',
'keywordMaxCpc',
{'siteMaxCpm'},
{'Integer siteMaxCpc'},
{'Integer maxCpa'},
{'keywordContentMaxCpc'}
)
)Response:
[AdGroup] adGroupObjectsSample:
$adGroup1 = array(
'name' => "Test1",
'belongsToCampaignId' => 123456789,
'status' => "Enabled",
'keywordMaxCpc' => 0.10
);
$adGroup2 = array(
'name' => "Test2",
'belongsToCampaignId' => 123456789,
'status' => "Enabled",
'keywordMaxCpc' => 0.10
);
$adGroupObjects = addAdGroupList(array($adGroup1, $adGroup2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addAdGroupsOneByOne($adGroups)
Adds a list of AdGroups to the given Campaign. Please note: this will
not fail completely if just one AdGroup fails, but the function causes
a lot of SOAP overhead. Parameters:
adGroups = array(
array(
'name',
'belongsToCampaignId',
'status',
'keywordMaxCpc',
{'siteMaxCpm'},
{'Integer siteMaxCpc'},
{'Integer maxCpa'},
{'keywordContentMaxCpc'}
)
)Response:
[AdGroup] adGroupObjectsSample:
$adGroup1 = array(
'name' => "Test1",
'belongsToCampaignId' => 123456789,
'status' => "Enabled",
'keywordMaxCpc' => 0.10
);
$adGroup2 = array(
'name' => "Test2",
'belongsToCampaignId' => 123456789,
'status' => "Enabled",
'keywordMaxCpc' => 0.10
);
$adGroupObjects = addAdGroupList(array($adGroup1, $adGroup2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
createAdGroupObject($givenAdGroupId)
Creates a local AdGroup object based on the AdGroup's ID.
Parameters:
Integer givenAdGroupIdResponse:
AdGroup adGroupObjectSample:
$adGroupObject = createAdGroupObject(123456789);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getActiveAdGroups($campaignId)
Returns all active AdGroups of a given Campaign.
Parameters:
Integer campaignIdResponse:
[AdGroup] activeAdGroupObjectsSample:
$activeAdGroups = getActiveAdGroups(123456789);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAdGroupList($adGroupIds)
Returns only the specified AdGroups.
Parameters:
[Integer] adGroupIdsResponse:
[AdGroup] adGroupObjectsSample:
$adGroupIds = array(123456789, 987654321, 123459876);
$adGroupObjects = getAdGroupList($adGroupIds);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllAdGroups($campaignId)
Returns all AdGroups of a given Campaign.
Parameters:
Integer campaignIdResponse:
[AdGroup] allAdGroupObjectsSample:
$allAdGroups = getAllAdGroups(123456789);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
removeAdGroup($adGroupObject)
Removes an AdGroup and unsets its local object variable.
Parameters:
AdGroup adGroupObjectResponse:
NoneSample:
$adGroupObject = createAdGroupObject(123456789);
removeAdGroup($adGroupObject);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Criterion.php
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Object Operations
getBelongsToAdGroupId()
Returns the AdGroup ID to which the current Criterion belongs.
Parameters:
NoneResponse:
Integer belongsToAdGroupId // for MySQL use BigIntSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getBelongsToAdGroupId();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionData() // KeywordCriterion object
Returns all the KeywordCriterion's attributes at once.
Parameters:
NoneResponse:
criterionData = array(
'text',
'id',
'belongsToAdGroupId',
'type',
'criterionType',
'isNegative',
'isPaused',
'maxCpc',
'firstPageCpc',
'qualityScore',
'status',
'language',
'destinationUrl'
)Sample:
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getCriterionData());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionData() // WebsiteCriterion object
Returns all the WebsiteCriterion's attributes at once.
Parameters:
NoneResponse:
$criterionData = array(
'id',
'url',
'belongsToAdGroupId',
'criterionType',
'isNegative',
'maxCpm',
'maxCpc',
'status',
'language',
'destinationUrl'
);Sample:
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getCriterionData());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionStats($startDate, $endDate)
Returns the statistical data for a Criterion during the given period of time.
Parameters:
String startDate
String endDateResponse:
criterionStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'text'
)Sample:
$yesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 1,
date("Y")
)
);
$dayBeforeYesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 2,
date("Y")
)
);
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getCriterionStats($dayBeforeYesterday, $yesterday));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionType()
Returns the Criterion's type.
Parameters:
NoneResponse:
String criterionTypeSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getCriterionType();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getDestinationUrl()
Returns the Criterion's destination URL.
Parameters:
NoneResponse:
String destinationUrlSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getDestinationUrl();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getEstimate()
Returns a performance estimate for the Criterion.
Parameters:
NoneResponse:
keywordEstimate = array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)Sample:
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getEstimate());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getFirstPageCpc()
Returns the KeywordCriterion's FirstPageCPC.
Parameters:
NoneResponse:
Integer firstPageCpcSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getFirstPageCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getId()
Returns the Criterion's ID.
Parameters:
NoneResponse:
Integer id // for MySQL use BigIntSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getId();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getIsNegative()
Returns if the Criterion is negative or not.
Parameters:
NoneResponse:
Boolean isNegativeSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getIsNegative();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getIsPaused()
Returns if the Criterion is paused or not.
Parameters:
NoneResponse:
Boolean isPausedSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getIsPaused();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getLanguage()
Returns the Criterion's language.
Parameters:
NoneResponse:
String languageSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getLanguage();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getMaxCpc() // KeywordCriterion
Returns the KeywordCriterion's MaxCPC.
Parameters:
NoneResponse:
Integer maxCpcSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getMaxCpc() // WebsiteCriterion
Returns the WebsiteCriterion's MaxCPC.
Parameters:
NoneResponse:
Integer maxCpcSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getMaxCpm()
Returns the WebsiteCriterion's MaxCPM.
Parameters:
NoneResponse:
Integer maxCpmSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpm();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getProxyMaxCpc()
Returns the KeywordCriterion's ProxyMaxCPC.
Parameters:
NoneResponse:
Integer proxyMaxCpcSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getKeywordMaxCpc();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getQualityScore()
Returns the KeywordCriterion's QualityScore.
Parameters:
NoneResponse:
Integer qualityScoreSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getQualityScore();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getStatus()
Retuns the Criterion's status.
Parameters:
NoneResponse:
String statusSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getStatus;
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getText()
Returns the KeywordCriterion's text.
Parameters:
NoneResponse:
String criterionTextSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getText();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getType()
Returns the KeywordCriterion's type.
Parameters:
NoneResponse:
String typeSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getType();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getUrl()
Returns the WebsiteCriterion's URL.
Parameters:
NoneResponse:
String urlSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getUrl();
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setDestinationUrl($newDestinationUrl)
Sets the Criterion's new destination URL.
Parameters:
String newDestinationUrlResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setDestinationUrl("http://groups.google.com/group/adwords-api-php");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setIsNegative($newFlag)
Sets the flag to show if the Criterion is negative.
Parameters:
Boolean newFlagResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setIsNegative(true);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setIsPaused($newFlag)
Sets the flag to show if the Criterion is paused.
Parameters:
Boolean newFlagResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setIsPaused(true);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setLanguage($newLanguage)
Sets a new Criterion language. Please be aware that changing a Criterion's language will destroy its history.
Parameters:
String newLanguageResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setLanguage("fr");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setMaxCpc($newMaxCpc)
Sets a new Criterion MaxCPC.
Parameters:
Integer newMaxCpcResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setMaxCpc(0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setMaxCpm($newMaxCpm)
Sets a new WebsiteCriterion MaxCPM.
Parameters:
Integer newMaxCpmResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setMaxCpm(0.65);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setText($newText)
Sets a new KeywordCriterion text. Please be aware that renaming a KeywordCriterion will destroy its history.
Parameters:
String newTextResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setText("The new text");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setType($newType)
Sets a new KeywordCriterion type. Please be aware that changing a KeywordCriterion's type will destroy its history.
Parameters:
String newTypeResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setType("Exact");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
setUrl($newUrl)
Sets the WebsiteCriterion's new URL. Please be aware that changing a WebsiteCriterion's URL will destroy its history.
Parameters:
String newUrlResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setUrl("groups.google.com");
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
toXml()
Returns the Criterion in XML format.
Parameters:
NoneResponse:
String criterionXml // Contains the Criterion in XML formatSample:
$criterionObject = createCriterionObject(123456789, 987654321);
echo htmlspecialchars($criterionObject->toXml());
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Class Operations
addKeywordCriteriaOneByOne($keywordCriteria)
Adds a list of KeywordCriteria to the given AdGroup. Please note: this will
not fail completely even if just one Keyword fails, but the function
causes a lot of SOAP overhead. Parameters:
$keywordCriteria = array(
array(
'text',
'belongsToAdGroupId',
'type',
'isNegative',
'maxCpc',
'language',
'destinationUrl',
{'exemptionRequest'}
)
)Response:
[KeywordCriterion] criterionObjectsSample:
$criterion1 = array(
'text' => "test1",
'belongsToAdGroupId' => 123456789,
'type' => "Broad",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterion2 = array(
'text' => "test2",
'belongsToAdGroupId' => 123456789,
'type' => "Exact",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterionObjects = addKeywordCriteriaOnebyOne(array($criterion1, $criterion2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addKeywordCriterion(
$text,
$belongsToAdGroupId,
$type,
$isNegative,
$maxCpc,
$language,
$destinationUrl
)
function addKeywordCriterion(
$text,
$belongsToAdGroupId,
$type,
$isNegative,
$maxCpc,
$language,
$destinationUrl,
$exemptionRequest
)
// Use the above function to upload KeywordCriteria that do not meet the Google Editorial Guidelines.
Adds a KeywordCriterion to the given AdGroup.
Parameters:
String text
Integer belongsToAdGroupId
String type
Boolean isNegative
Integer maxCpc
String language
String destinationUrl // Pass "" if default AdGroup destination URL should be used
{String exemptionRequest} // Required on policy violation.Response:
KeywordCriterion criterionObjectSample:
$criterionObject = addKeywordCriterion(
"test",
123456789,
"Exact",
false,
0.65,
"fr",
"http://groups.google.com/group/adwords-api-php"
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addKeywordCriterionList($keywordCriteria)
Adds a list of KeywordCriteria to the given AdGroup. Please note: this will
fail completely even if just one KeywordCriterion fails, but the function causes
no SOAP overhead. Parameters:
keywordCriteria = array(
array(
'text',
'belongsToAdGroupId',
'type',
'isNegative',
'maxCpc',
'language',
'destinationUrl',
{'exemptionRequest'}
)
)Response:
[KeywordCriterion] criterionObjectsSample:
$criterion1 = array(
'text' => "test1",
'belongsToAdGroupId' => 123456789,
'type' => "Broad",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterion2 = array(
'text' => "test2",
'belongsToAdGroupId' => 123456789,
'type' => "Exact",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterionObjects = addKeywordCriterionList(array($criterion1, $criterion2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addWebsiteCriteriaOneByOne($keywords)
Adds a list of WebsiteCriteria to the given AdGroup. Please note: this will
not fail completely even if just one Website fails, but the function
causes a lot of SOAP overhead.Parameters:
websiteCriteria = array(
array(
'url',
'belongsToAdGroupId',
'isNegative',
'maxCpm',
'maxCpc',
'destinationUrl'
)
)Response:
[WebsiteCriterion] criterionObjectsSample:
$criterion1 = array(
'url' => "google.com",
'belongsToAdGroupId' => 123456789,
'isNegative' => false,
'maxCpm' => 0.6,
'maxCpc' => 0,
'destinationUrl' => "http://www.google.com"
);
$criterion2 = array(
'url' => "adwords.com",
'belongsToAdGroupId' => 123456789,
'isNegative' => false,
'maxCpm' => 0.7,
'maxCpc' => 0,
'destinationUrl' => "http://www.adwords.com"
);
$criterionObjects = addWebsiteCriteriaOneByOne(array($criterion1, $criterion2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addWebsiteCriterion(
$url,
$belongsToAdGroupId,
$isNegative,
$maxCpm,
$maxCpc,
$destinationUrl
)
Adds a WebsiteCriterion to the given AdGroup.
Parameters:
String url
Integer belongsToAdGroupId
Boolean isNegative
Integer maxCpm
Integer maxCpc
String destinationUrlResponse:
WebsiteCriterion criterionObjectSample:
$criterionObject = addWebsiteCriterion(
"google.com",
123456789,
false,
0.6,
0,
"http://www.google.com"
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
addWebsiteCriterionList($websiteCriteria)
Adds a list of WebsiteCriteria to the given AdGroup. Please note: this will
fail completely even if just one WebsiteCriterion fails, but the function causes
no SOAP overhead. Parameters:
websiteCriteria = array(
array(
'url',
'belongsToAdGroupId',
'isNegative',
'maxCpm',
'maxCpc',
'destinationUrl'
)
)Response:
[WebsiteCriterion] criterionObjectsSample:
$criterion1 = array(
'url' => "google.com",
'belongsToAdGroupId' => 123456789,
'isNegative' => false,
'maxCpm' => 0.6,
'maxCpc' => 0,
'destinationUrl' => "http://www.google.com"
);
$criterion2 = array(
'url' => "adwords.com",
'belongsToAdGroupId' => 123456789,
'isNegative' => false,
'maxCpm' => 0.7,
'maxCpc' => 0,
'destinationUrl' => "http://www.adwords.com"
);
$criterionObjects = addWebsiteCriterionList(array($criterion1, $criterion2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
checkCriterionList($criteria, $languages, $geoTargets)
Checks a list of Criteria for policy errors.
Parameters:
[Criterion] criteria
[String] languages
geoTargets = array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array()
),
'proximityTargets' => array(
'circles' => array(
'latitudeMicroDegrees',
'longitudeMicroDegrees',
'radiusMeters'
)
),
'targetAll'
)Response:
[ApiError] criteriaCheckSample:
$criterion1 = array(
'text' => "test1",
'type' => "Broad",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterion2 = array(
'text' => "test2",
'type' => "Exact",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$geoTargets = array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Grenoble, V FR"
)
),
'proximityTargets' => array(
'circles' => array()
)
);
$languages = array('de', 'fr', 'en');
print_r(
checkCriterionList(
array($criterion1, $criterion2),
$languages,
$geoTargets
)
);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
createCriterionObject($givenAdGroupId, $givenKeywordId)
Creates a local Criterion object based on an already existing Criterion ID and its Criterion AdGroup ID.
Parameters:
Integer givenAdGroupId
Integer givenKeywordIdResponse:
Criterion keywordObjectSample:
$criterionObject = createCriterionObject(123456789, 987654321);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getAllCriteria($adGroupId)
Returns all Criteria of a given AdGroup.
Parameters:
Integer adGroupIdResponse:
[Criterion] allCriterionObjectsSample:
$allCriteria = getAllCriteria(123456789);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionList($adGroupId, $criterionIds)
Returns only the specified Criteria of a certain AdGroup.
Parameters:
Integer adGroupId
[Integer] criterionIdsResponse:
[Criterion] criterionObjectsSample:
$criterionIds = array(123456789, 987654321, 123459876);
$criterionObjects = getCriterionList(123456789, $criterionIds);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
getCriterionListStats($adGroupId, $criterionIds, $startDate, $endDate)
Returns stats of a list of Criteria in an AdGroup.
Parameters:
Integer adGroupId
[Integer] criterionIds
String startDate
String endDateResponse:
[StatsObject] criterionStatsSample:
$yesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 1,
date("Y")
)
);
$dayBeforeYesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 2,
date("Y")
)
);
$criterionIds = array(123456789, 987654321, 123459876);
$criterionStats = getCriterionListStats(123456789, $criterionIds, $dayBeforeYesterday, $yesterday);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
removeCriterion($criterionObject)
Removes a Criterion and unsets its object variable.
Parameters:
Criterion criterionObjectResponse:
NoneSample:
$criterionObject = createCriterionObject(123456789, 987654321);
removeCriterion($criterionObject);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
removeCriterionList($criterionObjects)
Removes a list of Criteria.
Parameters:
[Criterion] criterionObjectsResponse:
NoneSample:
$criterionIds = array(123456789, 987654321, 123459876);
$criterionObjects = getCriterionList(123456789, $criterionIds);
removeCriterionList($criterionObjects);
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
updateCriterionList($criteria)
Updates a list of Criteria.
Parameters:
[Criterion] criteriaResponse:
NoneSample:
$criterion1 = array(
'text' => "test1",
'belongsToAdGroupId' => 123456789,
'type' => "Broad",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$criterion2 = array(
'text' => "test2",
'belongsToAdGroupId' => 123456789,
'type' => "Exact",
'isNegative' => false,
'maxCpc' => 1.0,
'language' => "de",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
updateCriterionList(array($criterion1, $criterion2));
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info
Ad.php
Quicknavigatior
• Back To Top
• APIlity Home
• APIlity Forum
» Campaign |
» AdGroup |
» Criterion |
» Ad |
» Report |
» KeywordTool |
» SiteSuggestion |
» TrafficEstimate |
» Account |
» Info

