javascript [adw-update ad params by ad groups] #adwords_scripts

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript [adw-update ad params by ad groups] #adwords_scripts相关的知识,希望对你有一定的参考价值。

function main() {
  var SPREADSHEET_URL = "https://docs.google.com/spreadsheet/ccc?key=0Agv-O0NUZxRtdHhQeGR3TGc3ZG54blFlSWpuWWVMdmc";
   
  var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
  var sheet = spreadsheet.getActiveSheet()
  var data = sheet.getRange("A:C").getValues(); //Columns are A - AdGroup Name | B - param1 | C - param2
   
  for(i in data) {
    //Skip the header row
    if(i == 0) { continue; }
    var [ag,param1,param2] = data[i];
    //stop when you run out of data
    if(ag == "") { break; }
    else {
      Logger.log("adgroup:"+ag+" param1:"+param1+" param2:"+param2);
      // Find the keyword
      var kw_iter = AdWordsApp.keywords()
        .withCondition("AdGroupName = '"+ag+"'")
        .withCondition("Status = ENABLED")
        .withCondition("CampaignStatus = ENABLED")
        .withCondition("AdGroupStatus = ENABLED")
        .get();
      while(kw_iter.hasNext()) {
        var kw = kw_iter.next();
        kw.setAdParam(1, param1);
        kw.setAdParam(2, param2);
      }
    }
  }
}

以上是关于javascript [adw-update ad params by ad groups] #adwords_scripts的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript Xanga Ad Remover

javascript Burda Mobile Panorama Ad v2 | SWIPE

xml标签内的html标签-如何在javascript中访问?

Azure AD B2C 自定义策略 - Javascript

如何在 .NET 或 JavaScript 中使用 MS-XCEP 和 MS-WSTEP 从 AD CS 获取证书?

用javascript检测iPad/iPhone/iPod