title: Google bot crawling on AngularJS site with HTML5 Mode routes
body: <p>We have an AngularJS site using HTML5 routes. I just did some test "Fetch as Google" runs. The results are a bit confusing:    </p>
  
  <ul>
  <li>On the fetching tab, I see our site as it looks on view source, with all the front end bindings {{ }}, and not all the HTML rendered</li>
  <li>On the rendering tab, our site looks perfectly fine, no {{ }} variables, it seems like Google bot fetched and rendered the site fine, which is maybe in line with this, <a href="http://googlewebmastercentral.blogspot.ae/2014/05/rendering-pages-with-fetch-as-google.html" rel="noreferrer">http://googlewebmastercentral.blogspot.ae/2014/05/rendering-pages-with-fetch-as-google.html</a>. </li>
  </ul>
  
  <p>However, we are already prepared for Google to not be able to crawl our site, so we have already added , so the Google bot revisits our page with “?_escaped_fragment_=". We followed this, <a href="https://developers.google.com/webmasters/ajax-crawling/docs/getting-started" rel="noreferrer">https://developers.google.com/webmasters/ajax-crawling/docs/getting-started</a> (section "3. Handle pages without hash fragments"). In our Nginx config we have something like this:</p>
  
  <pre><code>if ($args ~ "_escaped_fragment_=") {
      serve the static HTML snapshots
  }
  </code></pre>
  
  <p>, and indeed it works fine, if we pass the _escaped_fragment_= ourselves. However, the Google bot never tried to crawl our site with this param, so it never crawled the snapshot. Are we missing something? Should we also add agent detection for Google bot on our Nginx conf? Something like this?</p>
  
  <pre><code>if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") {            
  
  server from snapshots
  
  }
  </code></pre>
  
  <p>It would be great if we can understand this better, thank you so much in advance!</p>
  
  <p><strong>UPDATE:</strong><br>
  I just read this, <a href="http://scotch.io/tutorials/javascript/angularjs-seo-with-prerender-io?_escaped_fragment_=tag#caveats" rel="noreferrer">http://scotch.io/tutorials/javascript/angularjs-seo-with-prerender-io?_escaped_fragment_=tag#caveats</a>. So, it seems that when using the manual tools (Fetch as Google), we should pass ourselves either #! or ?_escaped_fragment_= in the right place. Indeed, if I pass ?_escaped_fragment_= in our case, I do see the HTML snapshot that we have created.</p>
  
  <p>Is that true? Is this how it works indeed?</p>
  
  <p><strong>UPDATE 2</strong>
  On the bottom of this thread, a Google employee verifies that for Google Webmasters "Fetch as Google", you need to manually pass the _escaped_fragment_= param yourself, <a href="https://productforums.google.com/forum/#!msg/webmasters/fZjdyjq0n98/PZ-nlq_2RjcJ" rel="noreferrer">https://productforums.google.com/forum/#!msg/webmasters/fZjdyjq0n98/PZ-nlq_2RjcJ</a>  </p>
  
  <p>Cheers,<br>
  Iraklis</p>