AdWordCampaignServiceAdWords Lib Campaign Service Class
Use this class to work with Google AdWords Campaign Service. CampaignService provides operations for accessing, modifying, and creating AdWords Campaigns
Located in /services/AdWordCampaignService.inc
AdWordService | --AdWordCampaignService
array|false
getCampaignStats
(array $campaignIds, string $start, string $end, [string $clientEmail = ''])
AdWordCampaignService Constructor. It takes one parameter - name of a supported by AdWords Lib SOAP toolkit
Example:
- <?php
- ?>
Adds a new Campaign
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$newCampaign is an object of class AdWordCampaign
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an object of class AdWordCampaign which holds the new
- //created Campaign
- ?>
Adds new Campaigns
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaign1, $campaign2 are objects of class AdWordCampaign
- $campaigns = array($campaign1, $campaign2);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordCampaign which
- //holds the new created Campaigns
- ?>
Returns all Campaigns. If there are no Campaigns, an empty array will be returned
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordCampaign
- ?>
Returns all information about the specified Campaign
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignId - Campaign's ID
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an object of class AdWordCampaign
- ?>
Returns a list of Campaigns
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignId1, $campaignId2 - Campaigns' IDs
- $campaignIds = array($campaignId1, $campaignId2);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordCampaign
- ?>
Get statistics for a list of ad Campaigns for a period of time
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignId1, $campaignId2 - Campaigns' IDs
- $campaignIds = array($campaignId1, $campaignId2);
- $start = '2005-01-01T00:00:00Z';
- $end = '2005-02-01T00:00:00Z';
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is an array of objects of class AdWordStatsRecord
- ?>
Retrieves the 'optimized ad serving' setting for this campaign
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignId - Campaign's ID
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response is string - 'true' or 'false'
- ?>
Modifies the 'optimized ad serving' setting for this campaign
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaignId - Campaign's ID
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response = true
- ?>
Updates the settings for an existing campaign
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaign is an object of class AdWordCampaign
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response == true
- ?>
Updates the settings for a list of existing campaigns.
Example:
- <?php
- $campaignService->setAccount($myEmail, $myPass, $myUserAgent, $myDeveloperToken, $myApplicationToken);
- //$campaign1, $campaign1 are objects of class AdWordCampaign
- $campaigns = array($campaign1, $campaign1);
- if ($response === false) { // if an error appears
- echo $errr->toString(); //output error
- exit();
- }
- //$response == true
- ?>
Inherited From AdWordService
AdWordService::AdWordService()
AdWordService::callService()
AdWordService::getAccount()
AdWordService::getClientCustomerId()
AdWordService::getClientEmail()
AdWordService::getLastError()
AdWordService::getResponseHeaders()
AdWordService::setAccount()
AdWordService::setClientCustomerId()
AdWordService::setClientEmail()
Documentation generated on Mon, 10 Sep 2007 15:07:15 +0300 by phpDocumentor 1.3.2