Top Banner
Christi Olson | @christijolson Director of SEM | PointIt.com A Non-Coders Guide to AdWords Scripts It’s not as intimidating as you have thought! Steve Hammer | @armondhammer Founder | RankHammer.com
98

PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

Jul 16, 2015

Download

Marketing

Christi Olson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

Christi Olson | @christijolson

Director of SEM | PointIt.com

A Non-Coders Guide to AdWords ScriptsIt’s not as intimidating as you have thought!

Steve Hammer | @armondhammer

Founder | RankHammer.com

Page 2: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ABOUT CHRISTI

@ar

mo

nd

ham

mer

#Her

oC

on

f

FUR BABIESFAMILY!RUN & CROSSFIT

POINT IT

Seattle Based Digital Marketing Agency

Page 3: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ABOUT STEVE

@ar

mo

nd

ham

mer

#Her

oC

on

f

FAMILYWhat it’s all about

FOOD AND

WINE

Eating as an art form?

HOCKEYGo Stars

RANKHAMMER

Dallas Based Internet Marketing Agency

Page 4: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

IT’S LIKE LEARNING A NEW LANGUAGE…

Structure TerminologyBasic rules

practice makes perfect

Page 5: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SCRIPTS ENABLE YOU TO

AUTOMATE all the things

THAT CAN BE DONE MANULLY IN ADWORDS

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 6: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

Scripts can

MAKE CHANGES TO or REPORT ON

any element of an AdWords account.

Account or MCC LEVEL

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 7: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

Anything you can do scripts can do too

“Annie Get Your Gun”

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 8: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

So why are so many marketers

intimidated by scripts?

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 9: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

THE

UNKNOWNIS JAVASCRIPT.

It’s not part of the average SEM skill set.

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 10: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 11: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 12: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

XLS VS JAVASCRIPT: CALCULATE CPA

JavaScript Formula:var D2 = 14539; var F2 = 254;

var calculate-cpa = (D2/F2);

return (calculate-cpa );

XLS Formula:where cells:D2 = $14,539F2 = 254

=D2/F2

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 13: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECT Data

FROM reference table

WHERE filter conditions

GROUP BY

aggregation

LIMIT # of records

SIMILAR TO JAVA, JUST A DIFFERENT LANGUAGE ENTITIES

OBJECTS

SELECTORS

LIMIT

Page 14: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

LET'S START WITH SOME

STRUCTURE

Page 15: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

NOTEPAD++ bit.ly/Notepad-plusplus

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• Outlines code

• Makes it easier to see what you are doing

Page 16: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

I LIKE COOKING MY FAMILY AND PETS

Use proper PUNCTUATION and STYLEthe lives it saves might be your family's

STYLE MATTERS WITH CODING

Page 17: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SCRIPTS ARE CASE SENSITIVE AND NEED TO BE WRITTEN IN camelCase

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 18: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

/* SINGLE FORWARD SLASH + ASTRIX*SIGNIFIES COMMENTS THAT SPAN MULTIPLE

LINES. *MULTI LINE COMMENTS END WITH */

(SLASH)

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 19: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

// IS A SINGLE COMMENT LINE IN JAVASCRIPT

// comments can start anywhere in a line and javascript will skip to the end of the line// add as many or as few comments to your code explaining what it does

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 20: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Spaces are only

Important

Inside “”

Page 21: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf Always

PREVIEW a script before

you run it

Page 22: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

LET'S START WITH SOME

Building Blocks

Page 23: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

YOU CAN DO THIS

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 24: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

BREAK IT APART

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 25: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

AND MAKE SOMETHING AMAZING

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 26: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

STARTING SIMPLE, BUT COOL

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 27: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WORST SCRIPT EVER

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 28: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WORST SCRIPT EVER

The central program

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 29: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WORST SCRIPT EVER

A defined method

Selector

Iterator

} End

