Google AdWords API - There is no campaign!(PHP)

263 views
Skip to first unread message

F inc

unread,
Nov 16, 2015, 8:50:40 AM11/16/15
to AdWords API Forum
Hi everyone,

I wrote a program using the Google Adwords API want to retrieve the campaign information for a specific customer client ID.

This is my code.

<?php
require_once dirname(dirname(__FILE__)) . "/init.php";

function GetCampaignsTest(AdWordsUser $user) {
  $user->SetClientCustomerId('XXX-XXX-XXX');

  $campaignService =
      $user->GetService("CampaignService", ADWORDS_VERSION);

  $selector = new Selector();
  $selector->fields = array('Id', 'Name', 'Status');
  $selector->ordering[] = new OrderBy('Name', 'ASCENDING');
  $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
    $page = $campaignService->get($selector);

    if (isset($page->entries)) {
      foreach ($page->entries as $campaign) {
        echo $campaign->id . ': ' . $campaign->name . ' ' . $campaign->status . "\n";
      }
    } else {
      print "No campaigns were found.\n";
    }

    $selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
  } while ($page->totalNumEntries > $selector->paging->startIndex);
}

try {
  $user = new AdWordsUser();
  $user->LogAll();
  GetCampaignsTest($user);
} catch (Exception $e) {
  printf("An error has occurred: %s\n", $e->getMessage());
}
?>

The resutls ...
  "No campaigns were found."

Why campaigns is were not found?
What is wrong with it?

Notice:
The "SetClientCustomerId" is not MCC account. It is using the customer client ID(CID) that was allocated to the individual.
Of course, the campaign when viewed in Google Adwords management screen of the customer client ID has been set.
Google AdWords API v201509 use.

Anthony Madrigal

unread,
Nov 16, 2015, 12:37:30 PM11/16/15
to AdWords API Forum
Hi,

Could you please provide me with your CID so that I could verify this behavior? Please send it through reply privately to author.

Thanks,
Anthony
AdWords API Team

Anthony Madrigal

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

The reason you are not seeing any campaigns returned is because the CampaignService currently does not support video campaigns (which is what both your campaigns are). However, if you run the Campaign Performance Report or Video Performance Report, you should be able to see stats for them. 

Cheers,
Anthony
AdWords API Team

F inc

unread,
Nov 17, 2015, 8:57:33 PM11/17/15
to AdWords API Forum
Hi,

Thank you for the answer!

I understood. Although there "currently" is not supported, does it supported in the future?

I know that it obtained the information campaign to be run a "Campaign Performance Report" or "Video Performance Report". However, I would like to automatically be stopped in response to the video playback number of times. I think you can not just report API. How about that?

2015年11月18日水曜日 0時21分15秒 UTC+9 Anthony Madrigal:

Anthony Madrigal

unread,
Nov 18, 2015, 11:44:37 AM11/18/15
to AdWords API Forum
Hi,

I am not sure if and when this feature will be supported. You will not be able to automatically be stopped in response to the video playback number using the AdWords reports.

Please check our blog regarding any announcements to whether video campaigns will be supported by the CampaignService.

Regards,
Anthony
AdWords API Team

Hong Sompote

unread,
Feb 3, 2016, 8:28:23 AM2/3/16
to AdWords API Forum
Does this issue have been fixed in v201601 yet?

Anthony Madrigal

unread,
Feb 3, 2016, 10:23:05 AM2/3/16
to AdWords API Forum
Hi,

Unfortunately, video campaigns are still not supported through the CampaignService in AdWords API v201601.

I will update this thread once there are any updates.

Hong Sompote

unread,
Feb 3, 2016, 11:38:39 AM2/3/16
to AdWords API Forum
Hi
It's a bad news, I still waiting for an update
Thanks,
Hong
Reply all
Reply to author
Forward
0 new messages