我创建了一个Adwords脚本,并且能够在adwords UI中运行 .
function getCurrentAccountDetails() {
var currentAccount = AdWordsApp.currentAccount();
Logger.log('Customer ID: ' + currentAccount.getCustomerId() +
', Currency Code: ' + currentAccount.getCurrencyCode() +
', Timezone: ' + currentAccount.getTimeZone());
var stats = currentAccount.getStatsFor('LAST_MONTH');
Logger.log(stats.getClicks() + ' clicks, ' +
stats.getImpressions() + ' impressions last month');
}
我可以在Google App Scripts中运行Adwords脚本,因为GAS可以作为webapps发布,以便我可以根据需要为Adwords脚本提供一些值 .
我收到以下错误,因为在GAS中无法访问AdwordsApp . 那么有没有办法使用App脚本与Adwords脚本进行通信 .
ReferenceError: "AdWordsApp" is not defined.
我的要求是通过收集用户的输入来制作视频广告 . 因此,我没有找到任何Adwords API详细信息,因此我想通过从外部获取一些参数(name,video_url等)来使用AdwordsScript创建视频广告 .
1 回答
不是以任何官方方式 . 没有REST API,只有少数语言才存在客户端库 . GAS不是其中之一 . 我只能为Node找到这个NPM包:
https://www.npmjs.com/package/adwords-api
当然,这不适用于Apps脚本,因此您必须重写代码 .