[Webinar] A Non-Coders Guide to AdWords Scripts

Information about [Webinar] A Non-Coders Guide to AdWords Scripts

Published on October 12, 2015

Author: PI_Marketing

Source: slideshare.net

Content

1. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts A Non-Coders Guide to Adwords Scripts It’s not as intimidating as you thought! Point It Digital Marketing www.Pointit.com 06.17.2015

2. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts Housekeeping Slide Additional Q&A addressed and at the end of session A link to view a recorded version of the webinar will be emailed within 48 hours Raise your hand if you are having technical difficulties Hide the chat window Submit question via chat Toolbox Blog on the Point It Website

3. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts #PI_Scripts #AdWordsScripts @ChristiJOlson @SamuelDJames

4. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts About Point It Our Clients Our Services

5. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts Today’s Presenters 5 Christi Olson Point It Digital Marketing Director of SEM Samuel D. James Point It Digital Marketing Director of Analytics

6. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STRUCTURE BASIC CONCEPTS READING SCRIPTS EDITING SCRIPTS WHAT WE’LL BE TALKING ABOUT TODAY:

7. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts IS LIKE LEARNING A NEW LANGUAGE… STRUCTURE TERMINOLOGY BASIC RULES PRACTICE MAKES PERFECT

8. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SCRIPTS ENABLE YOU TO AUTOMATE ALL THE THINGS THAT CAN BE DONE MANUALLY IN ADWORDS

9. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SCRIPTS CAN MAKE CHANGES TO OR REPORT ON ANY ELEMENT OF AN ADWORDS ACCOUNT. ACCOUNT OR MCC LEVEL

10. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ANYTHING YOU CAN DO SCRIPTS CAN DO TOO “Annie Get Your Gun”

11. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SO WHY ARE SO MANY MARKETERS INTIMIDATED BY SCRIPTS?

12. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts THE UNKNOWN IS JAVASCRIPT. IT’S NOT PART OF THE AVERAGE SEM SKILL SET.

13. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts

14. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts

15. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts LET'S START WITH STRUCTURE

16. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts I LIKE COOKING MY FAMILY AND PETS

17. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts I LIKE COOKING, MY FAMILY, AND PETS. USE PROPER STYLE [PUNCTUATION] THE LIVES IT SAVES MIGHT BE YOUR FAMILY'S Google JavaScript Coding Style Guide: bit.ly/GoogleJavaScript

18. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts NOTEPAD++ bit.ly/Notepad-plusplus • OUTLINES CODE • MAKES IT EASIER TO SEE WHAT YOU ARE DOING

19. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SCRIPTS ARE CASE SENSITIVE AND NEED TO BE WRITTEN IN camelCase

20. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts // IS A SINGLE COMMENT LINE // 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 (DOUBLE SLASH)

21. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts /* SINGLE FORWARD SLASH + ASTERISK (SLASH) *Signifies comments that span multiple *lines. *Multiline comments end with */

22. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ALWAYS PREVIEW A SCRIPT BEFORE YOU RUN IT

23. @ChristiJOlson @SamuelDJames#PI_Scripts #[email protected] LET'S MOVE TO THE BASIC CONCEPTS

24. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts THE KEY ITEMS YOU NEED TO KNOW: • FUNCTIONS • OBJECTS (ELEMENTS) • ENTITIES • VARIABLES • METHODS • SELECTORS • ITERATORS

25. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } ANATOMY OF A BASIC SCRIPT FUNCTION SELECTORS ITERATOR + next METHODS VARIABLE, OBJECT, ENTITY LOGGER METHODS

26. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts FUNCTIONS PERFORM TASKS / PROCEDURES { } CURLY BRACKETS DEFINE THE BEGINNING & END OF A FUNCTION

27. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts OBJECTS -- COLLECTION OF “ENTITIES” AdWordsApp MccApp SpreadsheetApp UrlFetchApp ADWORDS ACCOUNT CONNECTS WITH SPREADSHEETS (FOR REPORTING) ACROSS YOUR MCC COMMUNICATES WITH OTHER SERVICES & APPLICATIONS

28. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ENTITIES – ELEMENT OR PROPERTY List of AdWords Entities: bit.ly/1aeDxby

29. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts VARIABLES (VAR) ARE USED TO NAME & STORE DATA WITHIN YOUR SCRIPTS variables are like a container to store “data”

30. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ESTABLISH YOUR OBJECT AND SELECT AN ENTITY TO QUERY var keywords = AdWordsApp.keywords() OBJECT NAMED VARIABLE ENTITY JOIN AN OBJECT AND ENTITY WITH A PERIOD

31. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts METHODS ARE HOW SCRIPTS INTERACT WITH OBJECTS • 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)

32. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts EXAMPLES OF METHODS get() getQualityScore() setDestinationURL() WHEN SETTING OR SPECIFYING A VALUES ENTER IT BETWEEN THE BRACKETS () SOME METHODS REQUIRE VALUES. MOST ARE LEFT BLANK ()

33. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SELECTORS REFINE THE LIST OF ENTITIES •withCondition() •withIds() •forDateRange() •withLimit() •orderBy()

34. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SELECTORS REFINE THE LIST OF ENTITIES AND CAN ORDER IT • 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

35. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ITERATORS RETURN THE NEXT ITEM • ITERATORS ARE LIKE AN ARRAY • PATTERN BASED SEARCH • COME AFTER SELECTORS hasNext() objectNext()

36. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts LOGGER OUTPUTS THE DATA TO A PREVIEW PANEL • HELP TROUBLESHOOT SCRIPTS • SLOWS PROCESSING TIME • RECOMMEND REMOVING AFTER DEBUGGING

37. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts LET'S TIE IT TOGETHER READING SCRIPTS

38. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts ANATOMY OF A BASIC SCRIPT function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } }

39. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } FUNCTION starts the script ANATOMY OF A BASIC SCRIPT

40. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getI mpressions()); } } VARIABLE named keywords OBJECT ENTITY ANATOMY OF A BASIC SCRIPT

41. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getIm pressions()); } } SELECTORS find keywords: • Enabled • Descending Order by Impression • Date = Yesterday • First 10 (by impression) ANATOMY OF A BASIC SCRIPT

42. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } METHODS gets keywords ANATOMY OF A BASIC SCRIPT

43. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } ITERATOR + next METHODS ANATOMY OF A BASIC SCRIPT

44. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } LOGGER outputs the data for preview ANATOMY OF A BASIC SCRIPT

45. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } closes out the function closes out the iterator ANATOMY OF A BASIC SCRIPT

46. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts function main() { var keywords = AdWordsApp.keywords() .withCondition(“Status = ‘ENABLED’”) .orderBy("Impressions DESC") .forDateRange("YESTERDAY") .withLimit(10) .get(); Logger.log("10 keywords with most impressions yesterday"); while (keywords.hasNext()) { var keyword = keywords.next(); Logger.log(keyword.getText() + ": " + keyword.getStatsFor("YESTERDAY").getImpressions()); } } ANATOMY OF A BASIC SCRIPT closes out the function FUNCTION starts the script closes out the iterator SELECTORS find keywords: • Enabled • Descending Order by Impression • Date = Yesterday • First 10 (by impression) ITERATOR + next METHODS VARIABLE ties ENTITY & OBJECT together LOGGER METHODS gets keywords

47. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts GET STARTED NOW WITH PRE-WRITTEN SCRIPTS

48. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts Adwords Developer Script Solutions bit.ly/ScriptSolutions

49. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts SCRIPTS YOU CAN USE NOW: • 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) Toolbox Blog on the Point It Website

50. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts RESOURCES AND PEOPLE TO FOLLOW: Optmyzr.com FreeAdwordsScripts.com @RussellSavage @SiliconVaelleys @ArmondHammer @BloomArty

51. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts LET'S GET COMFORTABLE WITH EDITING SCRIPTS

52. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STARTED W/ KEYWORD PERFORMANCE REPORT Wanted to add 2 additional data points: • Converted Clicks (CVR, CPA) • Conversion Value (ROAS)

53. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts EXISTINGS SCRIPT: KWD PERFORMANCE REPORT bit.ly/GG-QSkwdScript

54. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts DON’T FORGET TO UPDATE THE EMAIL/URL (VAR) • 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/cULxUX var SPREADSHEET_URL = 'https://docs.google.com/spreadsheet/ccc?key=abc123#gid=0';

55. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts GOAL: ADD ADDITIONAL DATA POINTS Wanted to add 2 additional data points: Converted Clicks (CVR, CPA) • Conversion Value (ROAS) stats.getConvertedClicks() worked stats.getConversionValue() kept giving me an error getConversionValue() is not available with stats it has to be pulled via a separate type of report 

56. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts THE OUTPUT WITH CONVERTED CLICKS Wanted to add 2 additional data points: • Converted Clicks (CVR, CPA) • Conversion Value (ROAS)

57. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts KEYWORD PERFORMANCE REPORT Added to the additional columns to Headers function outputQualityScoreData(sheet) { // Output header row var 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)

58. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts KEYWORD PERFORMANCE REPORT Added to the additional columns to Headers function outputQualityScoreData(sheet) { // Output header row var header = [ 'Quality Score', 'Num Keywords', 'Impressions', 'Clicks', 'CTR (%)', 'Cost', 'ConvertedClicks', ]; sheet.getRange(3, 2, 1, 7).setValues([header]); I added 1 columns Increase # of columns from 6 to 7 Check for multiple instances of arrays within the script!

59. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts KEYWORD PERFORMANCE REPORT Added to the additional getStats() // Compute data var 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

60. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts KEYWORD PERFORMANCE REPORT YAY, it worked! Now I’ve got to figure out how to speed up our account audit processes!

61. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts EVENTUALLY I WANT TO AUTOMATE AUDITING • 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

62. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts I LIKE THE ACCOUNT AUDIT SCRIPT BUT IT WASN’T THE FORMAT I WANTED

63. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts I WANTED AN XLS SPREADSHEET THAT COULD TRACK (AND MONITOR PROGRESS) FOR ALL CLIENT ACCOUNTS

64. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts BUT FOR NOW… USE THE ACCOUNT AUDIT SCRIPT AS A FRAMEWORK TO BUILD OUT THE MORE IN-DEPTH AUDIT

65. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 1: MAPPING OUT WHAT THE SCRIPT DID

66. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 2: ORGANIZE WHAT DATA WE NEED

67. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 3: BREAK DOWN THE EXISTING SCRIPT 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

68. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 4: CREATE REUSABLE PIECES OF CODE NESTING FUNCTIONS DECIDE ON THE ORDER OF THE FUNCTIONS AND PULLING DATA

69. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 4: CREATE REUSABLE PIECES OF CODE Create Header Rows within Spreadsheet Start with Campaigns (because ad groups are within campaigns) For Campaigns: Get Campaign Names Calculate total KWDs & Negative KWDs For Ad Groups Get Ad Group Names Calculate total KWDs & Negative KWDs Push everything to the Spreadsheet Log 1 row per Campaign/Ad Group with Totals

70. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 5: WRITE THE REUSABLE PIECES OF CODE http://bit.ly/PI-GetCMP http://bit.ly/PI-GetAG CAMPAIGN ITERATOR AD GROUP ITERATORS

71. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts bit.ly/PI-SpreadsheetScript STEP 5: WRITE THE REUSABLE PIECES OF CODE PREP THE SPREADSHEET

72. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 5: WRITE/EDIT CODE GET CAMPAIGN & AD GROUP DATA

73. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 5: WRITE/EDIT CODE CREATE & WRITE TO GOOGLE DOC

74. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts STEP 5: WRITE/EDIT CODE COUNT KEYWORDS BY MATCH TYPE This is the original code from the audit doc

75. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts bit.ly/PI-KWDauditSCRIPT STEP 6: PUT IT ALL TOGETHER QA THE FINISHED PRODUCT

76. @ChristiJOlson @SamuelDJames#PI_Scripts #AdWordsScripts Questions? Get in the Game: Social Advertising Video Platforms June 24th @ 11:00am Register at pointit.co/1HjrmrH A link to view a recorded version of the webinar will be emailed within 48 hours! NEXT WEBINAR: G

Related presentations


Other presentations created by PI_Marketing