Skip to content

Instantly share code, notes, and snippets.

View siliconvallaeys's full-sized avatar

Frederick Vallaeys siliconvallaeys

View GitHub Profile
/****************************
* Export an AdWords report to a Google Sheet and pivot on unique entities
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com and Optmyzr.com
* to support advanced use cases of the Optmyzr Rule Engine available at www.optmyzr.com
*
* v20211004: updated to reporting v201809
****************************/
/* Put Google Ads Data in Google Spreadsheet
* -----------------------------------------
*
* Script by Optmyzr.com
*
* v3 (20190702)
* - updated to API v201809
* v2 (20180810)
* - updated to newer reporting version in ads API
*
@siliconvallaeys
siliconvallaeys / Exclude Google Display Placements That Contain ...
Last active December 28, 2020 11:13
Automatically add negative placements for any new automatic GDN placements that include a particular piece of text
/****************************
* Add a Placement Exclusion When an Automatic Placement Contains the Text ...
* Version 1.0
*
* Created By: Frederick Vallaeys
* for FreeAdWordsScripts.com
* at the request of an Optmyzr.com subscriber
****************************/
function main() {
@siliconvallaeys
siliconvallaeys / Keyword or Product Group Spend Alerts
Created December 8, 2017 00:50
Get alerted when keywords or product groups are spending too much today with few conversions
function main() {
var currentSetting = new Object();
// what do you want to check?
currentSetting.entityToCheck = "product groups"; // valid options: keywords, product groups
// How much cost is allowed before we alert?
currentSetting.maxCost = 1;
// Fewer than how many conversions before we alert?
@siliconvallaeys
siliconvallaeys / AdWords Budgets By ZIP Code for Franchises
Last active January 14, 2020 03:19
AdWords Budgets By ZIP Code for Franchises
// Limit Monthly Cost By Postal Codes in a Campaign
//
// Copyright 2017 - Optmyzr Inc - All Rights Reserved
// Visit www.optmyzr.com for more AdWords Scripts and PPC Management Tools and Reports
//
//
// Purpose of the script:
// ---------------------
// To allow you to set a broad location target to capture more traffic in a regionwhile at the same time
// letting you limit the monthly cost for locations within the target region.
@siliconvallaeys
siliconvallaeys / Create Slide With AdWords Data
Last active December 31, 2022 21:55
Append a slide with AdWords data to a presentation
/*
// AdWords Script: Add a Slide with AdWords Data
// --------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script takes a Google Presentation as input and appends a slide with basic AdWords metrics.
// Use this to automate creating an appendix of AdWords data to existing PPC report slides.
// The AW data we append is basic but can easily be tweaked to your own needs.
//
// For more PPC management tools and reports, visit www.optmyzr.com
@siliconvallaeys
siliconvallaeys / Populate Sheets With AdWords Data.js
Last active August 4, 2022 09:14
Populate Google Sheet With Custom AdWords Data
/*
// AdWords Script: Put Data From AdWords Report In Google Sheets
// --------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script takes a Google spreadsheet as input. Based on the column headers, data filters, and date range specified
// on this sheet, it will generate different reports.
//
// The goal is to let users create custom automatic reports with AdWords data that they can then include in an automated reporting
// tool like the one offered by Optmyzr.
@siliconvallaeys
siliconvallaeys / Check account is serving ads.js
Last active June 29, 2023 06:58
Check Account Is Serving Ads
/*
OPTMYZR.COM - PPC AUTOMATION AND TOOLS
---------------------------------------
Script by Optmyzr Inc. 2016-2018
This script checks whether an AdWords account has gone offline, possibly due to a declined credit card.
It does this by checking if a selected metric (like impressions) has accrued some value over a chosen
number of hours. The user can choose the number of hours to look back so that they can account for
expected periods of non-activity (e.g. due to dayparting)
@siliconvallaeys
siliconvallaeys / Get Stats for YouTube Videos for TrueView Ads
Last active August 12, 2020 20:40
Append YouTube stats to a video placement report from AdWords to help identify videos to add as placement exclusions.
/*
// AdWords Script: Append YouTube Video Stats to Video Placement Report
// ---------------------------------------------------------------------
// Copyright 2017 Optmyzr Inc., All Rights Reserved
//
// This script adds YT statistics like 'likes,' 'dislikes,' 'comments,' etc to a Google Sheet of videos
// that your in-stream video ads have appeared on. You can then use these stats to determine when a video should
// be added as a negative placement, for example when there is too high a ratio of 'dislikes' to 'likes'.
//
// Thanks to Kris Belau from Firewood Marketing for presenting the concept at SMX West 2017.
@siliconvallaeys
siliconvallaeys / Aggregate Spreadsheet Data By Week or Month.js
Created March 16, 2017 18:00
This Google App Script will aggregate call data from CallRail on a Google Sheet. You can use Zapier to populate data about individual calls on a Google Sheet. Then use this code to aggregate the individual call data by week or month. You may need to edit the code to match your column headers.
var AGGREGATION_RANGE = "month";
function updateAggregateData() {
var dataSheetName = "Raw Data";
var reportSheetName = "For Reports";
var timeAggregatedData = new Array();
var answeredCalls = 0;
var notAnsweredCalls = 0;