user3347814
user3347814

Reputation: 1143

Is there a way to get Campaign Type with Google Adwords Script?

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

Answers (1)

user3347814
user3347814

Reputation: 1143

So far, the only solution I got was using a Campaign Performance Report.

https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/adwords-scripts/NB7Dj_gLYOs/zli0h-AfEQAJ

Upvotes: 1

Related Questions