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.
#SMX #23C1 @russellsavage
June 3rd, 2015 – SMX Advanced - Seattle
ADVANCED ADWORDS SCRIPTS:
HARDER, BETTER, FASTER,
STRONG...
#SMX #23C1 @russellsavage
Apologies to…
#SMX #23C1 @russellsavage
▪ Faster
▪ Find slow code and speed it up
▪ Better
▪ Make your code easier to reuse and debug
▪ ...
#SMX #23C1 @russellsavage
▪ Russ Savage
▪ Systems Architect @
▪ FreeAdWordsScripts.com
About Me
#SMX #23C1 @russellsavage
Faster
#SMX #23C1 @russellsavage
▪ Available at Adwords
Scripts Developer Page
▪ https://goo.gl/BkWJXn
▪ Pay close attention to
▪...
#SMX #23C1 @russellsavage
Some Slow Code
#SMX #23C1 @russellsavage
Some Slow Code
#SMX #23C1 @russellsavage
Profiling Your Code
#SMX #23C1 @russellsavage
Some Slow Code Profiled
#SMX #23C1 @russellsavage
Some Slow Code Profiled
#SMX #23C1 @russellsavage
Some Slow Code Profiled
#SMX #23C1 @russellsavage
Some Slow Code Profiled
#SMX #23C1 @russellsavage
Some Faster Code Profiled
#SMX #23C1 @russellsavage
Some Faster Code Profiled
#SMX #23C1 @russellsavage
Some Faster Code Profiled
40%
#SMX #23C1 @russellsavage
▪ Use best practices
▪ https://developers.google.com/adwords/scripts/docs/best-practices
▪ Use a...
#SMX #23C1 @russellsavage
Better
#SMX #23C1 @russellsavage
▪ Pick a JavaScript coding
style & stick with it
▪ If possible, convert copied
code to your styl...
#SMX #23C1 @russellsavage
Sample From Google’s Style Guide
#SMX #23C1 @russellsavage
▪ Use functions and classes to:
▪ Avoid writing the same code twice
▪ Document complicated code
...
#SMX #23C1 @russellsavage
Documenting Complicated Code
Why would anyone have this code?
#SMX #23C1 @russellsavage
▪ Pick a coding style and stick with it
▪ Use functions an classes to document
complicated code
...
#SMX #23C1 @russellsavage
Stronger
#SMX #23C1 @russellsavage
▪ Your API calls need to retry
▪ Always sleep

between retries
Fortify Your Code Against API Err...
#SMX #23C1 @russellsavage
Fortify Your Code Against API Errors
#SMX #23C1 @russellsavage
▪ Until AdWords Scripts has better alerting
Be Notified When Your Script Fails
#SMX #23C1 @russellsavage
Be Notified When Your Script Fails
#SMX #23C1 @russellsavage
▪ Add checksums to
your code
Watch Out For Altered Code
#SMX #23C1 @russellsavage
Watch Out For Altered Code
Probably better to store checksums somewhere else…
#SMX #23C1 @russellsavage
▪ Always retry external API calls
▪ Write scripts so that you are notified when
they fail
▪ Watc...
#SMX #23C1 @russellsavage
Harder
#SMX #23C1 @russellsavage
Generate Tasks from Scripts
https://developers.google.com/adwords/scripts/docs/examples/google-t...
#SMX #23C1 @russellsavage
Send Data to mySQL Database
https://developers.google.com/apps-script/guides/jdbc
#SMX #23C1 @russellsavage
Machine Learning with Prediction API
http://selnd.com/1DnVksj
#SMX #23C1 @russellsavage
AdWords Scripts is truly becoming a viable
alternative to the API for most users
This is still j...
#SMX #23C1 @russellsavage
THANK YOU!
@RussellSavage
FreeAdWordsScripts.com
Join us @SMX East
NEW YORK CITY
Sept. 29
th
– O...
Upcoming SlideShare
Loading in …5
×

Advanced AdWords Scripts: Harder, Better, Faster, Stronger By Russell Savage

1,455 views

Published on

From the SMX Advanced Conference in Seattle, Washington, June 2-3, 2015. SESSION: Advanced AdWords Scripts. PRESENTATION: Advanced AdWord Scripts: Harder, Better, Faster, Stronger - Given by Russell Savage, @russellsavage - Elastic.co, Systems Architect. #SMX #23C1

Published in: Internet
  • Be the first to comment

