Java - cannot retrieve Youtube campaigns

29 views
Skip to first unread message

philippe...@blue2purple.com

unread,
May 17, 2017, 9:27:22 AM5/17/17
to AdWords API Forum
Hello everybody,

We are trying to pause/enable our AdWords campaigns with regards to the weather conditions.
In order to achieve that we retrieve our campaigns using the SelectorBuilder:

// Create selector.
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
.fields(CampaignField.Id, CampaignField.Name)
.orderAscBy(CampaignField.Name)
//.offset(offset)
//.limit(PAGE_SIZE)
.build();

and then look in all of our campaigns for the one we want to pause/enable:

CampaignPage page = null;
do {
// Get all campaigns.
page = campaignService.get(selector);

// Display campaigns.
if (page.getEntries() != null) {
for (com.google.api.ads.adwords.axis.v201702.cm.Campaign campaign : page.getEntries())
{
if ( campaign.getId().longValue() == Long.parseLong(campaign_.getID_2()))
{
if ( activate ) {
campaign.setStatus(CampaignStatus.ENABLED);
}

It works but the problem is: the retrieved campaigns do NOT include the Youtube ones. 
Can someone help us with that?

Truthfully yours,
Philippe

Shwetha Vastrad (AdWords API Team)

unread,
May 17, 2017, 11:53:41 AM5/17/17
to AdWords API Forum
Hi Philippe, 

Video campaigns are only supported in AdWords API reports at the moment. You'll not be able to use CampaignService to retrieve these campaigns. You need to download a Campaign Performance Report to get data for your video campaigns. 

Regards,
Shwetha, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages