Skip to content

Instantly share code, notes, and snippets.

View Check_Client_Optimization_Scores.js
//Enter your email address where you want the email to be sent.
var RECIPIENT_EMAIL = 'example@example.com';
//Enter the subject of the email.
var EMAIL_SUBJECT = 'Google Ads - Check Client Optimization Scores.';
//Enter the label for all the accounts you wish to analyze.
var ACCOUNT_LABEL_TO_CHECK = "Monitor";
//Ignore for now.
View policy_issues_by_email.js
//Enter your email address where you want the email to be sent.
var RECIPIENT_EMAIL = "example@example.com";
//Enter the subject of the email.
var EMAIL_SUBJECT = 'Google Ads - Checked for policy issues.';
//Enter the label for all the accounts you wish to analyze.
var ACCOUNT_LABEL_TO_CHECK = "Monitor";
//Make sure that you update the getPolicyManagerURL function with your hardcoded OCID values
View extract_youtube_video_urls.js
var list=document.querySelector("ytd-section-list-renderer").querySelectorAll("a");
var youtubeVideos = [];
for (i=0;i<list.length;i++){
var url = list[i].getAttribute("href");
if(url && url.indexOf("/watch?v=")>-1){
var videoTitle = list[i].getAttribute("title");
var videoID = list[i].getAttribute("href").replace(/https:\/\/www\.youtube\.com|\/watch\?v=|&t=.+s|&list=.*/gi,"");
if (youtubeVideos.indexOf(videoID) == -1 && videoTitle) {
youtubeVideos.push("https://www.youtube.com" + url + "\t" + videoID + "\t" + videoTitle);
}
View google-ads-stats-in-charts.js
//This script will send you four simple charts per account.
//Clicks, Cost, Conversions, CostPerConversion for the past 28 days.
//or
//Clicks, Cost, AllConversions, CostPerAllConversion for the past 28 days.  
//Enter your email address where you want the emails to be sent:
var EMAIL_ADDRESS_TO_NOTIFY = "YOUREMAIL@EXAMPLE.COM";
//Enter the label for all the accounts you wish to analyze
var ACCOUNT_LABEL_TO_CHECK = "Monitor";
@nakitadog
nakitadog / snapengage-events.js
Created Sep 12, 2018
Used for tracking events from SnapEngage.
View snapengage-events.js
//https://developer.snapengage.com/javascript-api/
var seAgent;
var seType;
var seStatus;
window.dataLayer = window.dataLayer || [];
SnapEngage.setCallback('StartChat', function(agent, msg, type) {
//https://developer.snapengage.com/javascript-api/#startchat-event
@nakitadog
nakitadog / Check for ad groups with fewer than 2 ads.js
Last active Aug 23, 2018
Checks for AdWords ad groups with fewer than 2 ads per ad group
View Check for ad groups with fewer than 2 ads.js
var RECIPIENT_EMAIL = 'YOUR@EMAILADDRESS.COM';
var MAX_ACCOUNTS = 20;
var EMAIL_SUBJECT = "Checking for ad groups with fewer than 2 ads.";
function main() {
var accountSelector = MccApp.accounts();
accountSelector
.withLimit(MAX_ACCOUNTS)
.withCondition("LabelNames CONTAINS 'Monitor'")
@nakitadog
nakitadog / Automated ads by Google - Checked monitored accounts.js
Last active Aug 23, 2018
This script should be run daily to check all your client AdWords accounts within your MCC account for automated ads by Google.
View Automated ads by Google - Checked monitored accounts.js
var RECIPIENT_EMAIL = 'YOUR@EMAILADDRESS.com';
var MAX_ACCOUNTS = 20;
var EMAIL_SUBJECT = "Automated ads by Google - Checked monitored accounts";
function main() {
var accountSelector = MccApp.accounts();
accountSelector
.withLimit(MAX_ACCOUNTS)
.withCondition("LabelNames CONTAINS 'Monitor'")