Advanced AdWords Scripts: Harder, Better, Faster, Stronger By Russell Savage

  1. 1. #SMX #23C1 @russellsavage June 3rd, 2015 – SMX Advanced - Seattle ADVANCED ADWORDS SCRIPTS: HARDER, BETTER, FASTER, STRONGER
  2. 2. #SMX #23C1 @russellsavage Apologies to…
  3. 3. #SMX #23C1 @russellsavage ▪ Faster ▪ Find slow code and speed it up ▪ Better ▪ Make your code easier to reuse and debug ▪ Stronger ▪ Know when errors happen and recover gracefully ▪ Harder ▪ Do cool stuff Agenda
  4. 4. #SMX #23C1 @russellsavage ▪ Russ Savage ▪ Systems Architect @ ▪ FreeAdWordsScripts.com About Me
  5. 5. #SMX #23C1 @russellsavage Faster
  6. 6. #SMX #23C1 @russellsavage ▪ Available at Adwords Scripts Developer Page ▪ https://goo.gl/BkWJXn ▪ Pay close attention to ▪ Use IDs for filtering ▪ Don’t run selectors in a tight loop ▪ Batch changes Follow Best Practices
  7. 7. #SMX #23C1 @russellsavage Some Slow Code
  8. 8. #SMX #23C1 @russellsavage Some Slow Code
  9. 9. #SMX #23C1 @russellsavage Profiling Your Code
  10. 10. #SMX #23C1 @russellsavage Some Slow Code Profiled
  11. 11. #SMX #23C1 @russellsavage Some Slow Code Profiled
  12. 12. #SMX #23C1 @russellsavage Some Slow Code Profiled
  13. 13. #SMX #23C1 @russellsavage Some Slow Code Profiled
  14. 14. #SMX #23C1 @russellsavage Some Faster Code Profiled
  15. 15. #SMX #23C1 @russellsavage Some Faster Code Profiled
  16. 16. #SMX #23C1 @russellsavage Some Faster Code Profiled 40%
  17. 17. #SMX #23C1 @russellsavage ▪ Use best practices ▪ https://developers.google.com/adwords/scripts/docs/best-practices ▪ Use a profiler to find slow code chunks ▪ Develop your own or use mine ▪ https://goo.gl/Uu9UYI ▪ Pareto principle ▪ 80% of the slowness comes from 20% of the code Faster Summary
  18. 18. #SMX #23C1 @russellsavage Better
  19. 19. #SMX #23C1 @russellsavage ▪ Pick a JavaScript coding style & stick with it ▪ If possible, convert copied code to your style ▪ Helps when finding issues and debugging ▪ I use Google’s (mostly) Have Some Style
  20. 20. #SMX #23C1 @russellsavage Sample From Google’s Style Guide
  21. 21. #SMX #23C1 @russellsavage ▪ Use functions and classes to: ▪ Avoid writing the same code twice ▪ Document complicated code ▪ Make code more portable for reuse Functions and Classes
  22. 22. #SMX #23C1 @russellsavage Documenting Complicated Code Why would anyone have this code?
  23. 23. #SMX #23C1 @russellsavage ▪ Pick a coding style and stick with it ▪ Use functions an classes to document complicated code ▪ For reusable classes, check out my ▪ Salesforce Class - http://goo.gl/GvvbYd ▪ Twilio Class - http://goo.gl/1hK2xM Better Summary
  24. 24. #SMX #23C1 @russellsavage Stronger
  25. 25. #SMX #23C1 @russellsavage ▪ Your API calls need to retry ▪ Always sleep
 between retries Fortify Your Code Against API Errors
  26. 26. #SMX #23C1 @russellsavage Fortify Your Code Against API Errors
  27. 27. #SMX #23C1 @russellsavage ▪ Until AdWords Scripts has better alerting Be Notified When Your Script Fails
  28. 28. #SMX #23C1 @russellsavage Be Notified When Your Script Fails
  29. 29. #SMX #23C1 @russellsavage ▪ Add checksums to your code Watch Out For Altered Code
  30. 30. #SMX #23C1 @russellsavage Watch Out For Altered Code Probably better to store checksums somewhere else…
  31. 31. #SMX #23C1 @russellsavage ▪ Always retry external API calls ▪ Write scripts so that you are notified when they fail ▪ Watch out for co-workers changing your code Stronger Summary
  32. 32. #SMX #23C1 @russellsavage Harder
  33. 33. #SMX #23C1 @russellsavage Generate Tasks from Scripts https://developers.google.com/adwords/scripts/docs/examples/google-tasks
  34. 34. #SMX #23C1 @russellsavage Send Data to mySQL Database https://developers.google.com/apps-script/guides/jdbc
  35. 35. #SMX #23C1 @russellsavage Machine Learning with Prediction API http://selnd.com/1DnVksj
  36. 36. #SMX #23C1 @russellsavage AdWords Scripts is truly becoming a viable alternative to the API for most users This is still just a fraction of what you can do
  37. 37. #SMX #23C1 @russellsavage THANK YOU! @RussellSavage FreeAdWordsScripts.com Join us @SMX East NEW YORK CITY Sept. 29 th – Oct. 1 st 2015

×