RcBuilder@walla.com
call centre: 054-5614020

Adwords scripts Examples

08
Jun
2014
Posted by: RcBuilder  /   Category: Adwords Scripts / CHARTS / DriveApp / EMAIL / ENTITIES / JAVASCRIPT / REPORTS / SELECTORS & ITERATORS / SEM / SPREADSHEET / STATISTICS / UTILITIES / XML DOCUMENT   /   No Comments

Adwords scripts Examples

// get campaigns by ids + print their name and id
var campaigns = AdWordsApp.campaigns().withIds([157524671,157916231,157949711]).get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
Logger.log(campaign.getId() + ‘ ‘ + campaign.getName());
}

——————–

// Get each campaign’s cost and clicks last month
var campaigns = AdWordsApp.campaigns().forDateRange(“LAST_MONTH”).get();
while (campaigns.hasNext()) {
var campaign = campaigns.next();
Logger.log(campaign.getName());
var stats = campaign.getStatsFor(“LAST_MONTH”);
Logger.log(“cost ” + stats.getCost() + ” | clicks ” + stats.getClicks());
}

——————–

// get yesterday top 10 keywords with highest impressions
var date_period = ‘YESTERDAY’;
var keywords = AdWordsApp.keywords().orderBy(‘Impressions DESC’).forDateRange(date_period).withLimit(10).get();
while (keywords.hasNext()) {
var keyword = keywords.next();
Logger.log(keyword.getText());
Logger.log(keyword.getStatsFor(date_period).getImpressions());
}

——————–

// get keywords from ids geneated from report
var report = AdWordsApp.report(
‘SELECT Id, AdGroupId ‘ +
‘FROM DISPLAY_KEYWORD_PERFORMANCE_REPORT ‘ +
‘DURING LAST_30_DAYS’);

var ids = [];
var rows = report.rows();
while (rows.hasNext()) {
var row = rows.next();

ids.push([row["AdGroupId"], row["Id"]]);
}
//Logger.log(ids.length);

var keywords = AdWordsApp.keywords().withIds(ids);

Author Avatar

About the Author

בניית אתרים ופתרונות טכנולוגים | RcBuilder

No Comments


  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים