Whats happens with GET Video Adwords Campaigns

回眸只為那壹抹淺笑 提交于 2019-12-23 03:13:31

问题


recently i started a project to get campaigns from google adwords api and make analytics reports about that info.

I have that issue:

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.

I have to say that the one that the api dont give to me, is a Video Campaigns, and not a search campaign.

RESULT OF THE CODE:

1 / 1 (100%)Campaign with name 'Testingalot' and ID '469071928' was found.



回答1:


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



来源:https://stackoverflow.com/questions/36497079/whats-happens-with-get-video-adwords-campaigns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!