javascript [零展示的adw-alert] #adwords_scripts

Posted

tags:

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

/**
will send you an email every time a campaign receives no impression the day before
http://catalyst.ca/blog/set-a-fire-alarm-on-your-accounts-with-adwords-scripts/
*/
function main() {
	// Enter your account name and email here:
	var accountName = "Account name";
	var yourEmail = "your - email @your - domain.com";
	var emailBody = "Yesterday, the following campaigns have had no impressions: <br> ";
	var noImpCamp = 0;
	var campaignsIterator = AdWordsApp.campaigns().get();
	while (campaignsIterator.hasNext()) {
		var campaign = campaignsIterator.next();
		var stats = campaign.getStatsFor('YESTERDAY');
		if ((stats.getImpressions() == 0) && (campaign.isEnabled())) {
			emailBody = emailBody + campaign.getName() + "<br> ";
			noImpCamp++;
		}
	}
	if (noImpCamp > 0) {
		MailApp.sendEmail(yourEmail, "Alert: "+accountName + "–" +noImpCamp + "Campaigns with no impressions", "", {
			htmlBody: emailBody
		});
	}
}

以上是关于javascript [零展示的adw-alert] #adwords_scripts的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript零基础入门 10:用JavaScript实现图片上传并预览

零基础学习前端的顺序是啥?

被强烈推荐的六大优秀JavaScript图表库

《Hexo: 从零开始编写自己的主题》4. fancybox优化图片展示效果代码高亮以及数学公式

一零四大数据可视化技术与应用实训(展示大屏幕)

salesforce lightning零基础学习 列表展示数据时两种自定义编辑页面