GET Video Adwords Campaigns 发生了什么
Whats happens with GET Video Adwords Campaigns
最近我开始了一个项目,从 google adwords api 获取活动并制作关于该信息的分析报告。
我有这个问题:
我启动这段代码以获取所有活动:
public function testGetCampaigns()
{
$user = new \AdWordsUser();
$user->LogAll();
$campaignService = $user->GetService('CampaignService', 'v201603');
// Create selector.go
$selector = new \Selector();
$selector->fields = array('Id', 'Name');
$selector->ordering[] = new \OrderBy('Name', 'ASCENDING');
// Create paging controls.
$selector->paging = new \Paging(0, \AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
$page = $campaignService->get($selector);
if (isset($page->entries)) {
foreach ($page->entries as $campaign) {
printf("Campaign with name '%s' and ID '%s' was found.\n",
$campaign->name, $campaign->id);
}
} else {
print "No campaigns were found.\n";
}
$selector->paging->startIndex += \AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
}
但结果不是我创建的两个活动,只是一个。
我不得不说 api 没有给我的是视频广告系列,而不是搜索广告系列。
代码结果:
1 / 1 (100%) 个名称为 'Testingalot' 且 ID 为“469071928”的活动被发现。
这是正确的,因为 CampaignService 不会在列表中显示视频广告系列。参见例如https://groups.google.com/forum/#!topic/adwords-api/SH7lk_y4GTw
最近我开始了一个项目,从 google adwords api 获取活动并制作关于该信息的分析报告。
我有这个问题:
我启动这段代码以获取所有活动:
public function testGetCampaigns()
{
$user = new \AdWordsUser();
$user->LogAll();
$campaignService = $user->GetService('CampaignService', 'v201603');
// Create selector.go
$selector = new \Selector();
$selector->fields = array('Id', 'Name');
$selector->ordering[] = new \OrderBy('Name', 'ASCENDING');
// Create paging controls.
$selector->paging = new \Paging(0, \AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
$page = $campaignService->get($selector);
if (isset($page->entries)) {
foreach ($page->entries as $campaign) {
printf("Campaign with name '%s' and ID '%s' was found.\n",
$campaign->name, $campaign->id);
}
} else {
print "No campaigns were found.\n";
}
$selector->paging->startIndex += \AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);
}
但结果不是我创建的两个活动,只是一个。
我不得不说 api 没有给我的是视频广告系列,而不是搜索广告系列。
代码结果:
1 / 1 (100%) 个名称为 'Testingalot' 且 ID 为“469071928”的活动被发现。
这是正确的,因为 CampaignService 不会在列表中显示视频广告系列。参见例如https://groups.google.com/forum/#!topic/adwords-api/SH7lk_y4GTw