Reputation: 1143
I´m creating a report with Adwords Script. I need to select the Campaigns from a account with all source of criteria like: Device (mobile, desktop, tablet) and Type of Campaign (Search only, Display Only, Video, etc..).
I´ve managed to find a way to get the information for device using:
var campaign = campaignIterator.next();
Logger.log("Name: " + campaign.getName() + " ID: " + campaign.getId());
Logger.log("Clicks Desktop: " + campaign.targeting().platforms().desktop().get().next().getStatsFor("YESTERDAY").getClicks());
Logger.log("Clicks Mobile: " + campaign.targeting().platforms().mobile().get().next().getStatsFor("YESTERDAY").getClicks());
Logger.log("Clicks Tablet: " + campaign.targeting().platforms().tablet().get().next().getStatsFor("YESTERDAY").getClicks());
However, I can´t find a way to get the campaign based on their Type. The thing I want the most would be selecting campaigns based on their type. Something like:
var campaignIterator = AdWordsApp.campaigns().campaignTypes("search only").get();
//return all the "search only" campaigns
It would also help if there was a way to get the campaign type like:
var campaign = campaignIterator.next();
var campaignType = campaign.type();
//return the type of campaign eg. "Search Only"
Upvotes: 2
Views: 2524
Reputation: 1143
So far, the only solution I got was using a Campaign Performance Report.
Upvotes: 1