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
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
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
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
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
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
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
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
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. #SMX #23C1 @russellsavage
THANK YOU!
@RussellSavage
FreeAdWordsScripts.com
Join us @SMX East
NEW YORK CITY
Sept. 29
th
– Oct. 1
st
2015