Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Russ Savage russorat

👋
View GitHub Profile
View keyword_cleanup_main.js
function main() {
var config_options = {
'default' : {
metric : 'Conversions', // This metric will be used for determining duds
threshold : 0, // Duds are less than or equal to this threshold
days_ago : 90, // The timeframe of the data to consider, days ago to yesterday
days_in_limbo : 5 // The script will warn you for this many days before deleting something
}
// If you want, you can add account specific configurations too. If an account specific config
// is not found, the default one from above is used.
View account_level_qs.js
/************************************
* Store Account, Campaign, and AdGroup Level Quality Score
* Version 2.3
* ChangeLog v2.3
* - Solved #NUM! issue by filtering out -- values
* ChangeLog v2.2
* - Updated KeywordText to Criteria
* ChangeLog v2.1
* - Ignore negatives
* ChangeLog v2.0
@russorat
russorat / google_sheet_to_es_cluster.js
Last active Sep 1, 2015
This code is meant to be used on script.google.com in conjuction with a google spreadsheet. It will transform a set of rows and columns (with headers) into json documents and index them in an Elasticsearch cluster.
View google_sheet_to_es_cluster.js
// If you are running this from a spreadsheet, you can leave this blank and
// it will pick up the active spreadsheet. If you are running this from a
// new script.google.com project, you should put the url of the google sheet here.
var SPREADSHEET_URL = '';
var ES_HOST = {
host : '', // for found.io, something.loc.aws.found.io
port : 9243, // the port, usually 9200 or 9243
username : '',
password : '',
use_ssl : true // set to false to use http
@russorat
russorat / pause_and_enable_urls.js
Last active Aug 29, 2015
Example of http://www.freeadwordsscripts.com/2014/04/monitor-broken-links-using-mcc-level.html that will pause and enable keywords and ads. Might be very slow.
View pause_and_enable_urls.js
/******************************************
* Monitor Broken Links Using MCC Level Scripts
* Version 1.5-alt
* Changelog v1.5-alt
* - Added ability to pause and enable keywords/ads
* Changelog v1.4
* - Fixed INVALID_QUERY error
* Changelog v1.3
* - Added previous version of report api to script until
* I update my urls.
View updated_alpha_beta_kw_sync_script.js
/*******************************
* Automatically adds any new keywords in your
* Alpha campaigns as exact match negatives in
* the corresponding Beta campaign. Also handles
* pausing or removing keywords in your Alpha campaign
* and removing the corresponding negative in your Beta.
*******************************/
// Just as before, these strings will be
// used to identify your Alpha and Beta campaigns.
// This script assumes that your Alpha campaigns are
View impbcopy.m
#import <Foundation/Foundation.h>
#import <Cocoa/Cocoa.h>
#import <unistd.h>
BOOL copy_to_clipboard(NSString *path)
{
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage
NSImage * image;
if([path isEqualToString:@"-"])
{
// http://caiustheory.com/read-standard-input-using-objective-c
@russorat
russorat / mcc-ad-disaproval-reasons.js
Created May 30, 2014
This script will run through all your AdWords accounts and look for Ads that have been disapproved
View mcc-ad-disaproval-reasons.js
/********************************************************************************
* This script will run through all your AdWords accounts and look for Ads that
* have been disapproved
*
* @author Russell Savage <russellsavage@gmail.com>
* @version 1.0
* FreeAdWordsScripts.com
*
* THIS SOFTWARE IS PROVIDED BY Russell Savage ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@russorat
russorat / mcc-account-reporting.js
Created Apr 5, 2014
This script will run through all your AdWords accounts and store your data in a Google Spreadsheet.
View mcc-account-reporting.js
/********************************************************************************
* This script will run through all your AdWords accounts and store your data in
* a Google Spreadsheet.
*
* @author Russell Savage <russellsavage@gmail.com>
* @version 1.0
*
* THIS SOFTWARE IS PROVIDED BY Russell Savage ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
View AdWords_Scripts_Ad_Testing.js
/*********************************************
* Automated Creative Testing With Statistical Significance
* Version 2.1
* Changelog v2.1
*   - Fixed INVALID_PREDICATE_ENUM_VALUE
* Changelog v2.0
*   - Fixed bug in setting the correct date
*   - Script now uses a minimum visitors threshold
*        per Ad instead of AdGroup
*   - Added the ability to add the start date as a label to AdGroups
@russorat
russorat / gist:7446125
Created Nov 13, 2013
AdWords Script to check sitelinks
View gist:7446125
function main() {
Logger.log('AdWordsApp.extensions().sitelinks() list.');
logSitelinks(AdWordsApp);
Logger.log('Campaign and AdGroup list.');
var campIter = AdWordsApp.campaigns().get();
while(campIter.hasNext()) {
var camp = campIter.next();
logSitelinks(camp);
var agIter = camp.adGroups().get();