AdWords应用程序无法在Apps脚本代码编辑器中使用 - ScriptyApp错误

时间:2016-11-14 17:46:36

标签: google-apps-script google-sheets adwords-api-v201109

我已在电子表格中创建了一个脚本,可将AdWords报告导出到电子表格。

function Export(ss, Ads180, Ads14){
     var newDate = Utilities.formatDate(new Date(), "GMT", "yyyyMMdd");
     var SixMonths = Utilities.formatDate(subDays(new Date(),180), "GMT", "yyyyMMdd");
     var TwoWeeks = Utilities.formatDate(subDays(new Date(),14), "GMT", "yyyyMMdd");
     var report = AdWordsApp.report(
       "SELECT AdGroupName,Headline, Description1, Description2, HeadlinePart1, HeadlinePart2, Description, Impressions, Ctr, Conversions, Id" +
           " FROM AD_PERFORMANCE_REPORT" +
           " WHERE Status='ENABLED' AND CampaignName="+campaignName+
           " DURING "+SixMonths+","+newDate+"");
     report.exportToSheet(Ads180);
     report.exportToSheet(ss.getSheetByName('Summary'));


      report = AdWordsApp.report(
       "SELECT AdGroupName,Headline, Description1, Description2, HeadlinePart1, HeadlinePart2, Description, Impressions, Ctr, Conversions, Id" +
           " FROM AD_PERFORMANCE_REPORT" +
           " WHERE Status='ENABLED' AND CampaignName="+campaignName+
           " DURING "+TwoWeeks+","+newDate+"");


     report.exportToSheet(Ads14);  

    }

当我收到以下错误时出现问题:

  

ReferenceError:" AdWordsApp"未定义

所以我问了AdWords脚本论坛,他们建议使用AdWordsApp Library。 我用它,但现在我得到了这个奇怪的错误:

  

ReferenceError:" ScriptyApp"没有定义   The AdWordsApp Library and the Error   我不知道接下来该做什么,你能告诉我吗?

谢谢, 帽儿

2 个答案:

答案 0 :(得分:0)

据我所知,AdWordsApp所依赖的ScriptyApp在Apps脚本中不可用。您需要使用AdWords脚本。

答案 1 :(得分:0)

我遇到了同样的问题,似乎不幸谷歌排除了使用ScriptyApp。这是AdwordsApp处理Apps脚本的基础。