SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
F#!king SEO
Tackling SEO challenges on Javascript apps

By Tiang Cheng (@tiang, tiangc@gmail.com)
About Me
• Full Stack at RateMyAgent.com.au
• Passionate about Technology, Startups
• Run Code and Scrum workshops at Learn2Code
Melbourne and Collective Campus
The Agenda
• AngularJS + SEO challenges at ratemyagent.com.au
• Solutions 

(We found a few dead ends…)
• Lessons Learnt and coding tips
• Tools and resources
SEO Challenges in NG
• Assume all Search Crawlers cannot execute front end
javascript
• Solution must be fast, and easy to implement
Google Specs
Use HashBangs!
HashBangs get converted to
escape fragment
Server-side and front-end
support for escaped fragment
Prerending!
• Pre-rending is using a programmatic browser to
download your website (html + css + js), execute
javascripts and styles the CSS, and return your
website as a String
• ie: “<html> fully rendered </html>”
Rendering models: Snapshot
• Prerenders your webpage, and caches it for future
requests
• Dynamic content can be outdated
• Fast (use S3, or Redis caching solution)
• Dependent on your headless browser…Can be buggy
Rendering models: On the fly
• Prerenders your webpage using a pre-rendering
service for every request.
• Can be slow to respond
• Delivers up to date content
Rendering models: Server
Rendering
• Renders your content on server-side
• Fast and up to date
• Double up on your coding
Prerender considerations:
• Choose a middleware layer, and pre-render service.
• Middleware layer intercepts user’s HTTP requests, and
if the user agent == “GoogleBot ||
FacebookExternalHit1.1 || BingBot || etc….”, then
executes the PreRender code, else serve the base
page to user
• PreRender code executes a phantomJS headless
browser, runs your website code, and then returns with
the completed HTML
Our SEO Journey
• Middleware layer: PreRender_MVC
• Attempt #1: We ran a hosted https://prerender.io/
• Attempt #2: Self-hosted Prerender.io service
• Attempt #3: Rewrote our web server to serve a basic
page
Server Side Architecture
• Middleware: .NET MVC Web Routes with ActionFilters









• Rendering Engine: WebController + Razor Engine +
Base HTML Templates
Coding Tip #1:
• Read the Google AJAX specifications

https://developers.google.com/webmasters/ajax-
crawling/docs/specification
• Know thy enemy!
Coding Tip #2:
• Understand the different types of URLS in SEO:
• Normal URL

www.ratemyagent.com.au/andrewjames
• Hashbang URL: 

www.ratemyagent.com.au/#!/AndrewJames
• Escape Fragment URL:

www.ratemyagent.com.au/?_escaped_fragment_=/
andrewjames
Coding Tips #3:
• Always set your canonical URL meta tag, or use
Breadcrumb Microdata
• Otherwise your pretty URLS will show up with #!















Coding Tips #4:
• Turn off javascript on your browser to see how your
website looks to a crawler. Check your meta tags!

















Coding Tips #5:
• Log your pre-rendering calls and monitor 

(We use Loggly)















Tools and Resources
• Google WebMaster Tools
• Facebook Debug Object
• PreRender.io
• PhantomJS
Google Webmaster Tools
• Fetch as Google
• Structured Data testing
• Crawl Stats
• Crawl Errors
• Robots.txt
• Measure the outcomes of your SEO 

Implementation
Google Crawl Stats #2
Fetch AsGoogle
Facebook Object Debug
F#!King Sorted
Thank you!

Mais conteúdo relacionado

Mais procurados

SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceDomingo Suarez Torres
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)Steve Souders
 
Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Brij Mishra
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS LimitationsValeri Karpov
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapiBrij Mishra
 
eZ Summer Camp 2014: interactive dive into ez product backlog
eZ Summer Camp 2014:  interactive dive into ez product backlogeZ Summer Camp 2014:  interactive dive into ez product backlog
eZ Summer Camp 2014: interactive dive into ez product backlogRoland Benedetti
 
Lessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODMLessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODMValeri Karpov
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015Valeri Karpov
 
JavaScript Framework Smackdown
JavaScript Framework SmackdownJavaScript Framework Smackdown
JavaScript Framework Smackdownmeghantaylor
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynotedmethvin
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Bibby Chung
 
Why You Need a Front End Developer
Why You Need a Front End DeveloperWhy You Need a Front End Developer
Why You Need a Front End DeveloperMike Wilcox
 
Structure style-story
Structure style-storyStructure style-story
Structure style-storyWordCamp
 
Setting up your development environment
Setting up your development environmentSetting up your development environment
Setting up your development environmentNicole Ryan
 
Live Project On ASP.Net Core 2.0 MVC - Free Webinar
Live Project On ASP.Net Core 2.0 MVC - Free WebinarLive Project On ASP.Net Core 2.0 MVC - Free Webinar
Live Project On ASP.Net Core 2.0 MVC - Free WebinarMohd Manzoor Ahmed
 

Mais procurados (20)

SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
 
Web Components
Web ComponentsWeb Components
Web Components
 
JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)JavaScript Performance (at SFJS)
JavaScript Performance (at SFJS)
 
Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5Building Modern Web Applications with ASP.NET5
Building Modern Web Applications with ASP.NET5
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS Limitations
 
Building rest services using aspnetwebapi
Building rest services using aspnetwebapiBuilding rest services using aspnetwebapi
Building rest services using aspnetwebapi
 
eZ Summer Camp 2014: interactive dive into ez product backlog
eZ Summer Camp 2014:  interactive dive into ez product backlogeZ Summer Camp 2014:  interactive dive into ez product backlog
eZ Summer Camp 2014: interactive dive into ez product backlog
 
Web dev syllabus
Web dev syllabusWeb dev syllabus
Web dev syllabus
 
Lessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODMLessons in Open Source from the MongooseJS ODM
Lessons in Open Source from the MongooseJS ODM
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015MongoDB MEAN Stack Webinar October 7, 2015
MongoDB MEAN Stack Webinar October 7, 2015
 
JavaScript Framework Smackdown
JavaScript Framework SmackdownJavaScript Framework Smackdown
JavaScript Framework Smackdown
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 
Blazor Full-Stack
Blazor Full-StackBlazor Full-Stack
Blazor Full-Stack
 
Why You Need a Front End Developer
Why You Need a Front End DeveloperWhy You Need a Front End Developer
Why You Need a Front End Developer
 
Structure style-story
Structure style-storyStructure style-story
Structure style-story
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Setting up your development environment
Setting up your development environmentSetting up your development environment
Setting up your development environment
 
Live Project On ASP.Net Core 2.0 MVC - Free Webinar
Live Project On ASP.Net Core 2.0 MVC - Free WebinarLive Project On ASP.Net Core 2.0 MVC - Free Webinar
Live Project On ASP.Net Core 2.0 MVC - Free Webinar
 

Semelhante a Angular SEO

External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Volkan Özçelik
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesVolkan Özçelik
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Mikael Svenson
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptxNishchaiyaBayla1
 
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...SEO Camp Association
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your websitehernanibf
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and ArchitectureTyto Software
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Chris Danford
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptKevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Kevin Read
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap
 
JavaScript Engine and WebAssembly
JavaScript Engine and WebAssemblyJavaScript Engine and WebAssembly
JavaScript Engine and WebAssemblyChanghwan Yi
 
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...Satisfying Business and Engineering Requirements: Client-server JavaScript, S...
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...Jason Strimpel
 
Demystifying JavaScript & SEO
Demystifying JavaScript & SEODemystifying JavaScript & SEO
Demystifying JavaScript & SEOBotify
 

Semelhante a Angular SEO (20)

External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012Java scriptwidgetdevelopmentjstanbul2012
Java scriptwidgetdevelopmentjstanbul2012
 
External JavaScript Widget Development Best Practices
External JavaScript Widget Development Best PracticesExternal JavaScript Widget Development Best Practices
External JavaScript Widget Development Best Practices
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
Training presentation.pptx
Training presentation.pptxTraining presentation.pptx
Training presentation.pptx
 
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...
L’importance du crawl du JavaScript : pourquoi, comment et pour quels bénéfic...
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
The things we found in your website
The things we found in your websiteThe things we found in your website
The things we found in your website
 
Dust.js
Dust.jsDust.js
Dust.js
 
Sahi Principles and Architecture
Sahi Principles and ArchitectureSahi Principles and Architecture
Sahi Principles and Architecture
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJS
 
JavaScript Engine and WebAssembly
JavaScript Engine and WebAssemblyJavaScript Engine and WebAssembly
JavaScript Engine and WebAssembly
 
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...Satisfying Business and Engineering Requirements: Client-server JavaScript, S...
Satisfying Business and Engineering Requirements: Client-server JavaScript, S...
 
Demystifying JavaScript & SEO
Demystifying JavaScript & SEODemystifying JavaScript & SEO
Demystifying JavaScript & SEO
 

Mais de Tiang Cheng

A Deep Dive into Javascript
A Deep Dive into JavascriptA Deep Dive into Javascript
A Deep Dive into JavascriptTiang Cheng
 
Run around Chrome Inspector
Run around Chrome Inspector Run around Chrome Inspector
Run around Chrome Inspector Tiang Cheng
 
HTML5 SVG Graphics @ Javascript Directions
HTML5 SVG Graphics @ Javascript DirectionsHTML5 SVG Graphics @ Javascript Directions
HTML5 SVG Graphics @ Javascript DirectionsTiang Cheng
 
PhoneGap @ Javascript Directions
PhoneGap @ Javascript DirectionsPhoneGap @ Javascript Directions
PhoneGap @ Javascript DirectionsTiang Cheng
 
