Building Blocks of AdWords Scripts By Steve Hammer

49
#SMX #22B @armondhammer Decoding Code Building Blocks of AdWords Scripts Steve Hammer President, RankHammer

Transcript of Building Blocks of AdWords Scripts By Steve Hammer

Page 1: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #22B @armondhammer

Decoding Code

Building Blocks of AdWords Scripts

Steve Hammer

President, RankHammer

Although  this  is  a  template,  these  slides  have  been  created  as  examples  to  show  you  what’s  possible  within  the  template.  PLEASE  DELETE  ALL  EXAMPLE  SLIDES  AND  NOTES  BEFORE  CREATING  OR  IMPORTING  YOUR  OWN  DECK.   YOU MUST USE THE SMX FOOTER ON YOUR TITLE SLIDE!  The  template  works  best  if  you  use  it  to  create  a  presentation  from  scratch.  However,  this  blank  layout  offers  you  flexibility  to  insert  your  own  slides  above  the  SMX  footer.  You  must  use  this  footer  at  on  almost  all  of  your  slides.  If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately!      Before  you  do  anything  else,  replace  “#XXa”  in  the  footer  with  your  session’s  specific  hashtag.      In  PowerPoint,  Select  VIEW>SLIDE  MASTER  to  edit  and  include  it  on  all  slides  of  your  presentation.  Also  add  your  @twitterhandle  (or  @companyhandle  if  you  prefer).    Ask  your  session  coordinator  for  the  session’s  specific  hashtag!      This  template  is  high-­‐resolution  16:9.  DO  NOT  change  it  to  4:3.  Also  note  that  if  you  import  a  4:3  presentation  into  16:9  you  may  encounter  display  issues.    The  template  uses  Century  Gothic  &  Corbel  as  default  fonts.  Arial  is  a  secondary  font  that  may  appear.  Note  that  older  versions  of  PowerPoint  may  not  have  these  as  an  option;  change  to  Arial  or  other  standard  sans-­‐serif-­‐font.    When  inserting  text,  you  *MUST*  use  only  standard  fonts.  We  cannot  guarantee  event  laptops  will  have  specialty  fonts  installed,  nor  can  we  do  so  onsite.      Powerpoints  with  animations  may  not  translate  well  to  pdf/slideshare  format  –  you  may  also  submit  a  2nd  version  /  scrubbed  deck  more  appropriate  for  posting  online  by  SMX  production  staff.  

Example Title Slide:

Although  this  is  a  template,  these  slides  have  been  created  as  examples  to  show  you  what’s  possible  within  the  template.  PLEASE  DELETE  ALL  EXAMPLE  SLIDES  AND  NOTES  BEFORE  CREATING  OR  IMPORTING  YOUR  OWN  DECK.   YOU MUST USE THE SMX FOOTER ON YOUR TITLE SLIDE!  The  template  works  best  if  you  use  it  to  create  a  presentation  from  scratch.  However,  this  blank  layout  offers  you  flexibility  to  insert  your  own  slides  above  the  SMX  footer.  You  must  use  this  footer  at  on  almost  all  of  your  slides.  If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately!      Before  you  do  anything  else,  here’s  how  to  replace  “#XXa”  in  the  footer  with  your  session’s  specific  hashtag.      In  PowerPoint,  Select  VIEW>SLIDE  MASTER  to  edit  SLIDE  #1  to  include  it  on  all  slides  of  your  presentation.  Also  add  your  @twitterhandle  (or  @companyhandle  if  you  prefer).    Ask  your  session  coordinator  for  the  session’s  specific  hashtag!      This  template  is  high-­‐resolution  16:9.  DO  NOT  change  it  to  4:3.  Also  note  that  if  you  import  a  4:3  presentation  into  16:9  you  may  encounter  display  issues.    The  template  uses  Century  Gothic  &  Corbel  as  default  fonts.  Arial  is  a  secondary  font  that  may  appear.  Note  that  older  versions  of  PowerPoint  may  not  have  these  as  an  option;  change  to  Arial  or  other  standard  sans-­‐serif-­‐font.    When  inserting  text,  you  *MUST*  use  only  standard  fonts.  We  cannot  guarantee  event  laptops  will  have  specialty  fonts  installed,  nor  can  we  do  so  onsite.      Powerpoints  with  animations  may  not  translate  well  to  pdf/slideshare  format  –  you  may  also  submit  a  2nd  version  /  scrubbed  deck  more  appropriate  for  posting  online  by  SMX  production  staff.  

Page 2: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Let’s  talk  about  the  Weather  

Page 3: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Cool  Story  Bro  

Page 4: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Let’s  make  it  our  own  

Page 5: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Break  it,  and  rebuild    

Page 6: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

About Me

FAMILY What it’s all about

FOOD AND WINE

Eating as an art form?

HOCKEY Go Stars

RANKHAMMER

Dallas Based Digital Marketing Agency

Page 7: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Learning  to  code  

Page 8: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Code.org/starwars  

Page 9: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

TITLE OPTION #2 – IMAGE Slide with SMX FOOTER:

