Video campaign statistic through API

34 views
Skip to first unread message

Nooni

unread,
Nov 24, 2015, 7:11:55 AM11/24/15
to AdWords API Forum
Hi,

I would like to know how to get video campaign statistics data through API.

We are using the below script with the ad performance report but can not receive data of video campaigns.

If you could help us, I would appreciate it.  


<?php 
require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
header('Content-type: text/plain; charset=utf-8');
class Mainapp{
 public function googlelistacc($username,$password,$CustomerId)
 {
$username=trim($username);
$password=trim($password);

$googleconfig = parse_ini_file(dirname(__FILE__) . '/../../../logs/configgoogleacc.ini', false);

if($password != $googleconfig['password'] || $username != $googleconfig['username']){
echo"Username OR Password Wrong !!!";
exit();
}

$developerToken = $googleconfig['developerToken'];

$user = new AdWordsUser(null, null, null, $developerToken);
$user->SetDefaultServer("https://adwords.google.com/");
$user->LogAll();
$user->SetClientId($googleconfig['ClientId']);
$user->SetClientCustomerId($CustomerId);



$managedCustomerService = $user->GetService('CampaignService', 'v201506');
$selector = new Selector();

$selector->fields = array('CampaignId', 'Name','Status');
$page = $managedCustomerService->get($selector);
$accounts = array();
foreach ($page->entries as $account) {
    if ($account->id > 0) {
        $accounts[] = $account;
    }
}
$customer='';
foreach ($accounts as $account) {
$name=iconv('UTF-8','TIS-620',$account->name);
    $customer.='|'.$account->id;
$customer.='|'.$account->name;
//$customer.='|'.$account->status;
}

if(file_exists('soap_xml.log'))
{
unlink('soap_xml.log');
}
if(file_exists('request_info.log'))
{
unlink('request_info.log');
}

return  $customer;
 }
}
$Login = new Mainapp();
$data=$Login->googlelistacc($_GET['username'],$_GET['password'],$_GET['customerid']);
print $data;
?>



Anthony Madrigal

unread,
Nov 24, 2015, 10:24:10 AM11/24/15
to AdWords API Forum
Hello,

The CampaignService currently does not support video campaign statistics. In order to get stats for your video campaigns, you can use either the Campaign Performance Report or Video Performance Report.

Cheers,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages