Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Smxl milan 2019 - Apps script for SEO

2 790 vues

Publié le

What Google Apps script can do for SEOs

Publié dans : Ingénierie

Smxl milan 2019 - Apps script for SEO

  1. 1. @dsottimanowww.smxl.it #SMXL19 6-7, NOVEMBER 2019 Apps script & SEO automation David Sottimano VP, Keyphraseology
  2. 2. @dsottimanowww.smxl.it #SMXL19 The “average” marketer Julie Ling Job title: SEO Analyst Birthplace: https://thispersondoesnot exist.com/
  3. 3. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Working knowledge of HTML, CSS and JavaScript Interpreting data from tools like SEMRush, Ahrefs, Screaming Frog, etc. Strong grasp of Microsoft Outlook, Excel, PowerPoint, and Word Yep always it’s 2019. come on.
  4. 4. @dsottimanowww.smxl.it #SMXL19
  5. 5. @dsottimanowww.smxl.it #SMXL19 +
  6. 6. @dsottimanowww.smxl.it #SMXL19
  7. 7. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 I choose Apps Script to make things accessible to many.
  8. 8. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Apps Script is JavaScript Lives in G Suite (Sheets, documents, etc..) and Adwords https://developers.google.com/apps-script/overview
  9. 9. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 *Magic lives here*
  10. 10. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 My problem with spreadsheets.
  11. 11. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 This is a mess. =SUBSTITUTE(SUBSTITUTE(SU BSTITUTE(SUBSTITUTE(C5,"the ",""),"Hat",""),"written",""),"@","")
  12. 12. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 There’s an easier way. =SUBSTITUTE_ALL(a1,“the,Hat,@,writ ten”,””)
  13. 13. @dsottimanowww.smxl.it #SMXL19 How do you parse the URL path here? https://www.lastampa.it/sport/calcio/2 019/10/26/news/pareggia-anche-l-inter -fallito-il-sorpasso-sulla-juve-1.3779317 4
  14. 14. @dsottimanowww.smxl.it #SMXL19 Ridiculous. =MID(A1,FIND("*",SUBSTITUTE( A1,"/","*",LEN(A1)-LEN(SUBSTITU TE(A1,"/",""))))+1,LEN(A1))
  15. 15. @dsottimanowww.smxl.it #SMXL19 What if you could do this? =PARSE_URI(a2,”path”)
  16. 16. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 How do you GET Google search results?
  17. 17. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 What if it was this easy? =GOOGLE_SEARCH(“smx milano”)
  18. 18. @dsottimanowww.smxl.it #SMXL19www.smxl.it #SMXL19
  19. 19. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19
  20. 20. @dsottimanowww.smxl.it #SMXL19www.smxl.it #SMXL19 JavaScript functions are Custom formulas. function COMBINE_STRINGS(string1,string2){ return string1 + string2 }
  21. 21. @dsottimanowww.smxl.it #SMXL19 There’s so much that’s already built for JavaScript for you to use.
  22. 22. @dsottimanowww.smxl.it #SMXL19 Let’s talk about JavaScript
  23. 23. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19
  24. 24. @dsottimanowww.smxl.it #SMXL19
  25. 25. @dsottimanowww.smxl.it #SMXL19www.smxl.it #SMXL19 Using Apps Script to speed up SEO tasks
  26. 26. @dsottimanowww.smxl.it #SMXL19 I need to clean data quickly. To.. create redirect files create disavow files write metadata
  27. 27. @dsottimanowww.smxl.it #SMXL19 Parse URLs quickly From this: https://www.lastampa.it/calcio/2019/news/inter.pdf To this: Protocol: https Host: lastampa.it Directory: /sport/calcio/2019/10/26/news/ Path: /sport/calcio/2019/10/26/news/inter.pdf File: inter.pdf
  28. 28. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code PARSE_URI(a1,”protocol”)
  29. 29. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Make a copy of the sheet
  30. 30. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Or drop the code in the editor
  31. 31. @dsottimanowww.smxl.it #SMXL19 Don’t remember the formula? It’s OK! We can write our own help file too!
  32. 32. @dsottimanowww.smxl.it #SMXL19 Cool, cool.
  33. 33. @dsottimanowww.smxl.it #SMXL19 Substitute multiple words/characters We want to remove the parts in red. example.com/directory/567/~!page.html example.com/directory/56789/!page.html example.com/@directory/56789/~page.php
  34. 34. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 SUBSTITUTE_ALL(“@,.html,~”,a1) Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  35. 35. @dsottimanowww.smxl.it #SMXL19 Combine columns?
  36. 36. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 =COMBINE_TO_COLUMN(L1:M14) Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  37. 37. @dsottimanowww.smxl.it #SMXL19 I need to scrape Google search results To.. perform competitive analysis check if a page is indexed check page ranking
  38. 38. @dsottimanowww.smxl.it #SMXL19 Scrape Google search results, reliably Let’s make this easier.
  39. 39. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 You’ll need an API Key first. https://serpapi.com Note: I do not work for Serpapi.com and do not receive any compensation from them
  40. 40. @dsottimanowww.smxl.it #SMXL19 Tools > Script Editor to add key
  41. 41. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  42. 42. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Your own custom rank/index checker Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  43. 43. @dsottimanowww.smxl.it #SMXL19 I need to render webpages at scale programatically To.. check server responses scraping
  44. 44. @dsottimanowww.smxl.it #SMXL19 JavaScript render webpage anonymously from a specific location/device/user-agent From a SPREADSHEET CELL.
  45. 45. @dsottimanowww.smxl.it #SMXL19 You’ll need an API Key first. https://proxycrawl.com ProxyCrawl is a great API based crawler with several options. It’s free for 1000 requests a month. Note: I do not work for ProxyCrawl and do not receive any compensation from them
  46. 46. @dsottimanowww.smxl.it #SMXL19 We can fetch a page on demand like this: https://api.proxycrawl.com/?token=12 3&url=https://lastampa.it
  47. 47. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Which would result in this:
  48. 48. @dsottimanowww.smxl.it #SMXL19 Then we can scrape using Importxml like this =importxml(“https://api.proxycrawl.co m/?token=123&url=https://lastampa.it”, ”//h1”)
  49. 49. @dsottimanowww.smxl.it #SMXL19 Then we can scrape using Importxml like this
  50. 50. @dsottimanowww.smxl.it #SMXL19 But that isn’t smart. If we store the page, we can make mistakes in code without paying for extra requests. Luckily, proxycrawl.com makes this very easy.
  51. 51. @dsottimanowww.smxl.it #SMXL19 There’s a lot of options to explore proxycrawl.com
  52. 52. @dsottimanowww.smxl.it #SMXL19 Let’s solve SEO problems with Apps script
  53. 53. @dsottimanowww.smxl.it #SMXL19 I’m going to delete pages. How do I find 301 target? PROBLEM
  54. 54. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Imagine the trainline.com is going to get rid of this (beautiful) page: https://www.thetrainline.com/en/train-times/milan-to-turin
  55. 55. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 We need to find the closest next target. An easy way to do this is to use the site: query
  56. 56. @dsottimanowww.smxl.it #SMXL19 Using the =GOOGLE_SEARCH() function, we can do a site:thetrainline.com Milan to Turin by train to find the next most relevant page
  57. 57. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 I need to do quick keyword discovery PROBLEM
  58. 58. @dsottimanowww.smxl.it #SMXL19 Fast Solution: Google auto-suggest Make your own interface in the place you’ll end up anyway.
  59. 59. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 http://bit.do/kw-research
  60. 60. @dsottimanowww.smxl.it #SMXL19 One formula powers this tool. =GOOGLE_SUGGEST() Make your own tool however you want it to look.
  61. 61. @dsottimanowww.smxl.it #SMXL19 I need to know if / when my page has changed PROBLEM
  62. 62. @dsottimanowww.smxl.it #SMXL19 Step 1 - Use Wayback Machine to save pages To save a page in the archive, simply add https://web.archive.org/save/ to the start of the URL We’re going to automate this. Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  63. 63. @dsottimanowww.smxl.it #SMXL19 Step 2 - Set up automated captures Look for “WAYBACK_SAVE” in the code and change the URLs Spreadsheet: bit.do/smx-milan Code: bit.do/smxl-milan-code
  64. 64. @dsottimanowww.smxl.it #SMXL19 Step 2.1 - Add email Change the variable emailAddress to your email address if you want email updates. example: var emailAddress = “info@example.com”
  65. 65. @dsottimanowww.smxl.it #SMXL19 Step 2.2 - Set time trigger
  66. 66. @dsottimanowww.smxl.it #SMXL19 Step 2.2 - Set time trigger
  67. 67. @dsottimanowww.smxl.it #SMXL19 Step 3 - Pull captures into sheet =WAYBACK_GET(URL,dateFrom,dateTo)
  68. 68. @dsottimanowww.smxl.it #SMXL19 No code visual comparisons https://web.archive.org/web/diff/20141217113451/201908 01042909/https://davidsottimano.com/
  69. 69. @dsottimanowww.smxl.it #SMXL19 Or scrape directly! Think, free page monitor
  70. 70. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 I need to know how to target my content PROBLEM
  71. 71. @dsottimanowww.smxl.it #SMXL19 Supervised Machine learning classification in 10 minutes. For free. Accessible to any Google sheet. https://bigml.com/features/classification-regression
  72. 72. @dsottimanowww.smxl.it #SMXL19 Step 1 - Training data 3 sites’ organic keyword data from Semrush.com Nytimes.com = informational Yelp.com = local Amazon.com = transactional
  73. 73. @dsottimanowww.smxl.it #SMXL19 Step 2 - Upload to Bigml.com
  74. 74. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 https://bigml.com/user/dsottimano/gallery/model/5dba0a831efc927c130024cd Step 3 - 1 click model
  75. 75. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 https://bigml.com/user/dsottimano/gallery/model/5dba0a831efc927c130024cd Step 4 - Install free Bigml Addon
  76. 76. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19
  77. 77. @dsottimanowww.smxl.it #SMXL19 Not bad for 10 minutes of work.
  78. 78. @dsottimanowww.smxl.it #SMXL19www.smxl.it #SMXL19 Beyond Sheets, Apps Script can do wonderful things.
  79. 79. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19
  80. 80. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Solution: Master Folder (repository)
  81. 81. @dsottimanowww.smxl.it #SMXL19 Call the PageSpeed insights API directly
  82. 82. @dsottimanowww.smxl.it #SMXL19 @dsottimano All employees have access, in any document. https://developers.google.com/gsuite/add-ons/how-tos/publishing -editor-addons
  83. 83. @dsottimanowww.smxl.it #SMXL19 Building xml sitemaps with hreflang
  84. 84. @dsottimanowww.smxl.it #SMXL19 Change font for every Google slide Add the code, save Refresh. Click custom menu Type in new font http://bit.do/g-slides
  85. 85. @dsottimanowww.smxl.it #SMXL19 Apps script can leverage any API..
  86. 86. @dsottimanowww.smxl.it #SMXL19 “But, it’s just JavaScript..in a spreadsheet”
  87. 87. @dsottimanowww.smxl.it #SMXL19 https://pulse.appsscript.info/p/2019/11/building-a-deep-neural-net-in- google-sheets/
  88. 88. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Subscribe to:pulse.appsscript.info
  89. 89. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Where do you go from here?
  90. 90. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Want to learn JavaScript? 1) JavaScript track on Freecodecamp.org 2) Book: JavaScript - the good parts
  91. 91. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Learn Apps Script 1) Follow this list on Twitter: 2) Stack Overflow 3) Google documentation 4) Starter guide on opensourceseo.org
  92. 92. @dsottimanowww.smxl.it #SMXL19 @dsottimanowww.smxl.it #SMXL19 Hire Apps Script developers https://www.upwork.com/hire/google-apps-script-freela ncers/
  93. 93. @dsottimanowww.smxl.it #SMXL19www.smxl.it #SMXL19 Thank you. Currently building: seotoolsforsheets.com Yell at me here: @dsottimano (Twitter) dave@keyphraseology.com