问题描述
最近,我启动了一个项目,以从google adwords api获取广告系列并制作有关该信息的分析报告.
recently i started a project to get campaigns from google adwords api and make analytics reports about that info.
我有这个问题:
我启动这段代码来获取所有广告系列:
I launch this piece of code to get all campaigns:
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);
}
但是结果不是我创建的两个广告系列,而仅仅是一个.
But the result is not the two campaigns that i created, is just only one.
我不得不说api没有给我的是视频广告系列,而不是搜索广告系列.
I have to say that the one that the api dont give to me, is a Video Campaigns, and not a search campaign.
代码结果:
找到1/1(100%)名称为"Testingalot"且ID为"469071928"的广告系列.
1 / 1 (100%)Campaign with name 'Testingalot' and ID '469071928' was found.
推荐答案
这是正确的,因为CampaignService不在列表中显示视频广告系列.参见例如 https://groups.google.com/forum/#!topic/adwords -api/SH7lk_y4GTw
It is correct because CampaignService does not show video campaigns in listings. See e.g. https://groups.google.com/forum/#!topic/adwords-api/SH7lk_y4GTw
这篇关于GET Video Adwords广告系列会怎样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!