This  blank  layout  offers  you  flexibility  to  insert  your  own  standard  slides  above  the  SMX  footer-­‐  either  for  a  title  slide  or  all  others.      YOU  MUST  USE  THIS  FOOTER  AT  MINIMUM  ON  YOUR  TITLE  SLIDE  &    ALMOST  ALL  OF  YOUR  SLIDES.    If  a  screenshot  overlaps  the  footer  on  occasion,  that’s  fine  –  but  do  your  best  to  crop  appropriately.    If  using  explicit  fonts  are  important,  you  may  provide  a  pdf  to  the  event  organizers  to  maintain  look  &  feel  during  live  presentation  and  in  the  version  SMX  will  upload  to  slideshare.            DELETE  THIS  SLIDE  IF  YOU  DO  NOT  USE.    

Blockly  

https://developers.google.com/blockly/  

Page 10: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Loops  and  Conditions  

Page 11: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Make the blocks your own

Page 12: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

http://www.codecademy.com/tracks/javascript  http://www.w3schools.com/js/default.asp  

http://www.learn-­‐js.org/  

Learning a little JavaScript

https://www.khanacademy.org/computing/computer-­‐programming  

Page 13: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Typical Code Architecture

Global  Variables  –  Used  by  all  

Other  Functions    

Main  Function  

Local  Variables  

Page 14: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Worst Script Ever

Page 15: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Logger

Bulk  Operations  >  Logs>  Details>  Logs>  

Page 16: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Selector

Makes  an  array  of  the  type  Filtered  by  conditions  Finished  with  get();  

Page 17: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Selector

Conditions  are  AND  Connect  with  .  End  with  ;  

Page 18: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Variables

Discreet  

• 5.23  • ‘Office’  •   5+3  •   ‘Today’  +  variable    

Arrays  • [4,  5,  7,  9]  • [‘Home’,’Office’,’Hotel’]  

Objects  • {name:’Steve’,zip:75204,car:’Subaru’}  • {1:Array1,2:Array2}  

Page 19: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Selectable?

https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_adselector  

Page 20: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Selector

Get  all  keywords  With  a  CTR  greater  than  0.01  

For  all  time  

Page 21: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

We  Now  Have  

Selected  every  keyword  

That  has  ever  Gotten  a  click  

Page 22: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

While Next

Sets  up  the  repeating  

Page 23: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Payload

Calls  a  method  to  make  a  change  

Page 24: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Iterator

Find  the  maximum  CPC  Add  1%  

Set  as  new  Max  CPC  

Page 25: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Worst Script Ever

Page 26: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Change it

Page 27: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Change  {almost}  anything  

Page 28: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Next Level

Prewritten  Scripts    +    

Code  Snippets  

Page 29: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Starting  Scripts  

http://www.rankhammer.com/blog/2541/i-­‐heard-­‐you-­‐like-­‐adwords-­‐scripts  

https://developers.google.com/adwords/scripts/docs/solution/  

http://freeadwordsscripts.com  

Page 30: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Defining a Function

Functions  can  return  values  to  feed  a  variable  

 Functions  can  also  just  be  invoked,  even  without  

parameters  

Page 31: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Snippets

https://developers.google.com/adwords/scripts/docs/examples/  

Page 32: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Not  exactly  ready  to  use  

Page 33: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Odd  Selector  Logic  

Values  have  to  become  strings  

Page 34: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

ODD Selector LOGIC

To  make  it  flexible  it  has  to  be:  

“Column  Operator”  +  Value  'Name  =  "'  +  var  +  '"'  

Odd  Selector  Logic  

Page 35: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Tweak The Selector

Page 36: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer 36

Organize  

Protip:  Make  a  Text  Document  Store  modified  function  snippets  Copy  Paste  next  time  

Page 37: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Multiple Functions

Page 38: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Look at real needs

Page 39: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Good Candidates

Daily  Activities  • Scale  Changes  • Profit  bidding  

Bulk  Changes  • KW  addition  

Rapid  Movement  • Limited  Inventory  • Price  Changes  

Creative  Models  • Correlated  Bidding  

Ad  Copy  Rotation  • Timely  Changes  

Page 40: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Specifying a Script

When  

• Conditions  

In  

• Item  Scope  

Change  

• Operation  

Unless  

• Limits  

When  

• CPA  is  higher  than  XXX  

In  

• Target  Campaign  

Change  

• Bids  by  -­‐10%  

Unless  

• Impression  share  is  <50%  

Page 41: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Franchises – Locations growing

Page 42: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Our problem

When  

• Conditions  

In  

• Item  Scope  

Change  

• Operation  

Unless  

• Limits  

When  

•  A  new  location  launches  

In  

•  New  adgroup  

Change  

•  Add  city  name  to  base  keywords  

Unless  

•  N/A  

Page 43: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

The  goal  –  another  way  

Marketing  

+marketing  +plano  

“marketing  plano”  

“plano  marketing”  

Page 44: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Flesh  out  the  basic  idea  –  all  comments  

Page 45: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Find snippets and modify

Page 46: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Flesh out the details

Page 47: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Test and Preview

Page 48: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #31B @armondhammer

Be a Scripts Rockstar – You can do it

Page 49: Building Blocks of AdWords Scripts By Steve Hammer

#SMX #22B @armondhammer

SEE YOU AT THE NEXT #SMX

THANK YOU!