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.

PubCon Last Vegas 2015 - Editing AdWords Scripts

3,124 views

Published on

A non-coders guide and introduction to AdWords Scripts. Presented at PubCon Vegas 2015 a step by step guide to implement AdWords scripts along with an example of how to edit and tweak a pre-written script to do what you want it to do.

Published in: Marketing

PubCon Last Vegas 2015 - Editing AdWords Scripts

  1. 1. @ChristiJOlson #pubcon Christi Olson iSEM Consulting Part 3: A Non-Coders Guide to Editing AdWords Scripts
  2. 2. @ChristiJOlson #pubcon Christi J. Olson • Founder iSEM Consulting • 10+ years marketing management • Seasoned digital marketing leader Professional Experience with:
  3. 3. @ChristiJOlson #pubcon HELPFUL TIPS BEFORE YOU GET STARTED EDITING
  4. 4. @ChristiJOlson #pubcon  Don’t Use WORD for editing or saving scripts. It can add invisible characters that cause the code to fail  NotePad++ Outlines and groups together code  NotePad++ Makes it easier to review the code EDIT SCRIPTS IN NOTEPAD OR NOTEPAD++
  5. 5. @ChristiJOlson #pubcon SCRIPTS ARE CASE SENSITIVE AND NEED TO BE WRITTEN IN camelCase
  6. 6. @ChristiJOlson #pubcon COMMENTS CAN [and should] BE USED WITHIN SCRIPTS Document what the code is supposed to do, and options for choices within the code // IS A SINGLE COMMENT LINE /* SINGLE FORWARD SLASH + ASTERISK /* COMMENT SPANNING MULTIPLE LINES */
  7. 7. @ChristiJOlson #pubcon BE PREPARED TO UPDATE SCRIPTS CHANGES IN ADWORDS, CAUSE VARIABLES AND ENTITIES WITHIN EXISTING SCRIPTS TO CHANGE
  8. 8. @ChristiJOlson #pubcon BE PREPARED TO UPDATE SCRIPTS Upgraded URLs caused some scripts like Broken URL tracker to break because the variables and entities changed. Find instances of : getDestinationUrl and replace with: urls().getFinalUrl
  9. 9. @ChristiJOlson #pubcon WHAT YOU’LL MOST LIKELY NEED TO EDIT IN EVERY SCRIPT:  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 = 'christi@iSEMConsulting.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/abc1234/’
  10. 10. @ChristiJOlson #pubcon bit.ly/Pub-Scripts  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)  Search Queries by N-Grams, Written by Daniel Gilbert  Search Query Manager, Written by Marcela De Vivo (Gryffin.com) PRE-WRITTEN SCRIPTS YOU SHOULD USE NOW
  11. 11. @ChristiJOlson #pubcon SCRIPTING BASICS THE ANATOMY OF WHAT’S IN A SCRIPT
  12. 12. @ChristiJOlson #pubcon  FUNCTIONS  OBJECTS (ELEMENTS)  ENTITIES  VARIABLES  METHODS  SELECTORS  ITERATORS THE KEY ITEMS YOU NEED TO KNOW:
  13. 13. @ChristiJOlson #pubcon 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()); } } FUNCTION SELECTORS ITERATOR + next METHODS VARIABLE, OBJECT, ENTITY LOGGER METHODS closes out the function closes out the iterator
  14. 14. @ChristiJOlson #pubcon HOW TO USE SCRIPTS IN THE ADWORDS INTERFACE
  15. 15. @ChristiJOlson #pubcon WHERE TO FIND SCRIPTS IN THE ADWORDS UI
  16. 16. @ChristiJOlson #pubcon SCRIPTS UI – WHEN YOU HAVEN’T USED IT
  17. 17. @ChristiJOlson #pubcon SCRIPTS UI – ONCE YOU’VE ADDED/RUN A SCRIPT
  18. 18. @ChristiJOlson #pubcon STEP 1: ADD A SCRIPT
  19. 19. @ChristiJOlson #pubcon STEP 2: COPY PRE-WRITTEN SCRIPT INTO NOTEPAD++
  20. 20. @ChristiJOlson #pubcon STEP 3: UPDATE SPREADSHEET URL & OTHER FIELDS
  21. 21. @ChristiJOlson #pubcon STEP 4: NAME THE SCRIPT & PASTE INTO EDITOR
  22. 22. @ChristiJOlson #pubcon STEP 5: AUTHORIZE SCRIPT & PREVIEW
  23. 23. @ChristiJOlson #pubcon STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  24. 24. @ChristiJOlson #pubcon STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  25. 25. @ChristiJOlson #pubcon STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  26. 26. @ChristiJOlson #pubcon PREVIEW THE DATA IN THE SHARED DOC
  27. 27. @ChristiJOlson #pubcon STEP 7: SCHEDULING
  28. 28. @ChristiJOlson #pubcon MAKING MORE EDITS TO SCRIPTS WHEN YOU WANT TO ADD MORE DATA
  29. 29. @ChristiJOlson #pubcon “CHEATING” WITH CUSTOMIZED SCRIPTS FIND A SIMILAR SCRIPT AND USE IT AS A FRAMEWORK TO BUILD OUT THE MORE IN-DEPTH OR ROBUST SCRIPT THAT YOU WANT
  30. 30. @ChristiJOlson #pubcon GREAT AUDIT SCRIPT, BUT THE FORMAT WASN’T IDEAL DATA WAS IN A LOG OUTPUT
  31. 31. @ChristiJOlson #pubcon I WANTED AN XLS SPREADSHEET INSTEAD OF LOG OUTPUT
  32. 32. @ChristiJOlson #pubcon MAP WHAT THE SCRIPT DOES, AND WHAT YOU WANT IT TO DO
  33. 33. @ChristiJOlson #pubcon 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
  34. 34. @ChristiJOlson #pubcon CODE FOR: GET CAMPAIGN & AD GROUP DATA http://bit.ly/PI-GetCMP http://bit.ly/PI-GetAG CAMPAIGN ITERATOR AD GROUP ITERATORS
  35. 35. @ChristiJOlson #pubcon CODE TO GET CAMPAIGN & AD GROUP DATA
  36. 36. @ChristiJOlson #pubcon bit.ly/PI-SpreadsheetScript CODE TO PREP THE SPREADSHEET
  37. 37. @ChristiJOlson #pubcon CODE TO CREATE & WRITE TO GOOGLE DOC
  38. 38. @ChristiJOlson #pubcon USED THE ORIGINAL CODE TO COUNT KEYWORDS BY MATCH TYPE This is the original code from the audit doc
  39. 39. @ChristiJOlson #pubcon PULL IT TOGETHER & QA THE FINISHED PRODUCT bit.ly/PI-KWDauditSCRIPT

×