Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

1,669 views

Published on

Open your eyes to adwords scripts. Scripts now offer a number of resources to source pre-written concepts. But what if the example doesn't exactly fit the specifics of what you are looking for? In this PPC Hero Conference Session we're going to walk you through where to look and what changes you can make to open up the basic scripts. This talk will cover a powerful strategy of taking a pre-written script and an automation concept and tweak it for your own purposes.

Published in: Marketing
  • Be the first to comment

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

  1. 1. 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
  2. 2. ABOUT CHRISTI @armondhammer#HeroConf FUR BABIESFAMILY!RUN & CROSSFIT POINT IT Seattle Based Digital Marketing Agency
  3. 3. ABOUT STEVE @armondhammer#HeroConf FAMILY What it’s all about FOOD AND WINE Eating as an art form? HOCKEY Go Stars RANKHAMMER Dallas Based Internet Marketing Agency
  4. 4. @ChristiJOlson#HeroConf IT’S LIKE LEARNING A NEW LANGUAGE… Structure Terminology Basic rules practice makes perfect
  5. 5. SCRIPTS ENABLE YOU TO AUTOMATE all the things THAT CAN BE DONE MANULLY IN ADWORDS @ChristiJOlson#HeroConf
  6. 6. Scripts can MAKE CHANGES TO or REPORT ON any element of an AdWords account. Account or MCC LEVEL @ChristiJOlson#HeroConf
  7. 7. Anything you can do scripts can do too “Annie Get Your Gun” @ChristiJOlson#HeroConf
  8. 8. So why are so many marketers intimidated by scripts? @ChristiJOlson#HeroConf
  9. 9. THE UNKNOWN IS JAVASCRIPT. It’s not part of the average SEM skill set. @ChristiJOlson#HeroConf
  10. 10. @ChristiJOlson#HeroConf
  11. 11. @ChristiJOlson#HeroConf
  12. 12. 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,539 F2 = 254 =D2/F2 @ChristiJOlson#HeroConf
  13. 13. 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
  14. 14. @ChristiJOlson#HeroConf LET'S START WITH SOME STRUCTURE
  15. 15. NOTEPAD++ bit.ly/Notepad-plusplus @ChristiJOlson#HeroConf • Outlines code • Makes it easier to see what you are doing
  16. 16. @ChristiJOlson#HeroConf I LIKE COOKING MY FAMILY AND PETS Use proper PUNCTUATION and STYLE the lives it saves might be your family's STYLE MATTERS WITH CODING
  17. 17. SCRIPTS ARE CASE SENSITIVE AND NEED TO BE WRITTEN IN camelCase @ChristiJOlson#HeroConf
  18. 18. /* SINGLE FORWARD SLASH + ASTRIX *SIGNIFIES COMMENTS THAT SPAN MULTIPLE LINES. *MULTI LINE COMMENTS END WITH */ (SLASH) @ChristiJOlson#HeroConf
  19. 19. // 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 @ChristiJOlson#HeroConf
  20. 20. @ChristiJOlson#HeroConf Spaces are only Important Inside “”
  21. 21. @ChristiJOlson#HeroConf Always PREVIEW a script before you run it
  22. 22. @ChristiJOlson#HeroConf LET'S START WITH SOME Building Blocks
  23. 23. YOU CAN DO THIS @armondhammer#HeroConf
  24. 24. BREAK IT APART @armondhammer#HeroConf
  25. 25. AND MAKE SOMETHING AMAZING @armondhammer#HeroConf
  26. 26. STARTING SIMPLE, BUT COOL @armondhammer#HeroConf
  27. 27. WORST SCRIPT EVER @armondhammer#HeroConf
  28. 28. WORST SCRIPT EVER The central program @armondhammer#HeroConf
  29. 29. WORST SCRIPT EVER A defined method Selector Iterator } End Begin { @armondhammer#HeroConf
  30. 30. LOGGER Bulk Operations > Logs> Details> Logs> @armondhammer#HeroConf
  31. 31. SELECTOR Makes an array of the type Filtered by conditions Finished with get(); @armondhammer#HeroConf
  32. 32. SELECTOR Conditions are AND Connect with . End with ; @armondhammer#HeroConf
  33. 33. 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}
  34. 34. ODD SELECTOR LOGIC Values have to become strings @armondhammer
  35. 35. ODD SELECTOR LOGIC To make it flexible it has to be: “Column Operator” + Value 'Name = "' + var + '"' @armondhammer
  36. 36. SELECTABLE? https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_adselector @armondhammer#HeroConf
  37. 37. SELECTOR Get all keywords With a CTR greater than 0.01 For all time @armondhammer#HeroConf
  38. 38. WE NOW HAVE Selected every keyword That has ever Gotten a click @armondhammer#HeroConf
  39. 39. ITERATOR What does the work @armondhammer#HeroConf
  40. 40. WHILE NEXT Sets up the repeating @armondhammer#HeroConf
  41. 41. PAYLOAD Calls a method to make a change @armondhammer#HeroConf
  42. 42. AVAILABLE METHODS https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_ad @armondhammer#HeroConf
  43. 43. ITERATOR Find the maximum CPC Add 1% Set as new Max CPC @armondhammer#HeroConf
  44. 44. WORST SCRIPT EVER @armondhammer#HeroConf
  45. 45. CHANGE IT @armondhammer#HeroConf
  46. 46. NEXT LEVEL Prewritten Scripts + Code Snippets @armondhammer#HeroConf
  47. 47. TYPICAL CODE ARCHITECTURE Global Variables – Used by all Other Functions Main Function Local Variables @armondhammer#HeroConf
  48. 48. DEFINING A FUNCTION Functions can return values to feed a variable Functions can also just be invoked, even without parameters @armondhammer#HeroConf
  49. 49. MULTIPLE FUNCTIONS @armondhammer#HeroConf
  50. 50. SNIPPETS https://developers.google.com/adwords/scripts/docs/examples/ @armondhammer#HeroConf
  51. 51. SCRIPT SOLUTIONS bit.ly/ScriptSolutions @armondhammer#HeroConf
  52. 52. NOT EXACTLY READY TO USE @armondhammer#HeroConf
  53. 53. TWEAK THE SELECTOR
  54. 54. MORE JAVASCRIPT LESSONS http://www.codecademy.com/tracks/javascripthttp://www.w3schools.com/js/default.asp http://www.learn-js.org/ @armondhammer#HeroConf
  55. 55. EDITOR = DEBUGGER OR @armondhammer#HeroConf
  56. 56. REJOICE @armondhammer
  57. 57. @ChristiJOlson#HeroConf LET’S GET STARTED NOW WITH PRE-WRITTEN SCRIPTS
  58. 58. @ChristiJOlson#HeroConf 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)
  59. 59. @ChristiJOlson#HeroConf RANKHAMMERS LIST OF AVAILABLE SCRIPTS: bit.ly/1Ho3LFi 90+ Scripts in an XLS document
  60. 60. @ChristiJOlson#HeroConf SCRIPTS RESOURCES: Optmyzr.com FreeAdwordsScripts.com ▪ @RussellSavage ▪ @SiliconVallaeys ▪ @ArmondHammer ▪ @MarcelaDeVivo ▪ @BloomArty ▪ @SamuelDJames
  61. 61. @ChristiJOlson#HeroConf LET'S GET COMFORTABLE WITH EDITING SCRIPTS
  62. 62. @ChristiJOlson#HeroConf START W/ SOMETHING BASIC KEYWORD PERFORMANCE REPORT
  63. 63. @ChristiJOlson#HeroConf KEYWORD PERFORMANCE REPORT 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 
  64. 64. @ChristiJOlson#HeroConf KEYWORD PERFORMANCE REPORT Updated to include Converted Clicks • Converted Clicks (CVR, CPA) • Conversion Value (ROAS)
  65. 65. @ChristiJOlson#HeroConf • 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 = 'christio@pointit.com'; // 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'; DON’T FORGET: UPDATE EMAIL/ URL (VAR)
  66. 66. @ChristiJOlson#HeroConf 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)
  67. 67. @ChristiJOlson#HeroConf 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!
  68. 68. @ChristiJOlson#HeroConf 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
  69. 69. @ChristiJOlson#HeroConf KEYWORD PERFORMANCE REPORT YAY, it worked! Now I’ve got to figure out how to speed up our account audit processes!
  70. 70. GOAL: AUTOMATE AUDITING PROCESSES @ChristiJOlson#HeroConf • 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
  71. 71. @ChristiJOlson#HeroConf I LIKE THE ACCOUNT AUDIT SCRIPT BUT… it wasn’t the format I wanted
  72. 72. @ChristiJOlson#HeroConf I WANTED AN XLS SPREADSHEET THAT WE COULD TRACK (AND MONITOR PROGRESS) FOR ALL CLIENT ACCOUNTS
  73. 73. But for now… Use the account audit script as a framework to build out the more in-depth audit @ChristiJOlson#HeroConf
  74. 74. @ChristiJOlson#HeroConf STEP 1: MAP THE SCRIPT Why? To document what & where
  75. 75. @ChristiJOlson#HeroConf STEP 2: ORGANIZE DATA
  76. 76. @ChristiJOlson#HeroConf 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
  77. 77. @ChristiJOlson#HeroConf STEP 4: CREATE REUSABLE 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
  78. 78. @ChristiJOlson#HeroConf STEP 4:WRITE REUSABLE CODE CAMPAIGN & AD GROUP ITERATORS http://bit.ly/PI-GetCMP http://bit.ly/PI-GetAG
  79. 79. @ChristiJOlson#HeroConf STEP 4:WRITE REUSABLE CODE CREATE & PUSH TO SPREADSHEET bit.ly/PI-SpreadsheetScript
  80. 80. @ChristiJOlson#HeroConf STEP 5: WRITE/EDIT CODE CAMPAIGN & AD GROUP DATA
  81. 81. @ChristiJOlson#HeroConf STEP 5: WRITE/EDIT CODE CREATE & WRITE TO GOOGLE DOC
  82. 82. @ChristiJOlson#HeroConf STEP 5: WRITE/EDIT CODE COUNT KEYWORDS BY MATCH TYPE This is the original code from the audit doc
  83. 83. @ChristiJOlson#HeroConf THE FINISHED PRODUCT – PART 1 bit.ly/PI-KWDauditSCRIPT
  84. 84. CONNECT WITH US SOCIAL NETWORKS Rank Hammer Downtown Dallas TX 214-720-0044 POINT IT Downtown Seattle WA 206-673-3064 LOCATED support@rankhammer.com info@pointit.com QUESTIONS TWITTER WEBSITE LINKEDIN @armondhammer @rankhammer @ChristiJOlson @point_it rankhammer.com pointit.com linkedin.com/a/armondhammer linkedin.com/in/ChristiJOlson
  85. 85. THANK YOU
  86. 86. APPENDIX AKA… WE HAD TOO MANY SLIDES TO SHOW YOU!
  87. 87. THE BASICS YOU NEED TO KNOW: @ChristiJOlson#HeroConf 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
  88. 88. OBJECTS COLLECTION OF “ENTITIES” AdWordsApp MccApp SpreadsheetApp UrlFetchApp ADWORDS ACCOUNT CONNECTS WITH SPREADSHEETS (FOR REPORTING) ACROSS YOUR MCC COMMUNICATES WITH OTHER SERVICES & APPLICATIONS
  89. 89. ENTITIES – ELEMENT/PROPERTY List of AdWords Entities: bit.ly/1aeDxby
  90. 90. FUNCTIONS PERFORM TASKS / PROCEDURES @ChristiJOlson#HeroConf { } Curly Brackets define the beginning & End of a Function
  91. 91. @ChristiJOlson#HeroConf VARIABLES (VAR) NAME & STORE DATA WITHIN SCRIPTS Variable are like a container to store “data”
  92. 92. @ChristiJOlson#HeroConf ESTABLISH AN OBJECT AND SELECT AN ENTITY TO QUERY var keywords = AdWordsApp.keywords() Object Named Variable Entity Join an object and entity with a PERIOD
  93. 93. METHODS ARE HOW SCRIPTS INTERACT WITH OBJECTS @ChristiJOlson#HeroConf • 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)
  94. 94. EXAMPLES OF METHODS @ChristiJOlson#HeroConf getMaxCpc() getQualityScore() setDestinationURL() when setting or specifying a values enter it between the brackets () some methods require values. most are left blank ()
  95. 95. SELECTORS REFINE THE LIST OF ENTITIES @ChristiJOlson#HeroConf • withCondition() •withIds() •forDateRange() •orderBy() •withLimit()
  96. 96. SELECTORS REFINE THE LIST OF ENTITIES AND CAN ORDER IT @ChristiJOlson#HeroConf •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
  97. 97. ITERATORS RETURN THE NEXT ITEM @ChristiJOlson#HeroConf •like an array • pattern based search • come after selectors hasNext() objectNext()
  98. 98. LOGGER OUTPUTS THE DATA TO A PREVIEW PANEL @ChristiJOlson#HeroConf •great for troubleshooting • slows processing time • recommend removing after debugging

×