Skip to content

Instantly share code, notes, and snippets.

View chipoglesby's full-sized avatar
🏠
Working from home

Chip Oglesby chipoglesby

🏠
Working from home
View GitHub Profile
function main() {
MccApp.accounts().withCondition("Cost > 1.00").forDateRange("YESTERDAY").withLimit(50).executeInParallel('runOnEachAccount', 'finished');
}
function runOnEachAccount() {
Logger.log('Starting on: '+AdWordsApp.currentAccount().getCustomerId());
var results = getAccountReport();
Logger.log(results);
return JSON.stringify(results);
}
/***********
* Collects the reporting results from all accounts
* and generates a nicely formatted email. If there
* are errors for an account, it includes those
* in the email as well since an error in one account
* won't stop the entire script.
***********/
function generateReport(results) {
var NOTIFY = ['your_email@example.com'];
var total_deleted = 0;
@chipoglesby
chipoglesby / Landing Page Contents Checker.js
Created December 17, 2015 19:58 — forked from BrainlabsDigital/Landing Page Contents Checker.js
Script to check landing pages for phrases like 'out of stock'
/**
*
* AdWords Script for checking the contents of landing pages.
* Goes to the final URL of keywords or ads, then searches the source code for
* user defined strings.
*
* Version: 1.0
* Google AdWords Script maintained by brainlabsdigital.com
*
**/
@chipoglesby
chipoglesby / bayesian_ab_test.py
Created December 17, 2015 20:09 — forked from stucchio/bayesian_ab_test.py
Bayesian A/B test code
from matplotlib import use
from pylab import *
from scipy.stats import beta, norm, uniform
from random import random
from numpy import *
import numpy as np
import os
# Input data
@chipoglesby
chipoglesby / GoogleMapsAndR.md
Last active April 18, 2016 18:46 — forked from josecarlosgonz/GoogleMapsAndR.md
How to use Google's API with R

Using Google Maps API and R

This script uses RCurl and RJSONIO to download data from Google's API to get the latitude, longitude, location type, and formatted address

library(RCurl)
library(RJSONIO)
library(plyr)
var DEBUG = 0;
function main() {
var spreadsheetName = "Bid Ranges";
var spreadsheetUrl = "";
var accountManagers = "";
var overWriteOldData = 1;
var sheetNames = ["Campaigns", "Keywords"];
// Granular Anomaly Detector Script
//
// Copyright 2016 - Optmyzr Inc - All Rights Reserved
// Visit www.optmyzr.com for more AdWords Scripts and PPC Management Tools and Reports
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
@chipoglesby
chipoglesby / v1.js
Created July 8, 2016 05:36 — forked from siliconvallaeys/v1.js
Set AdWords Budgets To Meet Monthly Targets With Day Of Week Allocation
// Copyright 2015, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@chipoglesby
chipoglesby / Ad Rotate Analysis.js
Created July 14, 2016 21:29 — forked from BrainlabsDigital/Ad Rotate Analysis.js
Script to find the best ad in each ad group, and find what performance you could have got if the losing ads' impressions had gone to the winner instead.
/**
*
* Ad Rotate Analysis
*
* This script finds the best ad in each ad group (subject to thresholds) and
* calculates the performance you could have got if the impressions that went to
* losing ads went to the winning ads instead.
*
* Version: 1.0
* Google AdWords Script maintained on brainlabsdigital.com
@chipoglesby
chipoglesby / slide_template.gs
Created November 15, 2016 15:32 — forked from mhawksey/slide_template.gs
Port of Wesley Chun's 'Using the Google Slides API with Python' to Google Apps Script. Read more at https://mashe.hawksey.info/?p=17385
// Port of Slides API demo by Wesley Chun to Google Apps Script
// Source: http://wescpy.blogspot.co.uk/2016/11/using-google-slides-api-with-python.html
function slides_template() {
/*
from apiclient import discovery
from httplib2 import Http
from oauth2client import file, client, tools
*/