views:

19

answers:

1

On a website, there are many pages with a component for users to leave comments. To reduce page load time and since few users use the commenting system, the commenting component is loaded via AJAX after the page is loaded. The issue: how can we get Google to index dynamic content that is loaded via AJAX on page load?

Many other pages on AJAX & SEO suggest letting Google index the content as a separate page. This is not a valid solution here - we do not want the comments for an item to be a unique page.

The solution we are considering:

Create two versions of the page (one static, one dynamic):

  • www.example.com/page/comments_on (load comments statically)
  • www.example.com/page (load comments after page load via AJAX)

Then, set the canonical URL of www.example.com/page/comments_on to www.example.com/page. We would put both URLs in our sitemap.xml.

Will this work? What are the downsides to this approach? What other approaches are there to handle this situation?

+1  A: 

Google has a system for doing this. It basically involves creating special URLs to static versions of HTML to index.

Source: http://code.google.com/web/ajaxcrawling/docs/learn-more.html

Adam
While this is a potentially viable solution, unfortunately we are not currently using the "#!" syntax to track state. In fact, in this case, there is no state to track, we simply load additional content on load. Nonetheless, I will think more about whether this is viable in this case.
jeremy