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.

An Introduction To Scripts By Christi Olson

334 views

Published on

From the Search Marketing Expo - SMX East Conference in New York City, NY, September 29 - October 1, 2015. SESSION: Unlocking The Power Of AdWords Scripts. PRESENTATION: An Introduction To Scripts - Given by Christi Olson, @christijolson, Director of SEM - PointIt. #SMX #31B

Published in: Marketing
  • Be the first to comment

  • Be the first to like this

An Introduction To Scripts By Christi Olson

  1. 1. #SMX #31B @ChristiJOlson PART 3: Unlocking the Power of Scripts AN INTRODUCTION TO SCRIPTS
  2. 2. #SMX #31B @ChristiJOlson Christi J. Olson •  Founder iSEM Consulting •  10+ years marketing management •  Seasoned digital marketing leader Professional Experience with:
  3. 3. #SMX #31B @ChristiJOlson A FEW OF MY AHA LESSONS TIPS BEFORE YOU GET STARTED
  4. 4. #SMX #31B @ChristiJOlson §  bit.ly/Notepad-plusplus §  OUTLINES CODE §  MAKES IT EASIER TO SEE WHAT YOU ARE DOING TIP: Use NotePad++ for editing
  5. 5. #SMX #31B @ChristiJOlson SCRIPTS ARE CASE SENSITIVE AND NEED TO BE WRITTEN IN camelCase
  6. 6. #SMX #31B @ChristiJOlson BE PREPARED TO UPDATE SCRIPTS CHANGES IN ADWORDS, CAUSE VARIABLES AND ENTITIES WITHIN EXISTING SCRIPTS TO CHANGE
  7. 7. #SMX #31B @ChristiJOlson EXAMPLE: UPGRADED URLS Upgraded URLs caused some scripts like Broken URL tracker to break because the variable names and entity names changed. Quick Fix: Find instances of : getDestinationUrl and replace with: urls().getFinalUrl
  8. 8. #SMX #31B @ChristiJOlson 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 = '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/abc1234/’
  9. 9. #SMX #31B @ChristiJOlson §  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) Get the list here: Bit.ly/SMX-Scripts PRE-WRITTEN SCRIPTS YOU SHOULD USE NOW
  10. 10. #SMX #31B @ChristiJOlson THE BAREBONES YOU NEED TO KNOW BASIC SCRIPT CODING
  11. 11. #SMX #31B @ChristiJOlson •  FUNCTIONS •  OBJECTS (ELEMENTS) •  ENTITIES •  VARIABLES •  METHODS •  SELECTORS •  ITERATORS JAVASCRIPT BASICS YOU NEED TO KNOW:
  12. 12. #SMX #31B @ChristiJOlson 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
  13. 13. #SMX #31B @ChristiJOlson 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
  14. 14. #SMX #31B @ChristiJOlson HOW TO ACCESS SCRIPTS IN ADWORDS CREATING SCRIPTS
  15. 15. #SMX #31B @ChristiJOlson WHERE TO FIND SCRIPTS IN THE ADWORDS UI
  16. 16. #SMX #31B @ChristiJOlson SCRIPTS UI – WHEN YOU HAVEN’T USED IT
  17. 17. #SMX #31B @ChristiJOlson SCRIPTS UI – ONCE YOU’VE ADDED/RUN A SCRIPT
  18. 18. #SMX #31B @ChristiJOlson STEP 1: ADD A SCRIPT
  19. 19. #SMX #31B @ChristiJOlson STEP 2: COPY PRE-WRITTEN SCRIPT INTO NOTEPAD ++ FREE SCRIPT FROM FREEADWORDSSCRIPTS.COM COPY SCRIPT & PASTE INTO NOTEPAD
  20. 20. #SMX #31B @ChristiJOlson STEP 3: UPDATE SPREADSHEET URL & OTHER FIELDS
  21. 21. #SMX #31B @ChristiJOlson STEP 4: PASTE INTO EDITOR & NAME IT
  22. 22. #SMX #31B @ChristiJOlson STEP 5: AUTHORIZE SCRIPT & PREVIEW
  23. 23. #SMX #31B @ChristiJOlson STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  24. 24. #SMX #31B @ChristiJOlson STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  25. 25. #SMX #31B @ChristiJOlson STEP 6: DEBUG VIA LOGS (IF NECESSARY)
  26. 26. #SMX #31B @ChristiJOlson PREVIEW THE DATA IN THE SHARED DOC
  27. 27. #SMX #31B @ChristiJOlson STEP 7: SCHEDULING
  28. 28. #SMX #31B @ChristiJOlson When you want something a little different… Making additional edits to scripts
  29. 29. #SMX #31B @ChristiJOlson “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. #SMX #31B @ChristiJOlson GREAT AUDIT SCRIPT, BUT THE FORMAT WASN’T IDEAL
  31. 31. #SMX #31B @ChristiJOlson I WANTED AN XLS SPREADSHEET INSTEAD OF LOG OUTPUT
  32. 32. #SMX #31B @ChristiJOlson MAP WHAT THE SCRIPT DOES, AND WHAT YOU WANT IT TO DO
  33. 33. #SMX #31B @ChristiJOlson 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. #SMX #31B @ChristiJOlson CODE FOR: GET CAMPAIGN & AD GROUP DATA http://bit.ly/PI-GetCMP http://bit.ly/PI-GetAG CAMPAIGN ITERATOR AD GROUP ITERATORS
  35. 35. #SMX #31B @ChristiJOlson CODE TO PREP A SPREADSHEET §  bit.ly/PI-SpreadsheetScript
  36. 36. #SMX #31B @ChristiJOlson CODE TO CREATE & WRITE TO GOOGLE DOC
  37. 37. #SMX #31B @ChristiJOlson USED THE ORIGINAL CODE TO COUNT KEYWORDS BY MATCH TYPE This is the original code from the audit doc
  38. 38. #SMX #31B @ChristiJOlson PULL IT TOGETHER & QA THE FINISHED PRODUCT bit.ly/PI-KWDauditSCRIPT
  39. 39. #SMX #31B @ChristiJOlson THANK YOU! SEE YOU @SMX WEST SAN JOSE, CA MARCH 1-3, 2016

×