we are developing a corporate website, where all the navigation is done using hashs (http://xxx/#/content/xpto
), and the content is dynamically loaded using AJAX. The role stuff is already working fine, and we are getting good results from it. The question (or issue) I have is this, as the navigation is completely done using hashs and no page load (URI change) is actually present, we are changing the “META” tags (*using something like $('meta[property="title"]').attr('content', metainfo.title);
) in the code. Does Google’s SEO engine or Facebook’s page runtime, can understand this meta changes made by the code, i.e. http://myurl.com/#/load/products
, or the content is analysed by processing the HTML content from the server (html stuff <html><head>blah blah blah</head></html>
)?
Thanks in advance guys.
3
Answers
If anyone is struggling with the same problem that I was, the answer is not quite simple. Unfortunately, for situations where the page is created using complex JS processes, the most common "headless" browsers in the market (including the one's Google recommends - HtmlUnit, watiji or Crawjax) don't do the trick.
The solution I found wasn't very elegant, but it worked. I've implemented a C++ indexing service using http://www.awesomium.com/. They have a very straightforward solution based on Google's chromium API. Of Course, a few "JS" animations had to be removed, but anyways, the HTML snapshots are being generated as expected.
A detail information on how to construct full crawler drones for Google can be found here (as OX stated - thx): https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
You can’t do dynamic meta tags (or well, you can, but Google and Facebook won’t run your JavaScript so they won’t do you any good), but you can follow Google’s guide for making AJAX applications crawlable. I don’t know if Facebook has a similar guide.
It seems that you can use JS to change the meta tags dynamically, as mentioned in this post:
https://developers.google.com/search/docs/guides/javascript-seo-basics#titles-and-snippets