Cloud Computing - A Project Review
Cloud Computing - A Project Review Cloud Computing - A Project Review
Cloud Computing - A Project Review Tiang Cheng
 
Running Successful University Industry Projects Barcamp 07
Running Successful University Industry Projects Barcamp 07Running Successful University Industry Projects Barcamp 07
Running Successful University Industry Projects Barcamp 07Tiang Cheng
 

Mais de Tiang Cheng (6)

A Deep Dive into Javascript
A Deep Dive into JavascriptA Deep Dive into Javascript
A Deep Dive into Javascript
 
Run around Chrome Inspector
Run around Chrome Inspector Run around Chrome Inspector
Run around Chrome Inspector
 
HTML5 SVG Graphics @ Javascript Directions
HTML5 SVG Graphics @ Javascript DirectionsHTML5 SVG Graphics @ Javascript Directions
HTML5 SVG Graphics @ Javascript Directions
 
PhoneGap @ Javascript Directions
PhoneGap @ Javascript DirectionsPhoneGap @ Javascript Directions
PhoneGap @ Javascript Directions
 
Cloud Computing - A Project Review
Cloud Computing - A Project Review Cloud Computing - A Project Review
Cloud Computing - A Project Review
 
Running Successful University Industry Projects Barcamp 07
Running Successful University Industry Projects Barcamp 07Running Successful University Industry Projects Barcamp 07
Running Successful University Industry Projects Barcamp 07
 

Angular SEO

  • 1. F#!king SEO Tackling SEO challenges on Javascript apps
 By Tiang Cheng (@tiang, tiangc@gmail.com)
  • 2. About Me • Full Stack at RateMyAgent.com.au • Passionate about Technology, Startups • Run Code and Scrum workshops at Learn2Code Melbourne and Collective Campus
  • 3. The Agenda • AngularJS + SEO challenges at ratemyagent.com.au • Solutions 
 (We found a few dead ends…) • Lessons Learnt and coding tips • Tools and resources
  • 4. SEO Challenges in NG • Assume all Search Crawlers cannot execute front end javascript • Solution must be fast, and easy to implement
  • 7. HashBangs get converted to escape fragment
  • 8. Server-side and front-end support for escaped fragment
  • 9. Prerending! • Pre-rending is using a programmatic browser to download your website (html + css + js), execute javascripts and styles the CSS, and return your website as a String • ie: “<html> fully rendered </html>”
  • 10. Rendering models: Snapshot • Prerenders your webpage, and caches it for future requests • Dynamic content can be outdated • Fast (use S3, or Redis caching solution) • Dependent on your headless browser…Can be buggy
  • 11. Rendering models: On the fly • Prerenders your webpage using a pre-rendering service for every request. • Can be slow to respond • Delivers up to date content
  • 12. Rendering models: Server Rendering • Renders your content on server-side • Fast and up to date • Double up on your coding
  • 13. Prerender considerations: • Choose a middleware layer, and pre-render service. • Middleware layer intercepts user’s HTTP requests, and if the user agent == “GoogleBot || FacebookExternalHit1.1 || BingBot || etc….”, then executes the PreRender code, else serve the base page to user • PreRender code executes a phantomJS headless browser, runs your website code, and then returns with the completed HTML
  • 14. Our SEO Journey • Middleware layer: PreRender_MVC • Attempt #1: We ran a hosted https://prerender.io/ • Attempt #2: Self-hosted Prerender.io service • Attempt #3: Rewrote our web server to serve a basic page
  • 15. Server Side Architecture • Middleware: .NET MVC Web Routes with ActionFilters
 
 
 
 
 • Rendering Engine: WebController + Razor Engine + Base HTML Templates
  • 16. Coding Tip #1: • Read the Google AJAX specifications
 https://developers.google.com/webmasters/ajax- crawling/docs/specification • Know thy enemy!
  • 17. Coding Tip #2: • Understand the different types of URLS in SEO: • Normal URL
 www.ratemyagent.com.au/andrewjames • Hashbang URL: 
 www.ratemyagent.com.au/#!/AndrewJames • Escape Fragment URL:
 www.ratemyagent.com.au/?_escaped_fragment_=/ andrewjames
  • 18. Coding Tips #3: • Always set your canonical URL meta tag, or use Breadcrumb Microdata • Otherwise your pretty URLS will show up with #!
 
 
 
 
 
 
 

  • 19. Coding Tips #4: • Turn off javascript on your browser to see how your website looks to a crawler. Check your meta tags!
 
 
 
 
 
 
 
 

  • 20. Coding Tips #5: • Log your pre-rendering calls and monitor 
 (We use Loggly)
 
 
 
 
 
 
 

  • 21. Tools and Resources • Google WebMaster Tools • Facebook Debug Object • PreRender.io • PhantomJS
  • 22. Google Webmaster Tools • Fetch as Google • Structured Data testing • Crawl Stats • Crawl Errors • Robots.txt • Measure the outcomes of your SEO 
 Implementation