Quicknavigator
|
APIlity structure
Click the images to resize the class organigram and/or the object hierarchy: |
getActiveAdGroups()
Returns all active AdGroups of a given Campaign.
None
[AdGroup] activeAdGroupObjects
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getActiveAdGroups());
getAdScheduling()
Returns the Campaign's ad schedule.
None
adScheduling = array(
'status',
'intervals' = array(
array(
'day',
'startHour',
'startMinute',
'endHour',
'endMinute',
'multiplier'
)
)
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getAdScheduling());
getAllAdGroups()
Returns all AdGroups of a given Campaign.
None
[AdGroup] allAdGroupObjects
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getAllAdGroups());
getBelongsToClientEmail()
Returns the client email this Campaign belongs to.
None
String email
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBelongsToClientEmail();
getBudgetAmount()
Returns the Campaign's budget amount.
None
Integer budgetAmount
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBudgetAmount();
getBudgetOptimizerSettings()
Returns the Campaign's budget optimizer settings.
None
budgetOptimizerSettings = array(
'bidCeiling',
'enabled',
'takeOnOptimizedBids'
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getBudgetOptimizerSettings());
getBudgetPeriod()
Returns the Campaign's budget period.
None
String budgetPeriod
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getBudgetPeriod();
getCampaignData()
Returns all the Campaign's attributes in one go.
None
campaignData = array(
'name',
'id',
'belongsToClientEmail',
'status',
'startDate',
'endDate',
'budgetAmount',
'budgetPeriod',
'networkTargeting',
'languages',
'geoTargets',
'isEnabledOptimizedAdServing'
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignData());
getCampaignNegativeKeywordCriteria()
Returns the Campaign's Negative Keyword Criteria.
None
campaignNegativeKeywords = array(
array(
'text',
'type'
)
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignNegativeKeywordCriteria());
getCampaignNegativeWebsiteCriteria()
Returns the Campaign's Negative Website Criteria.
None
campaignNegativeWebsites = array(
array(
'url',
)
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getCampaignNegativeWebsiteCriteria());
getCampaignStats($startDate, $endDate)
Returns the statistical data for a Campaign during the given period of time.
String startDate
String endDate
campaignStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'name'
)
$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));
getEndDate()
Returns the Campaign's end date.
None
String endDate
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getEndDate();
getEstimate()
Returns a performance estimate for the Campaign.
None
campaignEstimate = array(
array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
),
'campaignName',
'campaignId'
)
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getEstimate());
getGeoTargets()
Returns the Campaign's geo targetings.
None
[String] geoTargets
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getGeoTargets());
getId()
Returns the Campaign's ID.
None
Integer id // for MySQL use BigInt
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getId();
getIsEnabledOptimizedAdServing()
Returns if the advertisment serving of the Campaign is being optimized.
None
Boolean isEnabledOptimizedAdServing
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getIsEnabledOptimizedAdServing();
getLanguages()
Returns the Campaign's language targeting.
None
[String] languages
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getLanguages());
getName()
Returns the Campaign's name.
None
String name
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getName();
getNetworkTargeting()
Returns the Campaign's network targeting.
None
[String] networkTargeting
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getNetworkTargeting());
getRecommendedBudget()
Returns the Campaign's recommended budget.
None
Budget recommendedBudget
$campaignObject = createCampaignObject(123456789);
print_r($campaignObject->getRecommendedBudget());
getStartDate()
Returns the Campaign's start date.
None
String startDate
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getStartDate();
getStatus()
Returns the Campaign's status.
None
String status
$campaignObject = createCampaignObject(123456789);
echo $campaignObject->getStatus();
setAdScheduling($newAdScheduling)
Sets the Campaign's new ad schedule.
newAdScheduling = array(
'status',
'intervals' = array(
array(
'day',
'startHour',
'startMinute',
'endHour',
'endMinute',
'multiplier',
)
)
)
$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);
setBudgetAmount($newBudgetAmount)
Sets a new Campaign budget amount.
Integer newBudgetAmount
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setBudgetAmount(1000);
setBudgetOptimizerSettings($newBudgetOptimizerSettings)
Sets the Campaign's budget optimizer settings.
newBudgetOptimizerSettings = array(
'bidCeiling',
'enabled',
'takeOnOptimizedBids'
)
None
$campaignObject = createCampaignObject(123456789);
$budgetOptimizerSettings = array(
'bidCeiling' => 42,
'enabled' => true,
'takeOnOptimizedBids' => true
);
$campaignObject->setBudgetOptimizerSettings($budgetOptimizerSettings);
setBudgetPeriod($newBudgetPeriod)
Sets a new Campaign budget period.
String newBudgetPeriod
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setBudgetPeriod('Daily');
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.
newCampaignNegativeKeywords = array(
array(
'text',
'type'
)
)
None
$campaignObject = createCampaignObject(123456789);
$negativeCriterion1 = array('text' => "none", 'type' => "Broad");
$negativeCriterion2 = array('text' => "of these", 'type' => "Phrase");
$campaignObject->setCampaignNegativeKeywordCriteria(
array($negativeCriterion1, $negativeCriterion2)
);
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.
newCampaignNegativeWebsites = array(
array(
'url'
)
)
None
$campaignObject = createCampaignObject(123456789);
$negativeCriterion1 = array('url' => "spiegel.de");
$negativeCriterion2 = array('url' => "aol.com");
$campaignObject->setCampaignNegativeWebsiteCriteria(
array($negativeCriterion1, $negativeCriterion2)
);
setConversionOptimizerSettings($conversionOptimizerSettings)
Sets the Campaign's conversion optimizer settings.
newConversionOptimizerSettings = array(
'enabled',
'maxCpaBidForAllAdGroups'
)
None
$campaignObject = createCampaignObject(123456789);
$conversionOptimizerSettings = array(
'enabled' => true,
'maxCpaBidForAllAdGroups' => 10
);
$campaignObject->setConversionOptimizerSettings($conversionOptimizerSettings);
setEndDate($newEndDate)
Sets a new Campaign end date.
String newEndDate
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setEndDate("2011-12-17");
setGeoTargets($newGeoTargets)
Sets new Campaign geo targets.
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'
)
None
$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);
setIsEnabledOptimizedAdServing($newFlag)
Sets the flag to show if the advertisment serving of the Campaign is being optimized.
Boolean newFlag
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setIsEnabledOptimizedAdServing(true);
setLanguages($newLanguages)
Sets a new Campaign language targeting.
[String] newLanguages // Pass array("all") to select all languages
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setLanguages(array("fr", "de"));
setName($newName)
Sets a new Campaign name.
String newName
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setName("The new name");
setNetworkTargeting($networkTargeting)
Sets the Campaign's network targeting.
[String] networkTargeting // Valid values: GoogleSearch, SearchNetwork, ContentNetwork
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setNetworkTargeting(array("GoogleSearch", "SearchNetwork"));
setStatus($newStatus)
Sets a new Campaign Status.
String newStatus // Pass "Active" or "Paused"
None
$campaignObject = createCampaignObject(123456789);
$campaignObject->setStatus("Active");
toXml()
Returns the Campaign in XML format.
None
String campaignXml // Contains the Campaign in XML format
$campaignObject = createCampaignObject(123456789);
echo htmlspecialchars($campaignObject->toXml());
addCampaign(
$name,
$status,
$startDate,
$endDate,
$budgetAmount,
$budgetPeriod,
$networkTargeting,
$languages,
$geoTargets,
$adScheduling,
$budgetOptimizerSettings
)
Adds a Campaign to the current customer's account.
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}
Campaign campaignObject
$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()
)
)
);
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. 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'}
)
)
[Campaign] campaignObjects
$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));
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. 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'}
)
)
[Campaign] campaignObjects
$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));
createCampaignObject($givenCampaignId)
Creates a local Campaign object based on the Campaign's ID.
Integer givenCampaignId
Campaign campaignObject
$campaignObject = createCampaignObject(123456789);
getActiveCampaigns()
Returns all active Campaigns of the current customer.
None
[Campaign] activeCampaignObjects
$activeCampaigns = getActiveCampaigns();
getAllCampaigns()
Returns all Campaigns of the current customer.
None
[Campaign] allCampaignObjects
$allCampaigns = getAllCampaigns();
getCampaignList($givenCampaignIds)
Returns a list of Campaigns with the specified IDs.
[Integer] givenCampaignIds
[Campaign] campaignObjects
$campaignIds = array(123456789, 987654321, 567891234);
$campaignObjects = getCampaignList($campaignIds);
removeCampaign($campaignObject)
Removes a Campaign and unsets its object variable.
Campaign campaignObject
None
$campaignObject = createCampaignObject(123456789);
removeCampaign($campaignObject);
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. |
getActiveAds()
Returns all active Ads of a given AdGroup.
None
[Ad] activeAdObjects
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getActiveAds());
getAdGroupData()
Returns all the AdGroup attributes at once.
None
adGroupData = array(
'name',
'id',
'belongsToCampaignId',
'keywordMaxCpc',
'siteMaxCpm',
'siteMaxCpc',
'maxCpa',
'keywordContentMaxCpc',
'status'
)
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAdGroupData());
getAdGroupStats($startDate, $endDate)
Returns the statistical data for an AdGroup during the given period of time.
String startDate
String endDate
adGroupStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'name'
)
$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));
getAllAds()
Returns all Ads of a given AdGroup.
None
[Ad] allAdObjects
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAllAds());
getAllCriteria()
Returns all Criteria of a given AdGroup.
None
[Criteria] allCriterionObjects
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getAllCriteria());
getBelongsToCampaignId()
Returns the Campaign ID to which the AdGroup belongs.
None
Integer belongsToAdGroupId // for MySQL use BigInt
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getBelongsToAdGroupId();
getEstimate()
Returns a performance estimate for the AdGroup.
None
adGroupEstimate = array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
)
$adGroupObject = createAdGroupObject($givenAdGroupId);
print_r($adGroupObject->getEstimate());
getId()
Returns the AdGroup's ID.
None
Integer id // for MySQL use BigInt
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getId();
getKeywordContentMaxCpc()
Returns the AdGroup's KeywordContentMaxCPC.
None
Integer keywordContentMaxCpc
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getKeywordContentMaxCpc();
getKeywordMaxCpc()
Returns the AdGroup's KeywordMaxCPC.
None
Integer keywordMaxCpc
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getKeywordMaxCpc();
getMaxCpa()
Returns the AdGroup's MaxCPA.
None
Integer maxCpa
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getMaxCpa();
getName()
Returns the AdGroup's name.
None
String name
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getName();
getProxyKeywordMaxCpc()
Returns the AdGroup's ProxyKeywordMaxCPC.
None
Integer proxyKeywordMaxCpc
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getProxyKeywordMaxCpc();
getSiteMaxCpc()
Returns the AdGroup's SiteMaxCPC.
None
Integer siteMaxCpc
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getSiteMaxCpc();
getSiteMaxCpm()
Returns the AdGroup's SiteMaxCPM.
None
Integer siteMaxCpm
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getSiteMaxCpm();
getStatus()
Returns the AdGroup's status.
None
String status // Enabled, Paused, Deleted
$adGroupObject = createAdGroupObject($givenAdGroupId);
echo $adGroupObject->getStatus();
setKeywordContentMaxCpc($newKeywordContentMaxCpc)
Sets a new AdGroup KeywordContentMaxCPC.
Integer newKeywordContentMaxCpc
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setKeywordContentMaxCpc(0.65);
setKeywordMaxCpc($newKeywordMaxCpc)
Sets a new AdGroup KeywordMaxCPC.
Integer newKeywordMaxCpc
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setKeywordMaxCpc(0.65);
setMaxCpa($newMaxCpa)
Sets the AdGroup's MaxCPA.
Integer newMaxCpa
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setMaxCpa(10);
setName($newName)
Sets a new AdGroup name.
String newName
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setName("The new name");
setSiteMaxCpc($newSiteMaxCpc)
Sets the AdGroup's SiteMaxCPC.
Integer newSiteMaxCpc
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setSiteMaxCpc(10);
setSiteMaxCpm($newMaxCpm)
Sets a new AdGroup SiteMaxCPM.
Integer newSiteMaxCpm
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setSiteMaxCpm(0.65);
setStatus($newStatus)
Sets a new AdGroup Status.
String newStatus // Pass "Enabled" or "Paused"
None
$adGroupObject = createAdGroupObject($givenAdGroupId);
$adGroupObject->setStatus("Paused");
toXml()
Returns the AdGroup in XML format.
None
String adGroupXml // Contains the AdGroup in XML format
$adGroupObject = createAdGroupObject(123456789);
echo htmlspecialchars($adGroupObject->toXml());
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.
String name
Integer belongsToCampaignId
String status
Integer keywordMaxCpc
{Integer siteMaxCpm}
{Integer siteMaxCpc}
{Integer maxCpa}
{Integer keywordContentMaxCpc}
AdGroup adGroupObject
$adGroupObject = addAdGroup("Test", 123456789, "Enabled", 0.65);
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. adGroups = array(
array(
'name',
'belongsToCampaignId',
'status',
'keywordMaxCpc',
{'siteMaxCpm'},
{'Integer siteMaxCpc'},
{'Integer maxCpa'},
{'keywordContentMaxCpc'}
)
)
[AdGroup] adGroupObjects
$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));
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. adGroups = array(
array(
'name',
'belongsToCampaignId',
'status',
'keywordMaxCpc',
{'siteMaxCpm'},
{'Integer siteMaxCpc'},
{'Integer maxCpa'},
{'keywordContentMaxCpc'}
)
)
[AdGroup] adGroupObjects
$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));
createAdGroupObject($givenAdGroupId)
Creates a local AdGroup object based on the AdGroup's ID.
Integer givenAdGroupId
AdGroup adGroupObject
$adGroupObject = createAdGroupObject(123456789);
getActiveAdGroups($campaignId)
Returns all active AdGroups of a given Campaign.
Integer campaignId
[AdGroup] activeAdGroupObjects
$activeAdGroups = getActiveAdGroups(123456789);
getAdGroupList($adGroupIds)
Returns only the specified AdGroups.
[Integer] adGroupIds
[AdGroup] adGroupObjects
$adGroupIds = array(123456789, 987654321, 123459876);
$adGroupObjects = getAdGroupList($adGroupIds);
getAllAdGroups($campaignId)
Returns all AdGroups of a given Campaign.
Integer campaignId
[AdGroup] allAdGroupObjects
$allAdGroups = getAllAdGroups(123456789);
removeAdGroup($adGroupObject)
Removes an AdGroup and unsets its local object variable.
AdGroup adGroupObject
None
$adGroupObject = createAdGroupObject(123456789);
removeAdGroup($adGroupObject);
getBelongsToAdGroupId()
Returns the AdGroup ID to which the current Criterion belongs.
None
Integer belongsToAdGroupId // for MySQL use BigInt
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getBelongsToAdGroupId();
getCriterionData() // KeywordCriterion object
Returns all the KeywordCriterion's attributes at once.
None
criterionData = array(
'text',
'id',
'belongsToAdGroupId',
'type',
'criterionType',
'isNegative',
'isPaused',
'maxCpc',
'firstPageCpc',
'qualityScore',
'status',
'language',
'destinationUrl'
)
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getCriterionData());
getCriterionData() // WebsiteCriterion object
Returns all the WebsiteCriterion's attributes at once.
None
$criterionData = array(
'id',
'url',
'belongsToAdGroupId',
'criterionType',
'isNegative',
'maxCpm',
'maxCpc',
'status',
'language',
'destinationUrl'
);
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getCriterionData());
getCriterionStats($startDate, $endDate)
Returns the statistical data for a Criterion during the given period of time.
String startDate
String endDate
criterionStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'text'
)
$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));
getCriterionType()
Returns the Criterion's type.
None
String criterionType
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getCriterionType();
getDestinationUrl()
Returns the Criterion's destination URL.
None
String destinationUrl
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getDestinationUrl();
getEstimate()
Returns a performance estimate for the Criterion.
None
keywordEstimate = array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)
$criterionObject = createCriterionObject(123456789, 987654321);
print_r($criterionObject->getEstimate());
getFirstPageCpc()
Returns the KeywordCriterion's FirstPageCPC.
None
Integer firstPageCpc
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getFirstPageCpc();
getId()
Returns the Criterion's ID.
None
Integer id // for MySQL use BigInt
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getId();
getIsNegative()
Returns if the Criterion is negative or not.
None
Boolean isNegative
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getIsNegative();
getIsPaused()
Returns if the Criterion is paused or not.
None
Boolean isPaused
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getIsPaused();
getLanguage()
Returns the Criterion's language.
None
String language
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getLanguage();
getMaxCpc() // KeywordCriterion
Returns the KeywordCriterion's MaxCPC.
None
Integer maxCpc
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpc();
getMaxCpc() // WebsiteCriterion
Returns the WebsiteCriterion's MaxCPC.
None
Integer maxCpc
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpc();
getMaxCpm()
Returns the WebsiteCriterion's MaxCPM.
None
Integer maxCpm
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getMaxCpm();
getProxyMaxCpc()
Returns the KeywordCriterion's ProxyMaxCPC.
None
Integer proxyMaxCpc
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getKeywordMaxCpc();
getQualityScore()
Returns the KeywordCriterion's QualityScore.
None
Integer qualityScore
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getQualityScore();
getStatus()
Retuns the Criterion's status.
None
String status
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getStatus;
getText()
Returns the KeywordCriterion's text.
None
String criterionText
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getText();
getType()
Returns the KeywordCriterion's type.
None
String type
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getType();
getUrl()
Returns the WebsiteCriterion's URL.
None
String url
$criterionObject = createCriterionObject(123456789, 987654321);
echo $criterionObject->getUrl();
setDestinationUrl($newDestinationUrl)
Sets the Criterion's new destination URL.
String newDestinationUrl
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setDestinationUrl("http://groups.google.com/group/adwords-api-php");
setIsNegative($newFlag)
Sets the flag to show if the Criterion is negative.
Boolean newFlag
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setIsNegative(true);
setIsPaused($newFlag)
Sets the flag to show if the Criterion is paused.
Boolean newFlag
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setIsPaused(true);
setLanguage($newLanguage)
Sets a new Criterion language. Please be aware that changing a Criterion's language will destroy its history.
String newLanguage
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setLanguage("fr");
setMaxCpc($newMaxCpc)
Sets a new Criterion MaxCPC.
Integer newMaxCpc
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setMaxCpc(0.65);
setMaxCpm($newMaxCpm)
Sets a new WebsiteCriterion MaxCPM.
Integer newMaxCpm
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setMaxCpm(0.65);
setText($newText)
Sets a new KeywordCriterion text. Please be aware that renaming a KeywordCriterion will destroy its history.
String newText
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setText("The new text");
setType($newType)
Sets a new KeywordCriterion type. Please be aware that changing a KeywordCriterion's type will destroy its history.
String newType
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setType("Exact");
setUrl($newUrl)
Sets the WebsiteCriterion's new URL. Please be aware that changing a WebsiteCriterion's URL will destroy its history.
String newUrl
None
$criterionObject = createCriterionObject(123456789, 987654321);
$criterionObject->setUrl("groups.google.com");
toXml()
Returns the Criterion in XML format.
None
String criterionXml // Contains the Criterion in XML format
$criterionObject = createCriterionObject(123456789, 987654321);
echo htmlspecialchars($criterionObject->toXml());
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. $keywordCriteria = array(
array(
'text',
'belongsToAdGroupId',
'type',
'isNegative',
'maxCpc',
'language',
'destinationUrl',
{'exemptionRequest'}
)
)
[KeywordCriterion] criterionObjects
$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));
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.
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.
KeywordCriterion criterionObject
$criterionObject = addKeywordCriterion(
"test",
123456789,
"Exact",
false,
0.65,
"fr",
"http://groups.google.com/group/adwords-api-php"
);
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. keywordCriteria = array(
array(
'text',
'belongsToAdGroupId',
'type',
'isNegative',
'maxCpc',
'language',
'destinationUrl',
{'exemptionRequest'}
)
)
[KeywordCriterion] criterionObjects
$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));
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.websiteCriteria = array(
array(
'url',
'belongsToAdGroupId',
'isNegative',
'maxCpm',
'maxCpc',
'destinationUrl'
)
)
[WebsiteCriterion] criterionObjects
$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));
addWebsiteCriterion(
$url,
$belongsToAdGroupId,
$isNegative,
$maxCpm,
$maxCpc,
$destinationUrl
)
Adds a WebsiteCriterion to the given AdGroup.
String url
Integer belongsToAdGroupId
Boolean isNegative
Integer maxCpm
Integer maxCpc
String destinationUrl
WebsiteCriterion criterionObject
$criterionObject = addWebsiteCriterion(
"google.com",
123456789,
false,
0.6,
0,
"http://www.google.com"
);
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. websiteCriteria = array(
array(
'url',
'belongsToAdGroupId',
'isNegative',
'maxCpm',
'maxCpc',
'destinationUrl'
)
)
[WebsiteCriterion] criterionObjects
$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));
checkCriterionList($criteria, $languages, $geoTargets)
Checks a list of Criteria for policy errors.
[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'
)
[ApiError] criteriaCheck
$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
)
);
createCriterionObject($givenAdGroupId, $givenKeywordId)
Creates a local Criterion object based on an already existing Criterion ID and its Criterion AdGroup ID.
Integer givenAdGroupId
Integer givenKeywordId
Criterion keywordObject
$criterionObject = createCriterionObject(123456789, 987654321);
getAllCriteria($adGroupId)
Returns all Criteria of a given AdGroup.
Integer adGroupId
[Criterion] allCriterionObjects
$allCriteria = getAllCriteria(123456789);
getCriterionList($adGroupId, $criterionIds)
Returns only the specified Criteria of a certain AdGroup.
Integer adGroupId
[Integer] criterionIds
[Criterion] criterionObjects
$criterionIds = array(123456789, 987654321, 123459876);
$criterionObjects = getCriterionList(123456789, $criterionIds);
getCriterionListStats($adGroupId, $criterionIds, $startDate, $endDate)
Returns stats of a list of Criteria in an AdGroup.
Integer adGroupId
[Integer] criterionIds
String startDate
String endDate
[StatsObject] criterionStats
$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);
removeCriterion($criterionObject)
Removes a Criterion and unsets its object variable.
Criterion criterionObject
None
$criterionObject = createCriterionObject(123456789, 987654321);
removeCriterion($criterionObject);
removeCriterionList($criterionObjects)
Removes a list of Criteria.
[Criterion] criterionObjects
None
$criterionIds = array(123456789, 987654321, 123459876);
$criterionObjects = getCriterionList(123456789, $criterionIds);
removeCriterionList($criterionObjects);
updateCriterionList($criteria)
Updates a list of Criteria.
[Criterion] criteria
None
$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));
getAdData() // CommerceAd objects
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'description1',
'description2',
'headline',
'prePriceAnnotation',
'postPriceAnnotation',
'priceString',
'productImage',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdData() // ImageAd object
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'image',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdData() // LocalBusinessAd objects
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'address',
'businessImage',
'businessKey',
'businessName',
'fullBusinessName',
'city',
'countryCode',
'customIcon',
'customIconId',
'description1',
'description2',
'phoneNumber',
'postalCode',
'region',
'stockIcon',
'targetRadiusInKm',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved',
'latitude',
'longitude'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdData() // MobileAd object
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'businessName',
'countryCode',
'description',
'headline',
'markupLanguages',
'mobileCarriers',
'phoneNumber',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdData() // TextAd object
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'headline',
'description1',
'description2',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdData() // VideoAd objects
Returns all the Ad attributes at once.
None
adData = array(
'id',
'belongsToAdGroupId',
'video',
'image',
'name',
'displayUrl',
'destinationUrl',
'status',
'isDisapproved'
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdData());
getAdStats($startDate, $endDate)
Returns the statistical data for an Ad during the given period of time.
None
adStats = array(
'averagePosition',
'clicks',
'conversionRate',
'conversions',
'cost',
'id',
'impressions',
'name'
)
$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")
)
);
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getAdStats($dayBeforeYesterday, $yesterday));
getAdType()
Returns the Ad's type.
None
String adType
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getAdType();
getAddress()
Returns the Ad's address.
None
String address
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getAddress();
getBelongsToAdGroupId()
Returns the AdGroup ID to which the Ad belongs.
None
Integer belongsToAdGroupId // for MySQL use BigInt
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getBelongsToAdGroupId();
getBusinessImage()
Returns the Ad's business image.
None
Image businessImage
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getBusinessImage());
getBusinessKey()
Returns the Ad's business key.
None
String businessKey
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getBusinessKey();
getBusinessName()
Returns the Ad's business name.
None
String businessName
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getBusinessName();
getCity()
Returns the Ad's city.
None
String city
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getCity();
getCountryCode()
Returns the Ad's country code.
None
String countryCode
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getCountryCode();
getCustomIcon()
Returns the Ad's custom icon.
None
Image customIcon
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getCustomIcon());
getCustomIconId()
Returns the Ad's custom icon ID.
None
Integer customIconId
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getCustomIconId();
getDescription()
Returns the Ad's description.
None
String description
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getDescription();
getDescription1()
Returns the Ad's description1.
None
String description1
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getDescription1();
getDescription2()
Returns the Ad's description2.
None
String description2
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getDescription2();
getDestinationUrl()
Returns the Ad's destination URL.
None
String destinationUrl
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getDestinationUrl();
getDisplayUrl()
Returns the Ad's display URL.
None
String displayUrl
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getDisplayUrl();
getFullBusinessName()
Returns the Ad's full business name.
None
String fullBusinessName
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getFullBusinessName();
getHeadline()
Returns the Ad's headline.
None
String headline
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getHeadline();
getId()
Returns the Ad's ID.
None
Integer id // for MySQL use BigInt
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getId();
getImage()
Returns the Ad's image.
None
Image image
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getImage());
getIsDisapproved()
Returns if the Ad is disapproved.
None
Boolean isDisapproved
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getIsDisapproved();
getLatitude()
Returns the Ad's latitude.
None
String latitude
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getLatitude();
getLongitude()
Returns the Ad's longitude.
None
String longitude
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getLongitude();
getMarkupLanguages()
Returns the Ad's markup languages.
None
[String] markupLanguages
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getMarkupLanguages());
getMobileCarriers()
Returns the Ad's mobile carriers.
None
[String] mobileCarriers
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getMobileCarriers());
getName()
Returns the Ad's name.
None
String name
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getName();
getPhoneNumber()
Returns the Ad's phone number.
None
String phoneNumber
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getPhoneNumber();
getPostPriceAnnotation()
Returns the Ad's post-price annotation.
None
String postPriceAnnotation
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getPostPriceAnnotation();
getPostalCode()
Returns the Ad's postal code.
None
String postalCode
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getPostalCode();
getPrePriceAnnotation()
Returns the Ad's pre-price annotation.
None
String prePriceAnnotation
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getPrePriceAnnotation();
getPriceString()
Returns the Ad's price string.
None
String priceString
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getPriceString();
getProductImage()
Returns the Ad's product image.
None
Image productImage
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getProductImage());
getRegion()
Returns the Ad's region.
None
String region
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getRegion();
getStatus()
Returns the Ad's status.
None
String status
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getStatus();
getStockIcon()
Returns the Ad's stock icon.
None
String stockIcon
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getStockIcon();
getTargetRadiusInKm()
Returns the Ad's target radius in kilometers.
None
String targetRadius
$adObject = createAdObject(123456789, 987654321);
echo $adObject->getTargetRadiusInKm();
getVideo()
Returns the Ad's video.
None
Video video
$adObject = createAdObject(123456789, 987654321);
print_r($adObject->getVideo());
setDescription1 ($newDescription1)
Sets the Ad's description1.
String description1
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setDescription1 ("The new description1");
setDescription2 ($newDescription2)
Sets the Ad's description2.
String description2
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setDescription2 ("The new description2");
setDestinationUrl ($newDestinationUrl)
Sets the Ad's destination URL.
String destinationUrl
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setDestinationUrl("http://groups.google.com/group/adwords-api-php");
setDisplayUrl ($newDisplayUrl)
Sets the Ad's display URL.
String displayUrl
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setDisplayUrl ("http://groups.google.com/group/adwords-api-php");
setHeadline ($newHeadline)
Sets the Ad's headline.
String headline
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setHeadline ("The new headline");
setStatus ($newStatus)
Sets the Ad's status.
String status
None
$adObject = createAdObject(123456789, 987654321);
$adObject->setStatus ("Paused");
toXml()
Returns the Ad in XML format.
None
String Xml // Contains the Ad in XML format
$adObject = createAdObject(123456789, 987654321);
echo htmlspecialchars($adObject->toXml());
addCommerceAd(
$belongsToAdGroupId,
$description1,
$description2,
$headline,
$postPriceAnnotation,
$prePriceAnnotation,
$priceString,
$productImageLocation,
$status,
$displayUrl,
$destinationUrl
)
Adds a Commerce Ad to the given AdGroup.
Integer belongsToAdGroupId
String description1
String description2
String headline
String prePriceAnnotation
String postPriceAnnotation
String priceString
String productImageLocation
String status
String displayUrl
String destinationUrl
Ad adObject
$commerceAd = addCommerceAd(
123456789,
"Description 1",
"Description 2",
"Headline",
"pre-price",
"post-price",
"price",
"TestSuite_CommerceAd.gif",
"Enabled",
"http://groups.google.com",
"http://groups.google.com/group/adwords-api-php"
);
addCommerceAdList($ads)
Adds a list of Commerce Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'description1',
'description2',
'headline',
'prePriceAnnotation',
'postPriceAnnotation',
'priceString',
'productImageLocation',
'status',
'displayUrl',
'destinationUrl'
)
)
[Ad] adObjects
$commerceAd1 = array(
'belongsToAdGroupId' => 123456789,
'description1' => "Description 1",
'description2' => "Description 2",
'headline' => "Headline1",
'prePriceAnnotation' => "pre-price",
'postPriceAnnotation' => "post-price",
'priceString' => "price",
'productImageLocation' => "TestSuite_CommerceAd.gif",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$commerceAd2 = array(
'belongsToAdGroupId' => 123456789,
'description1' => "Description 1",
'description2' => "Description 2",
'headline' => "Headline2",
'prePriceAnnotation' => "pre-price",
'postPriceAnnotation' => "post-price",
'priceString' => "price",
'productImageLocation' => "TestSuite_CommerceAd.gif",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$commerceAds = addCommerceAdList(array($commerceAd1, $commerceAd2));
addCommerceAdsOneByOne($ads)
Adds a list of Commerce Ads to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'description1',
'description2',
'headline',
'prePriceAnnotation',
'postPriceAnnotation',
'priceString',
'productImageLocation',
'status',
'displayUrl',
'destinationUrl'
)
)
[Ad] adObjects
$commerceAd1 = array(
'belongsToAdGroupId' => 123456789,
'description1' => "Description 1",
'description2' => "Description 2",
'headline' => "Headline1",
'prePriceAnnotation' => "pre-price",
'postPriceAnnotation' => "post-price",
'priceString' => "price",
'productImageLocation' => "TestSuite_CommerceAd.gif",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$commerceAd2 = array(
'belongsToAdGroupId' => 123456789,
'description1' => "Description 1",
'description2' => "Description 2",
'headline' => "Headline2",
'prePriceAnnotation' => "pre-price",
'postPriceAnnotation' => "post-price",
'priceString' => "price",
'productImageLocation' => "TestSuite_CommerceAd.gif",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$commerceAds = addCommerceAdsOneByOne(array($commerceAd1, $commerceAd2));
addImageAd(
$belongsToAdGroupId,
$imageLocation,
$name,
$status,
$displayUrl,
$destinationUrl
)
Adds an Image Ad to the given AdGroup.
Integer belongsToAdGroupId
String imageLocation // Pass [image URL] XOR [path]+[fileName] RELATIVE to your web server's root folder (often called "htdocs")
String name
String status
String displayUrl
String destinationUrl
Ad adObject
$imageAd = addImageAd(
123456789,
"Creative-TestSuite_Banner.jpg",
"Test",
"Enabled",
"http://groups.google.com/group/adwords-api-php",
"http://groups.google.com/group/adwords-api-php"
);
addImageAdList($ads)
Adds a list of Image Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'imageLocation',
'name',
'status',
'displayUrl',
'destinationUrl'
)
)
[Ad] adObjects
$imageAd1 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "Creative-TestSuite_Banner.jpg",
'name' => "Test1",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$imageAd2 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "Creative-TestSuite_Banner.jpg",
'name' => "Test2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$imageAds = addImageAdList(array($imageAd1, $imageAd2));
addImageAdsOneByOne($ads)
Adds a list of Image Ads to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'imageLocation',
'name',
'status',
'displayUrl',
'destinationUrl'
)
)
[Ad] adObjects
$imageAd1 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "Creative-TestSuite_Banner.jpg",
'name' => "Test1",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$imageAd2 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "Creative-TestSuite_Banner.jpg",
'name' => "Test2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$imageAds = addImageAdsOneByOne(array($imageAd1, $imageAd2));
addLocalBusinessAd(
$belongsToAdGroupId,
$address,
$businessImageLocation,
$businessKey,
$businessName,
$city,
$countryCode,
$customIconLocation,
$customIconId,
$description1,
$description2,
$phoneNumber,
$postalCode,
$region,
$stockIcon,
$targetRadiusInKm,
$status,
$displayUrl,
$destinationUrl,
$exemptionRequest = false
)
Adds a Local Business Ad to the given AdGroup.
Integer belongsToAdGroupId
String address
String businessImageLocation
String businessKey
String businessName
String city
String countryCode
{String customIconLocation} // XOR customIconId XOR stockIcon
{Integer customIconId} // XOR stockIcon XOR customIconLocation
String description1
String description2
String phoneNumber
String postalCode
String region
{String stockIcon} // XOR customIconId XOR customIconLocation
Integer targetRadiusInKm
String status
String displayUrl
String destinationUrl
{String exemptionRequest} // Required on policy violation.
Ad adObject
$localBusinessAd = addLocalBusinessAd(
123456789,
'ABC Street 123',
'./TestSuite_LocalBusinessAd.gif',
'Some!Cryptic!Business!Key!Assigned!To!Your!Business',
'Your Business Name',
'Mountain View',
'US',
null,
null,
'Your Description 1',
'Your Description 2',
'123 456 789',
'12345',
'Bay Area',
'Standard_1',
16.09344,
'Enabled',
'www.google-apility.sourceforge.net',
'http://www.google-apility.sourceforge.net/'
);
addLocalBusinessAdList($ads)
Adds a list of Local Business Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'address',
'businessImageLocation',
'businessKey',
'businessName',
'city',
'countryCode',
'customIconLocation',
'customIconId',
'description1',
'description2',
'phoneNumber',
'postalCode',
'region',
'stockIcon',
'targetRadiusInKm',
'status',
'displayUrl',
'destinationUrl',
{'exemptionRequest'}
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'address' => 'ABC Street 123',
'businessImageLocation' => './TestSuite_LocalBusinessAd1.gif',
'businessKey' => 'Some!Cryptic!Business!Key!Assigned!To!Your!Business 1',
'businessName' => 'Your Business Name 1',
'city' => 'Mountain View',
'countryCode' => 'US',
'customIconLocation' => null,
'customIconId' => null,
'description1' => 'Your Description 1',
'description2' => 'Your Description 2',
'phoneNumber' => '123 456 789',
'postalCode' => '12345',
'region' => 'Bay Area',
'stockIcon' => 'Standard_1',
'targetRadiusInKm' => 16.09344,
'status' => 'Enabled',
'displayUrl' => 'www.google-apility.sourceforge.net',
'destinationUrl' => 'http://www.google-apility.sourceforge.net/'
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'address' => 'XYZ Street 321',
'businessImageLocation' => './TestSuite_LocalBusinessAd2.gif',
'businessKey' => 'Some!Cryptic!Business!Key!Assigned!To!Your!Business 2',
'businessName' => 'Your Business Name 2',
'city' => 'Mountain View',
'countryCode' => 'US',
'customIconLocation' => null,
'customIconId' => null,
'description1' => 'Your Description 1',
'description2' => 'Your Description 2',
'phoneNumber' => '987 654 321',
'postalCode' => '54321',
'region' => 'Bay Area',
'stockIcon' => 'Standard_2',
'targetRadiusInKm' => 16.09344,
'status' => 'Enabled',
'displayUrl' => 'www.google-apility.sourceforge.net',
'destinationUrl' => 'http://www.google-apility.sourceforge.net/'
);
$localBusinessAds = addLocalBusinessAdList(array($ad1, $ad2));
addLocalBusinessAdsOneByOne($ads)
Adds a list of Local Business Ads to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'address',
'businessImageLocation',
'businessKey',
'businessName',
'city',
'countryCode',
'customIconLocation',
'customIconId',
'description1',
'description2',
'phoneNumber',
'postalCode',
'region',
'stockIcon',
'targetRadiusInKm',
'status',
'displayUrl',
'destinationUrl',
{'exemptionRequest'}
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'address' => 'ABC Street 123',
'businessImageLocation' => './TestSuite_LocalBusinessAd1.gif',
'businessKey' => 'Some!Cryptic!Business!Key!Assigned!To!Your!Business 1',
'businessName' => 'Your Business Name 1',
'city' => 'Mountain View',
'countryCode' => 'US',
'customIconLocation' => null,
'customIconId' => null,
'description1' => 'Your Description 1',
'description2' => 'Your Description 2',
'phoneNumber' => '123 456 789',
'postalCode' => '12345',
'region' => 'Bay Area',
'stockIcon' => 'Standard_1',
'targetRadiusInKm' => 16.09344,
'status' => 'Enabled',
'displayUrl' => 'www.google-apility.sourceforge.net',
'destinationUrl' => 'http://www.google-apility.sourceforge.net/'
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'address' => 'XYZ Street 321',
'businessImageLocation' => './TestSuite_LocalBusinessAd2.gif',
'businessKey' => 'Some!Cryptic!Business!Key!Assigned!To!Your!Business 2',
'businessName' => 'Your Business Name 2',
'city' => 'Mountain View',
'countryCode' => 'US',
'customIconLocation' => null,
'customIconId' => null,
'description1' => 'Your Description 1',
'description2' => 'Your Description 2',
'phoneNumber' => '987 654 321',
'postalCode' => '54321',
'region' => 'Bay Area',
'stockIcon' => 'Standard_2',
'targetRadiusInKm' => 16.09344,
'status' => 'Enabled',
'displayUrl' => 'www.google-apility.sourceforge.net',
'destinationUrl' => 'http://www.google-apility.sourceforge.net/'
);
$localBusinessAds = addLocalBusinessAdsOneByOne(array($ad1, $ad2));
addMobileAd(
$belongsToAdGroupId,
$businessName,
$countryCode,
$description,
$headline,
$markupLanguages,
$mobileCarriers,
$phoneNumber,
$status,
$displayUrl,
$destinationUrl,
$exemptionRequest = false
)
Adds a Mobile Ad to the given AdGroup.
Integer belongsToAdGroupId
String businessName
String countryCode
String description
String headline
[String] markupLanguages
[String] mobileCarriers
String phoneNumber
String status
String displayUrl
String destinationUrl
String {exemptionRequest} // Required on policy violation.
Ad adObject
$mobileAd = addMobileAd(
123456789,
"Test Business Inc.",
"US",
"Test Business Description",
"Test Business Headline",
array("XHTML"),
array("Cingular@US"),
"800-123-4567",
"Enabled",
"http://groups.google.com/group/adwords-api-php",
"http://groups.google.com/group/adwords-api-php"
);
addMobileAdList($ads)
Adds a list of Mobile Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'businessName',
'countryCode',
'description',
'headline',
'markupLanguages',
'mobileCarriers',
'phoneNumber',
'status',
'displayUrl',
'destinationUrl',
'{exemptionRequest}' // Required on policy violation.
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'businessName' => "Test Business 1 Inc.",
'countryCode' => "US",
'description' => "Test Business 1 Description",
'headline' => "Test Business 1 Headline",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'phoneNumber' => "800-123-4567",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'businessName' => "Test Business 2 Inc.",
'countryCode' => "US",
'description' => "Test Business 2 Description",
'headline' => "Test Business 2 Headline",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'phoneNumber' => "800-123-5678",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$mobileAds = addMobileAdList(array($ad1, $ad2));
addMobileAdsOneByOne($ads)
Adds a list of Mobile Ads to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'businessName',
'countryCode',
'description',
'headline',
'markupLanguages',
'mobileCarriers',
'phoneNumber',
'status',
'displayUrl',
'destinationUrl',
'{exemptionRequest}' // Required on policy violation.
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'businessName' => "Test Business 1 Inc.",
'countryCode' => "US",
'description' => "Test Business 1 Description",
'headline' => "Test Business 1 Headline",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'phoneNumber' => "800-123-4567",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'businessName' => "Test Business 2 Inc.",
'countryCode' => "US",
'description' => "Test Business 2 Description",
'headline' => "Test Business 2 Headline",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'phoneNumber' => "800-123-5678",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$mobileAds = addMobileAdsOneByOne(array($ad1, $ad2));
addMobileImageAd(
$belongsToAdGroupId,
$imageLocation,
$markupLanguages,
$mobileCarriers,
$status,
$displayUrl,
$destinationUrl,
$exemptionRequest = false
)
Adds a Mobile Image Ad to the given AdGroup.
Integer belongsToAdGroupId
String imageLocation
[String] markupLanguages
[String] mobileCarriers
String status
String displayUrl
String destinationUrl
String {exemptionRequest} // Required on policy violation.
Ad adObject
$mobileImageAd = addMobileAd(
123456789,
"192x53.gif"
array("XHTML"),
array("Cingular@US"),
"Enabled",
"www.google.com",
"http://google.com/"
);
addMobileImageAdList($ads)
Adds a list of Mobile Image Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'imageLocation'
'markupLanguages',
'mobileCarriers',
'status',
'displayUrl',
'destinationUrl',
'{exemptionRequest}' // Required on policy violation.
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "192x53_1.gif",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "192x53_1.gif",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$mobileAds = addMobileImageAdList(array($ad1, $ad2));
addMobileImageAdsOneByOne($ads)
Adds a list of Mobile Image Ads to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'imageLocation',
'markupLanguages',
'mobileCarriers',
'status',
'displayUrl',
'destinationUrl',
'{exemptionRequest}' // Required on policy violation.
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "192x53_1.gif",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'imageLocation' => "192x53_2.gif",
'markupLanguages' => array("XHTML"),
'mobileCarriers' => array("Cingular@US"),
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$mobileAds = addMobileImageAdsOneByOne(array($ad1, $ad2));
addTextAd(
$belongsToAdGroupId,
$headline,
$description1,
$description2,
$status,
$displayUrl,
$destinationUrl,
$exemptionRequest = false
)
Adds a Text Ad to the given AdGroup.
Integer belongsToAdGroupId
String headline
String description1
String description2
String status
String displayUrl
String destinationUrl
{exemptionRequest} // Required on policy violation.
Ad adObject
$adObject = addTextAd(
123456789,
"The headline",
"The description1",
"The description2",
"Enabled",
"http://groups.google.com/group/adwords-api-php",
"http://groups.google.com/group/adwords-api-php"
);
addTextAdList($ads)
Adds a list of Text Ads to the given AdGroup. This will fail completely even if just one Ad fails, but the function causes no SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'headline',
'description1',
'description2',
'status',
'displayUrl',
'destinationUrl',
{'exemptionRequest'}
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'headline' => "The first headline",
'description1' => "The first description1",
'description2' => "The first description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'headline' => "The second headline",
'description1' => "The second description1",
'description2' => "The second description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$adObjects = addTextAdList(array($ad1, $ad2));
addTextAdsOneByOne($ads)
Adds a list of TextAds to the given AdGroup. This will not fail completely if just one Ad fails, but the function causes a lot of SOAP overhead.
ads = array(
array(
'belongsToAdGroupId',
'headline',
'description1',
'description2',
'status',
'displayUrl',
'destinationUrl',
{'exemptionRequest'}
)
)
[Ad] adObjects
$ad1 = array(
'belongsToAdGroupId' => 123456789,
'headline' => "The first headline",
'description1' => "The first description1",
'description2' => "The first description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'belongsToAdGroupId' => 123456789,
'headline' => "The second headline",
'description1' => "The second description1",
'description2' => "The second description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$adObjects = addTextAdsOneByOne(array($ad1, $ad2));
addVideoAd(
$belongsToAdGroupId,
$imageLocation,
$name,
$video,
$displayUrl,
$destinationUrl,
$status,
$exemptionRequest = false,
)
Adds a Video Ad to the given AdGroup.
Integer belongsToAdGroupId
String imageLocation
String name
Video video
String displayUrl
String destinationUrl
String status
{exemptionRequest} // Required on policy violation.
Ad adObject
$videos = getMyVideos();
$adObject = addVideoAd(
123456789,
"./image.jpg",
"The Name",
$video[0],
"http://groups.google.com/group/adwords-api-php",
"http://groups.google.com/group/adwords-api-php",
"Enabled"
);
checkAdList($adObjects, $languages, $geoTargets)
Checks a batch of Ads for policy errors. The number of Ads in the batch is limited to the maximum number of Ads per adgroup.
[Ad] ads
[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' =>
)
[ApiError] adsCheck
$ad1 = array(
'headline' => "The first headline",
'description1' => "The first description1",
'description2' => "The first description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$ad2 = array(
'headline' => "The second headline",
'description1' => "The second description1",
'description2' => "The second description2",
'status' => "Enabled",
'displayUrl' => "http://groups.google.com/group/adwords-api-php",
'destinationUrl' => "http://groups.google.com/group/adwords-api-php"
);
$adObjects = array($ad1, $ad2);
$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(checkAdList($adObjects, $languages, $geoTargets));
createAdObject($givenAdGroupId, $givenAdId)
Creates a local Ad object based on the Ad's AdGroup ID and the Ad's ID.
Integer givenAdGroupId
Integer givenAdId
Ad adObject
print_r(createAdObject(123456789, 987654321));
findBusinesses($name, $address, $countryCode)
Searches for businesses with similar attributes. This call is similar to querying Google Local Search.
String name
String address
String countryCode
[Business] businesses
print_r(findBusinesses('Farmacia', 'Barcelona', 'ES'));
getActiveAds($adGroupIds)
Returns all active Ads of a given list of AdGroups.
[Integer] adGroupIds
[Ad] adObjects
$allAds = getActiveAds(array(123456789));
getAllAds($adGroupIds)
Returns all Ads of a given list of AdGroups.
[Integer] adGroupIds
[Ad] adObjects
$allAds = getAllAds(array(123456789));
getMyBusinesses()
Returns the list of businesses registered to the user in the Local Business Center. The user is determined by the clientEmail header if it is specified. Otherwise, the email header is used instead.
None
[Business] myBusinesses
print_r(getMyBusinesses());
getMyVideos()
Returns a list of all videos stored under the users account. The user is determined by the clientEmail if specified. Otherwise, the email header is used.
None
[Video] videos
$myVideos = getMyVideos();
removeAd($adObject)
Removes an Ad and unsets its local object variable.
Ad adObject
none
$adObject = createAdObject(123456789, 987654321);
$adObject->removeAd($adObject);
deleteReport($reportJobId)
Deletes a previously scheduled report job with the given ID.
Integer reportJobId
None
$allReportJobs = getAllJobs();
foreach($allReportJobs as $reportJob) {
deleteReport($reportJob['Id']);
}
downloadTsvReport($reportId)
Returns a report in TSV format (Excel readable) for a given Report ID. Use this function when you already know the Report's ID, for example to download an already existing Report once more.
Integer reportId
String tsvReport // Contains the report in TSV file format
$tsvReport = downloadTsvReport(12345);
echo $tsvReport;
downloadXmlReport($reportId)
Returns a report in XML format for a given Report ID. Use this function when you already know the Report's ID, for example to download an already existing Report once more.
Integer reportId
String xmlReport // Contains the report in XML file format
$xmlReport = downloadXmlReport(12345);
echo $xmlReport;
getAccountStructureTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
An Account Structure report lets you view attribute data from your account. This report type provides a convenient way for you retrieve all data unrelated to performance in one report.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getAccountStructureTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'AdGroupId'),
array('AdGroup'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAccountStructureXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
An Account Structure report lets you view attribute data from your account. This report type provides a convenient way for you retrieve all data unrelated to performance in one report.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getAccountStructureXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'AdGroupId'),
array('AdGroup'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAccountTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst
$onlyReturnDownloadUrl
)
Gets an Account performance report. An Account performance report lets you view data about how your account is performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getAccountTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('CustomerName'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAccountXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst
$onlyReturnDownloadUrl
)
Gets an Account performance report. An Account performance report lets you view data about how your account is performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getAccountXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('CustomerName'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAdGroupTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets an AdGroup performance report. An AdGroup performance report lets you view data about how your AdGroups are performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getAdGroupTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'AdGroupId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAdGroupXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets an AdGroup performance report. An AdGroup performance report lets you view data about how your AdGroups are performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getAdGroupXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'AdGroupId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getAllJobs()
Returns all report jobs scheduled by the current user.
None
[ReportJob] allReportJobs
print_r(getAllJobs());
getCampaignTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Campaign performance report. A Campaign performance report lets you view data about how your campaigns are performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getCampaignTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Campaign', 'CampaignId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getCampaignXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Campaign performance report. A Campaign performance report lets you view data about how your campaigns are performing.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getCampaignXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Campaign', 'CampaignId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getContentPlacementTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
A Placement Performance report shows performance statistics for your ads on specific domains and URLs in the content network.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getContentPlacementTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'PlacementUrl'),
array('AdGroup', 'Url', 'Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getContentPlacementXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
A Placement Performance report shows performance statistics for your ads on specific domains and URLs in the content network.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getContentPlacementXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('AdGroup', 'PlacementUrl'),
array('AdGroup', 'Url', 'Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getCreativeTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets an Ad performance report. An Ad performance report lets you view statistics on how specific types of ad variations are performing. This report lets you see performance statistics on text ads, image ads and, where available, mobile ads and local business ads.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getCreativeTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('CreativeId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getCreativeXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets an Ad performance report. An Ad performance report lets you view statistics on how specific types of ad variations are performing. This report lets you see performance statistics on text ads, image ads and, where available, mobile ads and local business ads.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getCreativeXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('CreativeId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getGeographicTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Geographic Performance report. A Geographic Performance report shows performance statistics for your ads by approximated geographic origin.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getGeographicTsvReport(
'Report Name',
'2008-09-01',
'2008-12-01',
array('Country', 'Account'),
array('Account'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
true
);
getGeographicXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Geographic Performance report. A Geographic Performance report shows performance statistics for your ads by approximated geographic origin.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getGeographicXmlReport(
'Report Name',
'2008-09-01',
'2008-12-01',
array('Country', 'Account'),
array('Account'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
true
);
getKeywordTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Site/Keyword performance report. A Site/Keyword performance report lets you view statistics on how your keywords are performing across selected campaigns.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getKeywordTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Keyword', 'KeywordId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'SearchOnly',
'Broad',
false,
array(),
false,
30,
false
);
getKeywordXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Site/Keyword performance report. A Site/Keyword performance report lets you view statistics on how your keywords are performing across selected campaigns.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getKeywordXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Keyword', 'KeywordId'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'SearchOnly',
'Broad',
false,
array(),
false,
30,
false
);
getReachAndFrequqencyTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Reach and Frequency performance report. A Reach and Frequency performance report shows how many people saw your ads and how many times they saw them over a certain period of time. This report data is available at the site, ad group, and campaign levels for CPM site-targeted campaigns only.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getReachAndFrequencyTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Campaign'),
array('Weekly', 'Campaign'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getReachAndFrequqencyXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst
$onlyReturnDownloadUrl
)
Gets a Reach and Frequency performance report. A Reach and Frequency performance report shows how many people saw your ads and how many times they saw them over a certain period of time. This report data is available at the site, ad group, and campaign levels for CPM site-targeted campaigns only.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getReachAndFrequencyXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('Campaign'),
array('Weekly', 'Campaign'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getSearchQueryTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Search Query Performance report. A Search Query Performance report shows performance data for the search queries that triggered the ads which appeared after receiving clicks. This report is only available for the search network.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getSearchQueryTsvReport(
'Report Name',
'2008-09-01',
'2008-11-01',
array('Account', 'Query'),
array('Account', 'Daily'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
true
);
getSearchQueryXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a Search Query Performance report. A Search Query Performance report shows performance data for the search queries that triggered the ads which appeared after receiving clicks. This report is only available for the search network.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getSearchQueryXmlReport(
'Report Name',
'2008-09-01',
'2008-11-01',
array('Account', 'Query'),
array('Account', 'Daily'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
true
);
getUrlTsvReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a URL performance report. A URL performance report lets you view data related to your ads' destination URLs.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportTsv
echo getUrlTsvReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('DestinationURL'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
getUrlXmlReport(
$name,
$startDay,
$endDay,
$selectedColumns,
$aggregationTypes,
$campaigns,
$campaignStatuses,
$adGroups,
$adGroupStatuses,
$keywords,
$keywordStatuses,
$adWordsType,
$keywordType,
$isCrossClient,
$clientEmails,
$includeZeroImpression,
$sleepTime,
$validateFirst,
$onlyReturnDownloadUrl
)
Gets a URL performance report. A URL performance report lets you view data related to your ads' destination URLs.
String name,
String startDay,
String endDay,
[String] selectedColumns,
[String] aggregationTypes,
[Integer] campaigns,
[String] campaignStatuses,
[Integer] adGroups,
[String] adGroupStatuses,
[String] keywords,
[String] keywordStatuses,
String adWordsType,
String keywordType,
Boolean isCrossClient,
[String] clientEmails,
Boolean includeZeroImpression,
Integer sleepTime,
Boolean validateFirst
Boolean onlyReturnDownloadUrl
String reportXml
echo getUrlXmlReport(
'Report Name',
'2006-09-01',
'2007-09-01',
array('DestinationURL'),
array('Weekly'),
array(),
array(),
array(),
array(),
array(),
array(),
'',
'',
false,
array(),
false,
30,
false
);
OperationsgetKeywordVariationsgetKeywordsFromSite |
APIlity uses these native API KeywordTool functions. |
These function are defined in the KeywordTool Service WSDL. |
getKeywordVariations($seedKeywords, $useSynonyms, $languages, $countries)
Given a list of SeedKeywords, returns their variations in multiple lists within KeywordVariations. Each list represents a different kind of variation.
[SeedKeyword] seedKeywords
Boolean useSynonyms
[String] languages // Pass array("all") to select all languages
[String] countries // Pass array("all") for all countries
keywordVariations = array(
'moreSpecific' =>
array(
'text',
'language',
'advertiserCompetitionScale',
'avgSearchVolume',
'lastMonthSearchVolume'
),
'additionalToConsider' =>
array(
'text',
'language',
'advertiserCompetitionScale',
'avgSearchVolume',
'lastMonthSearchVolume'
)
)
$seedKeyword1 = array(
'text' => "some text",
'type' => "Broad",
'isNegative' => false
);
$seedKeyword2 = array(
'text' => "other text",
'type' => "Phrase",
'isNegative' => true
);
$seedKeywords = array($seedKeyword1, $seedKeyword2);
print_r(getKeywordVariations($seedKeywords, true, array("all"), array("all")));
getKeywordsFromSite($url, $includeLinkedPages, $languages, $countries)
Given a URL, returns Keywords based on words found on that web page or site, which can be used as keyword criteria for a Campaign.
String url
Boolean includeLinkedPages
[String] languages // Pass array("all") to select all languages
[String] countries // Pass array("all") for all countries
keywordsFromSite = array(
'groups',
'keywords' =>
array(
'text',
'language',
'advertiserCompetitionScale',
'avgSearchVolume',
'lastMonthSearchVolume'
)
)
print_r(getKeywordsFromSite("spiegel.de", false, array("all"), array("all")));
OperationsgetSitesByCategoryNamegetSitesByDemographics getSitesByTopics getSitesByUrls |
APIlity uses these native API SiteSuggestion functions. |
These function are defined in the SiteSuggestion Service WSDL. |
getSitesByCategoryName($categoryName, $targeting)
Returns site suggestions based on the specified category name. Each suggestion contains useful information such as the URL, accepted ad formats and page views.
String categoryName
targeting = array(
'countries' => array(),
'languages' => array(),
'metros' => array(),
'regions' => array()
)
SiteSuggestion siteSuggestion
$targeting = array(
'countries' => array('ES'),
'languages' => array('es'),
'metros' => array(),
'regions' => array()
);
print_r(getSitesByCategoryName("MP3 Players", $targeting));
getSitesByDemographics($demographics, $targeting)
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.
targeting = array(
'countries' => array(),
'languages' => array(),
'metros' => array(),
'regions' => array()
)
array(
'childrenTarget',
'ethnicityTarget',
'genderTarget',
'minAgeRange',
'maxAgeRange',
'minHouseholdIncomeRange',
'maxHouseholdIncomeRange'
);
SiteSuggestion siteSuggestion
$targeting = array(
'countries' => array('ES'),
'languages' => array('es'),
'metros' => array(),
'regions' => array()
);
$demographics = array(
'childrenTarget' => 'HouseholdsWithChildrenOnly',
'ethnicityTarget' => 'NoPreference',
'genderTarget' => 'NoPreference',
'minAgeRange' => 'Range25To34',
'maxAgeRange' => 'Range25To34',
'minHouseholdIncomeRange' => 'Range75000To99999',
'maxHouseholdIncomeRange' => 'Range100000PLUS'
);
print_r(getSitesByDemographics($demographics, $targeting));
getSitesByTopics($topics, $targeting)
Returns site suggestions based on the specified topics. Each suggestion contains useful information such as the URL, accepted ad formats and page views.
targeting = array(
'countries' => array(),
'languages' => array(),
'metros' => array(),
'regions' => array()
)
[String] topics
SiteSuggestion siteSuggestion
$targeting = array(
'countries' => array('ES'),
'languages' => array('es'),
'metros' => array(),
'regions' => array()
);
$topics = array('search engines', 'web services');
print_r(getSitesByTopics($topics, $targeting));
getSitesByUrls($urls, $targeting)
Returns site suggestions based on the specified URLs. Each suggestion contains useful information such as the URL, accepted ad formats and page views.
targeting = array(
'countries' => array(),
'languages' => array(),
'metros' => array(),
'regions' => array()
)
[String] urls
SiteSuggestion siteSuggestion
$targeting = array(
'countries' => array('ES'),
'languages' => array('es'),
'metros' => array(),
'regions' => array()
);
$urls = array('google.com', 'yahoo.com');
print_r(getSitesByUrls($urls, $targeting));
OperationscheckKeywordListTrafficgetAdGroupEstimate getCampaignEstimate getCustomizedKeywordListEstimate getKeywordEstimate getNewKeywordEstimate getNewKeywordListEstimate |
APIlity uses these native API TrafficEstimator functions. |
These function are defined in the TrafficEstimator Service WSDL. |
checkKeywordListTraffic($keywords)
Checks a batch of Keywords to see whether they will get any traffic. If a Keyword is not expected to get any traffic, you more than likely do not want to bother adding it.
Keyword keywordObject // simplified Keyword object
[KeywordTraffic]
$keyword1 = array('text' => "test1", 'type' => "Broad");
$keyword2 = array('text' => "test2", 'type' => "Broad");
print_r(checkKeywordListTraffic(array($keyword1, $keyword2)));
getAdGroupEstimate($adGroupObject)
Returns a performance estimate for each Keyword of an AdGroup.
AdGroup adGroupObject
adGroupEstimate = array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
)
$adGroupObject = createAdGroupObject(123456789);
$adGroupEstimate = getAdGroupEstimate($adGroupObject);
getCampaignEstimate($campaignObject)
Returns a performance estimate for each Keyword of all AdGroups of a Campaign.
Campaign campaignObject
campaignEstimate = array(
array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
),
'adGroupName',
'adGroupId'
),
'campaignName',
'campaignId'
)
$campaignObject = createCampaignObject(123456789);
$campaignEstimate = getCampaignEstimate($campaignObject);
getCustomizedKeywordListEstimate(
$keywords,
$maxCpc,
$geoTargets,
$languages,
$networkTargeting
)
Returns a customizable performance estimate for a list of Keywords.
[Keyword] keywordObjects
Integer maxCpc
[String] geoTargets
[String] languages
[String] networkTargeting
keywordEstimate = array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)
$keywordObjects = array(createKeywordObject(123456789, 987654321));
$maxCpc = 0.1;
$newGeoTargets = array(
'countryTargets' => array(
'countries' => array()
),
'regionTargets' => array(
'regions' => array()
),
'metroTargets' => array(
'metros' => array()
),
'cityTargets' => array(
'cities' => array(
"Reutlingen, BW DE",
"Karlsruhe, BW DE"
)
),
'proximityTargets' => array(
'circles' => array()
)
);
$languages = array('de');
$networkTargeting = array("GoogleSearch", "SearchNetwork");
$keywordEstimate = getCustomizedKeywordListEstimate(
$keywordObjects,
$maxCpc,
$newGeoTargets,
$languages,
$networkTargeting
);
getKeywordEstimate($keywordObject)
Returns a performance estimate for a Keyword.
Keyword keywordObject
keywordEstimate = array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)
$keywordObject = createKeywordObject(123456789, 987654321);
$keywordEstimate = getKeywordEstimate($keywordObject);
getNewKeywordEstimate($text, $type, $maxCpc, $isNegative)
Returns a performance estimate for a new (i.e. not yet existing) Keyword.
String text
String type
Integer maxCpc
Boolean isNegative
newKeywordEstimate = array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)
$newKeywordEstimate = getNewKeywordEstimate("test", "Exact", 0.65, false);
getNewKeywordListEstimate($newKeywords)
Returns a performance estimate for each new (i.e. not yet existing) Keyword of a given Keyword list.
newKeywords = array(
array(
'text',
'type',
'maxCpc'
'isNegative'
)
)
newKeywordListEstimates = array(
array(
'text',
'lowerAveragePosition',
'upperAveragePosition',
'lowerCostPerClick',
'upperCostPerClick',
'lowerClicksPerDay',
'upperClicksPerDay'
)
)
$keyword1 = array(
'text' => "test1",
'type' => "Broad",
'maxCpc' => 0.10,
'isNegative' => false
);
$keyword2 = array(
'text' => "test2",
'type' => "Broad",
'maxCpc' => 0.20,
'isNegative' => false
);
$newKeywordEstimates = getNewKeywordListEstimate(array($keyword1, $keyword2));
OperationscreateDefaultNetworkTargetingXmlcreateEmailPreferencesXml getAccountInfo getClientsClientAccountInfos getClientsClientAccounts getManagersClientAccountInfos getManagersClientAccounts getMccAlerts updateAccountInfo |
APIlity uses these native API Account functions. |
These function are defined in the Account Service WSDL. |
createDefaultNetworkTargetingXml($networkTargets)
Helper function for updateAccountInfo() to create valid XML for the Default Network Targets.
NetworkTargets networkTargets
String defaultNetworkTargetingXml // contains XML encoded Default Network Targets
$networkTargets = array('GoogleSearch', 'ContentNetwork');
$defaultNetworkTargetingXml = createDefaultNetworkTargetingXml($networkTargets);
createEmailPreferencesXml(
$marketResearchEnabled,
$newsletterEnabled,
$promotionsEnabled,
$accountPerformanceEnabled,
$disapprovedAdsEnabled
)
Helper function for updateAccountInfo() to create valid XML for the Email Preferences.
Boolean marketResearchEnabled
Boolean newsletterEnabled
Boolean promotionsEnabled
Boolean accountPerformanceEnabled
Boolean disapprovedAdsEnabled
String emailPreferencesXml // contains XML encoded Email Preferences
$emailPreferencesXml = createEmailPreferencesXml(true, false, true, true, true);
getAccountInfo()
Returns the AdWords account specified by the client account header.
None
accountInfo =
array(
'currencyCode',
'customerId',
'defaultNetworkTargeting' => array(),
'descriptiveName',
'emailPromotionsPreferences' array(
'marketResearchEnabled',
'newsletterEnabled',
'promotionsEnabled',
),
'languagePreference',
'primaryAddress' => array(
'addressLine1',
'addressLine2',
'city',
'companyName',
'countryCode',
'emailAddress',
'faxNumber',
'name',
'phoneNumber',
'postalCode',
'state'
),
'primaryBusinessCategory',
'termsAndConditions',
'timeZoneEffectiveDate'
)
print_r(getAccountInfo());
getClientsClientAccountInfos()
Returns the current Client's client account infos (i.e. all client account infos that are managed by the current value of 'clientEmail' in the present authentication context).
None
[String] clientAccountInfos
print_r(getClientsClientAccountInfos());
getClientsClientAccounts()
Returns the current Client's client account e-mail addresses (i.e. all client account e-mail addresses that are managed by the current value of 'clientEmail' in the present authentication context).
None
[String] clientAccounts
print_r(getClientsClientAccounts());
getManagersClientAccountInfos()
Returns the current Manager's client account infos (i.e. all client account infos that are managed by the current value of 'email' in the present authentication context).
None
[String] clientAccountInfos
print_r(getManagersClientAccountInfos());
getManagersClientAccounts()
Returns the current Manager's client account e-mail addresses (i.e. all client account e-mail addresses that are managed by the current value of 'email' in the present authentication context).
None
[String] clientAccounts
print_r(getManagersClientAccounts());
getMccAlerts()
Returns the MCC alerts associated with any of the accounts beneath the current account.
None
[MccAlert] mccAlerts
print_r(getMccAlerts());
updateAccountInfo(
$defaultNetworkTargeting,
$descriptiveName,
$emailPromotionsPreferences,
$languagePreference,
$primaryBusinessCategory
)
Updates the AdWords account specified by the client account header.
String defaultAdsNetworkTargeting // hint: use the function createDefaultNetworkTargetingXml()
String descriptiveName
String emailPreferencesXml // hint: use the function createEmailPreferencesXml()
String languagePreference
String primaryBusinessCategory
None
// use the helper functions to make sure the XML is valid
$defaultNetworkTargeting = array('GoogleSearch', 'SearchNetwork');
$defaultNetworkTargetingXml = createDefaultNetworkTargetingXml($defaultNetworkTargeting);
$emailPromotionsPreferences = createEmailPreferencesXml(true, true, false, true, true);
// finally update the account
updateAccountInfo($defaultNetworkTargetingXml, 'My favorite customer', $emailPromotionsPreferences, 'fr', 'Manufacturing');
OperationsgetMethodCostgetOperationCount getOperationsQuotaThisMonth getUnitCount getUnitCountForClients getUnitCountForMethod getUsageQuotaThisMonth |
APIlity uses these native API Info functions. |
These function are defined in the Info Service WSDL. |
getMethodCost($service, $method, $date)
Returns the cost, in quota units per operation, of the given method on a specific date. Methods default to a cost of 1.
String service
String method
String date
Integer methodCost
$yesterday = gmdate(
"Y-m-d",
mktime(
date("H"),
date("i"),
date("s"),
date("m"),
date("d") - 1,
date("Y")
)
);
echo getMethodCost("AdService","updateAds", $yesterday);
getOperationCount($startDate, $endDate)
Returns the number of operations executed during a given period of time.
String startDate
String endDate
Integer operationCount
$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")
)
);
echo getOperationCount($dayBeforeYesterday, $yesterday);
getOperationsQuotaThisMonth()
Returns the operations quota for the current month.
None
Integer operationsQuotaThisMonth
echo getOperationsQuotaThisMonth();
getUnitCount($startDate, $endDate)
Returns the number of quota units recorded for the developer token being used to make this call over the given date range.
String startDate
String endDate
Integer operationCount
$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")
)
);
echo getUnitCount($dayBeforeYesterday, $yesterday);
getUnitCountForClients($startDate, $endDate, $clientEmails)
Returns the number of operations executed during a given period of time.
String startDate
String endDate
[String] clientEmails
unitCountForClients = array(
array(
'clientEmail'
'quotaUnits'
)
)
print_r(
getUnitCountForClients(
'2005-01-01', '2006-08-01',
array(
'myCustomEmail@someWhere.tld',
'myOtherCustomEmail@anyWhere.tld'
)
)
);
getUnitCountForMethod($service, $method, $startDate, $endDate)
Returns the number of quota units recorded for the developer token being used to make this call over the given date range for a specific method.
String service
String method
String startDate
String endDate
Integer unitCountForMethod
$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")
)
);
echo getUnitCountForMethod("AdService", "updateAds", $dayBeforeYesterday, $yesterday);
getUsageQuotaThisMonth()
Returns this month's total usage quota, including free quota usage, for the developer token being used to make this call.
None
Integer usageQuotaThisMonth
echo getUsageQuotaThisMonth();