Skip to content

Instantly share code, notes, and snippets.

View derekmartinla's full-sized avatar

Derek Martin derekmartinla

View GitHub Profile
@derekmartinla
derekmartinla / gist:c660f7d326a04e2d418e
Created April 9, 2015 16:20
Ad-Group Callout Extension Example
// Set callout extensions on the ad group level for all active ad groups based on text sent in createCallouts()
// Change campaign selection criteria as needed
function main() {
campIter = AdWordsApp.campaigns().withCondition("CampaignName contains Brand").withCondition("CampaignName does_not_contain Remarketing").get();
var callouts = createCallouts();
while (campIter.hasNext()) {
camp = campIter.next();
@derekmartinla
derekmartinla / gist:46bbbcd2e800111fd46f
Last active November 24, 2016 16:09
Copy Existing AdWords Ads With A New Destination URL
function main() {
// change the CampaignName condition to whatever suits you
var adIter = AdWordsApp.ads().withCondition("CampaignName contains WP").withCondition("Status = ENABLED").get();
while(adIter.hasNext()) {
var ad = adIter.next();
var headline = ad.getHeadline();
var d1 = ad.getDescription1()
var d2 = ad.getDescription2();
function main() {
var kwIter = AdWordsApp.keywords().withCondition("Text CONTAINS '2016'").get();
while (kwIter.hasNext()) {
var keyword = kwIter.next();
// create new keyword
keyword.getAdGroup().newKeywordBuilder()
.withText(keyword.getText().replace("2016", "2017"))
.withCpc(keyword.bidding().getCpc())
@derekmartinla
derekmartinla / gist:b719840542406322bb27
Last active June 2, 2017 14:20
AdWords Countdown Ads Updater Script
/***************************************************************************************
* AdWords Countdown Ad Updater -- Find stale countdown ads and replace them with
* Ads that are updated with new dates.
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
****************************************************************************************/
var DESCRIPTION2_TEXT = "Sale Ends In"
/**********************************************************************************************************************
* Keyword Generator Tool
* Leverages Autocomplete to find potential keyword opportunities and negative keywords,
* Version 1.2
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
**********************************************************************************************************************/
'use strict';
String.prototype.capitalize = function() {
@derekmartinla
derekmartinla / autocomplete.js
Created April 20, 2017 05:19
Find keywords to include in your SEM or SEO campaigns
/**********************************************************************************************************************
* Keyword Generator Tool
* Leverages Autocomplete to find potential keyword opportunities and negative keywords,
* Version 1.2
* Created By: Derek Martin
* DerekMartinLA.com or MixedMarketingArtist.com
**********************************************************************************************************************/
'use strict';
String.prototype.capitalize = function() {

Chapter 2 - The Absolute Minimum JavaScript You Need To Know

Introduction

This chapter introduces the JavaScript language in the most efficient way possible. We'll explore the basics of JavaScript syntax, statements, variables, data structures, data types, functions, decision logic, regular expressions, and finish the tour by introducing the JavaScript Object.

Ground Rules

It's important to note that the goal of this chapter is not to make you an expert in JavaScript (or JS for short). Such a goal would be unbecoming of a language that is as rich and complex as JavaScript. Rather, the goal is to give you just enough knowledge so that you can painlessly follow the rest of the book. Below are several great books for those who would like to grow their JavaScript knowledge:

@derekmartinla
derekmartinla / elite-404-checker
Last active April 24, 2019 07:36
Elite Adwords Destination Url 404 Checker
var email_address = 'derek@wpromote.com';
function main() {
var urlList = runUrlReport();
urlList = _.uniq(urlList, function(item, key, url) {
return item.url;
});
var listOfBrokenUrls = [];
@derekmartinla
derekmartinla / search-queries-in-google-docs
Last active February 17, 2020 00:09
Perform Search Query Analysis In One Google Doc
/**********************************************************************************************
* AdWords Account Management -- Review Search Queries & Post Adjustments via Google Docs.
* Version 1.0
* Created By: Derek Martin
* DerekMartinLA.com & MixedMarketingArtist.com
*********************************************************************************************/
var GOOGLE_DOC_URL = "put your url here";
var START_DATE = '20150401';
var END_DATE = '20150415';
@derekmartinla
derekmartinla / gclid-tracker
Last active May 13, 2020 11:14
Track Adwords Gclid Ids
var GOOGLE_DOC_URL = "URL";
function main() {
clicks = runCampaignReport();
modifySpreadSheet(clicks);
}
function runCampaignReport() {