Skip to content

Instantly share code, notes, and snippets.

<?php
$response = get_total_active_subscribers_for_tag();
if ($response <> null and $response <> -1) {
echo "\n\nTotal Subscribers for tag = " . $response;
} else {
//There were errors from the server
}
//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.
//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
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);
}
//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
Last active January 7, 2022 17:40
Used for tracking events from SnapEngage.
// For tracking Snap Engage Events in the Google Tag Manager GTM
// Within GTM you'll need to setup the following dataLayer variables to help capture these events:
// SnapEngage_eventCategory
// SnapEngage_eventAction
// SnapEngage_eventLabel
// https://developer.snapengage.com/javascript-api/
var seAgent;
var seType;
var seStatus;
@nakitadog
nakitadog / Check for ad groups with fewer than 2 ads.js
Last active August 23, 2018 10:14
Checks for AdWords ad groups with fewer than 2 ads per ad group
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 August 23, 2018 10:14
This script should be run daily to check all your client AdWords accounts within your MCC account for automated ads by Google.
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'")