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.

Getting Started with Scripts #HeroConf London 2015

1,282 views

Published on

An introduction to important javascript components, how to implement scripts, compatible integrations, tips, common mistakes, use cases, and free resources!

Published in: Marketing
  • Be the first to comment

Getting Started with Scripts #HeroConf London 2015

  1. 1. @hoffman8 @heroconf #IntroToScripts PAGE 1 Amy Bishop | @hoffman8 Director: Audits, Outbound, Training | Clix Introduction to Scripts
  2. 2. @hoffman8 @heroconf #IntroToScripts That One Slide • PPC Manager 6+ years • Dev Wannabe • Travel Enthusiast • Twitter: @Hoffman8
  3. 3. @hoffman8 @heroconf #IntroToScripts Agenda PAGE 3 • Script Components • Setting Up a Script • Compatible Formats • Practical Use • Tips • Common Errors • (Free!) Resources
  4. 4. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Breaking It Down
  5. 5. @hoffman8 @heroconf #IntroToScripts Script Components Functions Variables Objects Methods Selectors Iterators
  6. 6. @hoffman8 @heroconf #IntroToScripts PAGE 6
  7. 7. Comments PAGE 7 Comments are notes that are made within the script that are not executed. They are solely for reference. // This is a 1 line comment. /* This is a multiple line comment. */
  8. 8. Functions PAGE 8 A function is a block of code that is designed to perform a particular task. You’ll see the function name followed by parentheses. The code to be executed is between brackets. function toCelsius(f) { return (5/9) * (f-32); }
  9. 9. Variables PAGE 9 Variables are containers for storing data values. Variables correspond to objects and entities. Variables must be identified with unique names var x = 5; var y = 6; var z = x + y; x,y,z are variables
  10. 10. Objects PAGE 10 Objects are variables but can contain many values. The contents of the object are called properties and each property has a property value. Objects are sometimes called elements. var Shoes = {type:”Heels”, color:”Red”, brand:”Prada”} Property: Type Color Brand Property Value: Heels Red Prada
  11. 11. Methods PAGE 11 A method is a property that contains a function definition. Can be used to call information & make commands. http://www.w3schools.com/js/js_object_methods.asp Object Properties
  12. 12. Selectors PAGE 12 Selectors are used to pull in the objects and entitites that you have identified in your script. Selectors can use conditions, kind of like filters. var campaignSelector = AdWordsApp.campaigns() .withCondition("Clicks > 10") .withCondition("Impressions > 100") .orderBy("Impressions DESC") .forDateRange("YESTERDAY");
  13. 13. Iterators PAGE 13 Iterators are used to pull in information in phases, so as not to overload the system. An Iterator can be used only after the Selector has been created.
  14. 14. Function PAGE 14
  15. 15. Variables PAG E 15
  16. 16. Selectors PAG E 16
  17. 17. Iterators PAG E 17
  18. 18. Iterators PAGE 18 Variables Selectors Iterators Begin Function End Function http://www.freeadwordsscripts.com/2013/02/store-account-level-quality-score-in.html
  19. 19. @hoffman8 @heroconf #IntroToScripts Pop Quiz! PAGE 19
  20. 20. @hoffman8 @heroconf #IntroToScripts You don’t have to be able to write scripts in order to use them. There are Tons of Free scripts at your disposal! Examples from: FreeAdWordsScripts.com, Optimizyr Blog, Search Engine Land (courtesy of BrainLabs), and Developers.google.com
  21. 21. @hoffman8 @heroconf #IntroToScripts In fact, there are free examples IN the IDE!
  22. 22. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Implementing Scripts
  23. 23. @hoffman8 @heroconf #IntroToScripts 7 Simple Steps 1. Navigate to the Script IDE in AdWords 2. Write (or Paste!) Your Script 3. Authorize the Script 4. Preview the Script 5. Review & Correct Errors 6. Run the Script 7. Schedule the Script
  24. 24. @hoffman8 @heroconf #IntroToScripts Script IDE PAGE 25
  25. 25. @hoffman8 @heroconf #IntroToScripts Slide 26
  26. 26. @hoffman8 @heroconf #IntroToScripts Script IDE PAGE 27 IDE = Integrated Development Environment Allows for editing, debugging, and launching scripts within the AdWords interface Slide 27
  27. 27. @hoffman8 @heroconf #IntroToScripts Write (or Paste) the Script PAGE 28 Script shared by Frederick Vallaeys, Optimyzr
  28. 28. @hoffman8 @heroconf #IntroToScripts (If Borrowed) Personalize The Script PAGE 29 Often Free Scripts Include Instructions!
  29. 29. @hoffman8 @heroconf #IntroToScripts (If Borrowed) Personalize The Script PAGE 30 Often Free Scripts Include Instructions!
  30. 30. @hoffman8 @heroconf #IntroToScripts Authorize PAGE 31 Scripts may run on the user’s behalf, when scheduled, even if the user is not logged in. Therefore, users must authorize AdWords scripts to run and make changes (as indicated in the script).
  31. 31. @hoffman8 @heroconf #IntroToScripts Preview PAGE 32 ALWAYS preview your scripts!
  32. 32. @hoffman8 @heroconf #IntroToScripts Check & Resolve Errors PAGE 33 The log will show you where errors occur, so that you can easily fix them. Be aware, though, that the line provided may be code referencing a different line, where the actual issue lies.
  33. 33. @hoffman8 @heroconf #IntroToScripts Preview Again! PAGE 34 After you’ve corrected the errors, preview your script again. More errors may arise in later parts of the script. Rinse & repeat until no errors arise.
  34. 34. @hoffman8 @heroconf #IntroToScripts Run The Script PAGE 35 Once errors have been corrected, and the preview is free of errors, you’re ready to run the script! Just click the blue button!
  35. 35. @hoffman8 @heroconf #IntroToScripts Schedule PAGE 36 Schedule the script to run in future. Click “+ schedule” and choose the frequency at which you’d like it to run.
  36. 36. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Compatible Integrations & Opportunities
  37. 37. @hoffman8 @heroconf #IntroToScripts COMPATIBLE FORMATS • Google Sheets • Google Drive • Emailed Results • URL Fetch • JDBC • Automatic Changes
  38. 38. @hoffman8 @heroconf #IntroToScripts GOOGLE SHEETS & GOOGLE DRIVE • Utilize Google Spreadsheets as a data source. Ex:Add these keywords • Export and Store Data • Visualize Reports • Create, Find, & Modify Files on Google Drive
  39. 39. @hoffman8 @heroconf #IntroToScripts CHARTS Visualize data through the ChartApp interface, which will allow you to create custom charts through Google Chart Tools.
  40. 40. @hoffman8 @heroconf #IntroToScripts EMAIL • Receive a notification that the script has ran. • Receive an email with the script’s findings. • Utilize customize HTML to format professional reporting to be automatically sent to clients & colleagues
  41. 41. @hoffman8 @heroconf #IntroToScripts URL FETCHING Make use of external data feeds: • Pull in password-protected feeds from your site (ex. Inventory information) • Pull information from alternate data sources to inform script decisions
  42. 42. @hoffman8 @heroconf #IntroToScripts JDBC • Can connect your script to external JDBC-compliant databases such as: • Google Cloud SQL • MySQL • Microsoft SQL Server • Oracle Databases
  43. 43. @hoffman8 @heroconf #IntroToScripts AUTOMATIC CHANGES Authorize & automate the script to make optimizations within the account on your behalf.
  44. 44. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Practical Use
  45. 45. @hoffman8 @heroconf #IntroToScripts Making the Most of Scripts PAGE 46 • Recurring Tasks • Reporting • Analysis • Monitoring • Complex Tasks & Integrations
  46. 46. @hoffman8 @heroconf #IntroToScripts When to Automate PAGE 47 “…if you do something 2-3 times by hand, the next time should be automated.” -Brad Geddes @bgtheory
  47. 47. @hoffman8 @heroconf #IntroToScripts Examples PAGE 48 • Checking Ad Groups for the Number of Keywords & Ads • Checking for URL Errors • Pulling Data for Frequent Reports • Determining when Ad Tests Have Reached Statistical Significance • Bid & Budget Changes • Ad Customizers
  48. 48. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Tips For Getting Started
  49. 49. @hoffman8 @heroconf #IntroToScripts EMBRACE JAVASCRIPT There are several free Javascript tutorials and courses online! Learn at your own pace – for free!
  50. 50. @hoffman8 @heroconf #IntroToScripts PRACTICE WITH FREE CODE Use free scripts and practice making tweaks to them until you get more comfortable with Javascript.
  51. 51. @hoffman8 @heroconf #IntroToScripts BETTER SAFE THAN SORRY Diminish risk by starting with scripts that create reports and alerts as opposed to making changes.
  52. 52. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Common Issues & Mistakes
  53. 53. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Scripts Can be Finicky!
  54. 54. @hoffman8 @heroconf #IntroToScripts • Javascript is case sensitive • Be sure to utilize consistent capitalization within naming conventions. • Generally you’ll see the error “undeclared” variable” if capitalization is an issue • Most sources suggest camel case (firstName, lastName, etc) Capitalization
  55. 55. @hoffman8 @heroconf #IntroToScripts
  56. 56. @hoffman8 @heroconf #IntroToScripts • If the error indicates the problem is in the last line, there is probably one too many } brackets. Try deleting it and previewing again. • Semi-Colons should be used to end a line of code, like a period to a sentence. • A missing semi-colon will cause the script editor to report an error but can cause the editor to identify the wrong line • Consistently use quotation marks. “ or ‘ can be used but you must use the same to open and close. Grammar & Syntax
  57. 57. @hoffman8 @heroconf #IntroToScripts • Make sure that you clear out the IDE, if necessary. • Common error message: “scripts must have one main function” • Be sure to update all the customized data to fit your needs. • Date, Email/Spreadsheet URL, Currency, etc. Borrowed Scripts
  58. 58. @hoffman8 @heroconf #IntroToScripts • Scripts that have specific date ranges should not be scheduled • Never ‘set it and forget it’ with a script that implements changes. Logistics
  59. 59. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts Resources
  60. 60. Practical Strategies for Selling Tickets in a Social World @hoffman8 @heroconf #IntroToScripts
  61. 61. Learning Javascript • w3schools Training • CodeAcademy.org • Learn more about the components • Udemy.com
  62. 62. Learning About AdWords Scripts • Scripts Forum • AdWords Developer Resources • Google Style Guide • Google Scripts Blog • AdWords Code Lab Resources • Compatible Formats & Integrations
  63. 63. Free Scripts • FreeAdWordsScripts.com • Google Developer Solutions • Free Code Snippets • RankHammer’s Script Compilation • Google it!
  64. 64. Smart People. • Russell Savage, FreeAdWordsScripts.com @russellsavage • Steve Hammer, Rank Hammer @armondhammer • Dan Gilbert, Brainlabs @brainlabs • Frederick Vallaeys, Optimyzr @siliconvallaeys • Jon Gritton, Cobnut Web Services google.com/+JonGritton • Christi Olson, iSEM Consulting @ChristiJOlson • Scripts Forum Follow The Smart People.
  65. 65. @hoffman8 @heroconf #IntroToScripts Thank You! CLIX Marketing 217 La Grange Rd Pewee Valley, KY 40056 Tel :502.442.2776 Fax :502.805.0643 Web: clixmarketing.com 66 @clixmarketing @hoffman8 Facebook.com/ clix-marketing amy@clixmarketing.com

×