Begin {

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 30: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

LOGGER

Bulk Operations >Logs>

Details>Logs>

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 31: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTOR

Makes an array of the typeFiltered by conditions

Finished with get();

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 32: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTOR

Conditions are ANDConnect with .

End with ;

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 33: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

VARIABLES

Discreet

•5.23

•‘Office’

• 5+3

• ‘Today’ + variable

Arrays

• [4, 5, 7, 9]

•[‘Home’,’Office’,’Hotel’]

Objects

•{name:’Steve’,zip:75204,car:’Subaru’}

• {1:Array1,2:Array2}

Page 34: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ODD SELECTOR LOGIC

Values have to become strings

@ar

mo

nd

ham

mer

Page 35: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ODD SELECTOR LOGIC

To make it flexible it has to be:“Column Operator” + Value

'Name = "' + var + '"'

@ar

mo

nd

ham

mer

Page 36: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTABLE?

https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_adselector

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 37: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTOR

Get all keywordsWith a CTR greater than 0.01

For all time

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 38: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WE NOW HAVE

Selected every keywordThat has everGotten a click

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 39: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ITERATOR

What does the work

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 40: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WHILE NEXT

Sets up the repeating

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 41: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

PAYLOAD

Calls a method to make a change @ar

mo

nd

ham

mer

#Her

oC

on

f

Page 42: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

AVAILABLE METHODS

https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_ad

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 43: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ITERATOR

Find the maximum CPCAdd 1%

Set as new Max CPC

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 44: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

WORST SCRIPT EVER

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 45: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

CHANGE IT

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 46: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

NEXT LEVEL

Prewritten Scripts

+

Code Snippets

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 47: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

TYPICAL CODE ARCHITECTURE

Global Variables – Used by all

Other Functions

Main Function

Local Variables

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 48: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

DEFINING A FUNCTION

Functions can return values to feed a variable

Functions can also just be invoked, even without parameters

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 49: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

MULTIPLE FUNCTIONS

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 50: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SNIPPETS

https://developers.google.com/adwords/scripts/docs/examples/

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 51: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SCRIPT SOLUTIONS

bit.ly/ScriptSolutions

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 52: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

NOT EXACTLY READY TO USE

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 53: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

TWEAK THE SELECTOR

Page 54: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

MORE JAVASCRIPT LESSONS

http://www.codecademy.com/tracks/javascripthttp://www.w3schools.com/js/default.asp

http://www.learn-js.org/

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 55: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

EDITOR = DEBUGGER

OR

@ar

mo

nd

ham

mer

#Her

oC

on

f

Page 56: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

REJOICE

@ar

mo

nd

ham

mer

Page 57: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

LET’S GET STARTED NOW WITH

PRE-WRITTEN SCRIPTS

Page 58: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

SCRIPTS YOU CAN USE NOW:

bit.ly/ScriptsToUse

•Campaign & Keyword Performance Report, Written by Russ Savage

• Quality Score Tracker, Written by Martin Roettgerding

• Keyword Performance by QS & Position, Written by Google Developers

• Anomaly Detector, Written by Google Developers

• Broken URL Checker, Written by Google Developers & Russ Savage (FreeAdwordsScripts.com)

• Account Audit, Written by Russ Savage (FreeAdwordsScripts.com)

• Search Query Manager, Written by Marcela De Vivo (Gryffin.com)

Page 59: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

RANKHAMMERS LIST OF AVAILABLE SCRIPTS:

bit.ly/1Ho3LFi

90+ Scripts in an XLS document

Page 60: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

SCRIPTS RESOURCES:

Optmyzr.com

FreeAdwordsScripts.com

▪ @RussellSavage

▪ @SiliconVallaeys

▪ @ArmondHammer

▪ @MarcelaDeVivo

▪ @BloomArty

▪ @SamuelDJames

Page 61: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

LET'S GET COMFORTABLE WITH

EDITING SCRIPTS

Page 62: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

START W/ SOMETHING BASICKEYWORD PERFORMANCE REPORT

Page 63: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORTWanted to add 2 additional data points:Converted Clicks (CVR, CPA)• Conversion Value (ROAS)

stats.getConvertedClicks() workedstats.getConversionValue() kept giving me an error

getConversionValue() is not available with statsit has to be pulled via a separate type of report

Page 64: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORTUpdated to include Converted Clicks• Converted Clicks (CVR, CPA)• Conversion Value (ROAS)

Page 65: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• RECIPIENT_EMAIL• your email address

• SPREADSHEET_URL• URL for the Google Spreadsheet

// Comma-separated list of recipients. Comment out to not send any emails.var RECIPIENT_EMAIL = '[email protected]';

// URL of the default spreadsheet template. This should be a copy of http://goo.gl/cULxUXvar SPREADSHEET_URL = 'https://docs.google.com/spreadsheet/ccc?key=abc123#gid=0';

DON’T FORGET: UPDATE EMAIL/ URL (VAR)

Page 66: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORT

Added to the additional columns to Headers

function outputQualityScoreData(sheet) {// Output header rowvar header = ['Quality Score','Num Keywords','Impressions','Clicks','CTR (%)','Cost','ConvertedClicks',

];sheet.getRange(3, 2, 1, 7).setValues([header]);

This is an ARRAY In this context it let you update specific data within a spreadsheet. You’re telling it where!getRange = (row to start on,

column to start on, number of rows to include,number of columns to include)

Page 67: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORT

Added to the additional columns to Headers

function outputQualityScoreData(sheet) {// Output header rowvar header = ['Quality Score','Num Keywords','Impressions','Clicks','CTR (%)','Cost','ConvertedClicks',

];sheet.getRange(3, 2, 1, 7).setValues([header]);

I added 1 columnsIncrease # of columns from 6 to 7

Check for multiple instances of arrays within the script!

Page 68: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORT

Added to the additional getStats()

// Compute datavar keywordIterator = AdWordsApp.keywords()

.forDateRange('LAST_WEEK')

.withCondition('Impressions > 0')

.get();while (keywordIterator.hasNext()) {var keyword = keywordIterator.next();var stats = keyword.getStatsFor('LAST_WEEK');var data = qualityScoreMap[keyword.getQualityScore()];if (data) {data.numKeywords++;data.totalImpressions += stats.getImpressions();data.totalClicks += stats.getClicks();data.totalCost += stats.getCost();data.totalConvertedClicks =+ stats.getConvertedClicks();

}}

this pulls in the total converted clicks into the column

Page 69: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

KEYWORD PERFORMANCE REPORT

YAY, it worked!Now I’ve got to figure out how to speed up our account audit processes!

Page 70: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

GOAL: AUTOMATE AUDITING PROCESSES

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• Account set-up & settings

• SE Linked accounts audit

My Business / Local

Merchant Center

Google Analytics

Webmaster Tools

• Conversion tracking audit

• Goals & Events review

• Remarketing Audiences

• Shopping set-up

• Dynamic Search set-up

• Campaign settings & targeting

• Network settings & targeting

• Display settings & targeting

• Day Parting analysis

• Geo Targeting analysis

• Bid-modifier analysis

• Device Targeting analysis

• Ad delivery & rotation settings

• Ad extension audit

• Landing Page audit/analysis

• Campaign architecture

• Quality Score analysis

• Impression share analysis

• Keyword audit

• Negative keyword audit

• Match type audit

• Ad copy audit

• Display / Destination URL audit

• Missed Opportunity audit

• Performance audit

Page 71: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

I LIKE THE ACCOUNT AUDIT SCRIPT

BUT… it wasn’t the format I wanted

Page 72: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

I WANTED AN XLS SPREADSHEET

THAT WE COULD TRACK (AND MONITOR PROGRESS)

FOR ALL CLIENT ACCOUNTS

Page 73: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

But for now…

Use the account audit script as a

frameworkto build out the more in-depth

audit

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

Page 74: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 1: MAP THE SCRIPT

Why? To document what & where

Page 75: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 2: ORGANIZE DATA

Page 76: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 3: BREAK IT INTO BITE SIZED PIECES

1. Campaign & Ad Group Names

2. # of Keywords by Match Type & Negative

3. Location Targeting Audit

4. Extensions Audit

5. Budget Audit

Page 77: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 4: CREATE REUSABLE CODE

Create Header Rows within Spreadsheet

Start with Campaigns (because ad groups are within campaigns)

For Campaigns:Get Campaign NamesCalculate total KWDs & Negative KWDs

For Ad GroupsGet Ad Group NamesCalculate total KWDs & Negative KWDs

Push everything to the SpreadsheetLog 1 row per Campaign/Ad Group with Totals

Page 78: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 4:WRITE REUSABLE CODECAMPAIGN & AD GROUP ITERATORS

http://bit.ly/PI-GetCMP http://bit.ly/PI-GetAG

Page 79: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 4:WRITE REUSABLE CODECREATE & PUSH TO SPREADSHEET

bit.ly/PI-SpreadsheetScript

Page 80: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 5: WRITE/EDIT CODE CAMPAIGN & AD GROUP DATA

Page 81: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 5: WRITE/EDIT CODE CREATE & WRITE TO GOOGLE DOC

Page 82: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

STEP 5: WRITE/EDIT CODE COUNT KEYWORDS BY MATCH TYPE

This is the original code from the audit doc

Page 83: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

THE FINISHED PRODUCT – PART 1

bit.ly/PI-KWDauditSCRIPT

Page 84: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

CONNECT WITH US

SOCIAL NETWORKS

Rank Hammer

Downtown Dallas TX

214-720-0044

POINT IT

Downtown Seattle WA

206-673-3064

LOCATED

[email protected]

[email protected]

QUESTIONS

TWITTER

WEBSITE

LINKEDIN

@armondhammer@rankhammer@ChristiJOlson@point_it

rankhammer.compointit.com

linkedin.com/a/armondhammerlinkedin.com/in/ChristiJOlson

Page 85: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

THANK YOU

Page 86: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

APPENDIXAKA… WE HAD TOO MANY SLIDES TO SHOW YOU!

Page 87: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

THE BASICS YOU NEED TO KNOW:

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

OBJECTS……..… reference table

ENTITIES………. what your looking for

FUNCTIONS….. what the script is doing / formula

VARIABLES……. elements/items

METHODS……. how

SELECTORS..…. filters / refine results

ITERATORS…... find the next item (until there are no more)

LOGGERS…….. print the results

Page 88: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

OBJECTS COLLECTION OF “ENTITIES”

AdWordsApp MccApp

SpreadsheetApp UrlFetchApp

ADWORDSACCOUNT

CONNECTS WITH SPREADSHEETS

(FOR REPORTING)

ACROSS YOUR MCC

COMMUNICATES WITH OTHER SERVICES &

APPLICATIONS

Page 89: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ENTITIES – ELEMENT/PROPERTY

List of

AdWords Entities:

bit.ly/1aeDxby

Page 90: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

FUNCTIONS PERFORM TASKS / PROCEDURES

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

{ } Curly Brackets define

the beginning & End of a Function

Page 91: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

VARIABLES (VAR) NAME & STORE DATA WITHIN SCRIPTS

Variable are like a container to store “data”

Page 92: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

ESTABLISH AN OBJECT AND SELECT AN ENTITY TO QUERY

var keywords = AdWordsApp.keywords()

ObjectNamed Variable Entity

Join an object and entity with a PERIOD

Page 93: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

METHODS ARE HOW SCRIPTS INTERACT WITH OBJECTS

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• retrieve information about an object (what it is)

• ask an object about itself (what campaign a kwd is in)

• tell the object to do something (change status)

Page 94: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

EXAMPLES OF METHODS

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

getMaxCpc()

getQualityScore()

setDestinationURL()

when setting or specifying a values enter it between the brackets ()

some methods require values.

most are left blank ()

Page 95: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTORS REFINE THE LIST OF ENTITIES

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• withCondition()

•withIds()

•forDateRange()

•orderBy()

•withLimit()

Page 96: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

SELECTORS REFINE THE LIST OF ENTITIESAND CAN ORDER IT

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

•withCondition()(‘Entity > N’); Greater than

(‘Entity <N’); Less than

• forDateRange()forDateRange(‘YESTERDAY’);

forDateRange(‘LAST_14_DAYS’);

•orderBy()(‘Entity ASC’); Ascending Order

(‘Entity DESC’); Descending Order

Page 97: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

ITERATORS RETURN THE NEXT ITEM

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

• like an array

• pattern based search

• come after selectors

hasNext()

objectNext()

Page 98: PPC HERO Introduction to AdWords Scripts: Christi Olson & Steve Hammer

LOGGER OUTPUTS THE DATA TO A PREVIEW PANEL

@C

hri

stiJ

Ols

on

#H

ero

Co

nf

•great for troubleshooting

• slows processing time

• recommend removing after debugging