4

I hope that the contents which is pulled on page load could be crawled by google robot, how to do that ?

I went to Google Webmasters tool to ensure that whether Google crawler could see the content pulled by the script or not, but sadly the crawler do not see that.

I know there are some ways to make AJAX content crawlable. like http://moz.com/blog/how-to-allow-google-to-crawl-ajax-content the way is put query parameter on url after !#. But my query parameter is in script?

<script src= "https://script.google.com/macros/s/AKfycbwjTaclaKdzdr4IgCOM_PpIWJvxFSGkz2qLgrhfJ5fNYf09djI/exec?id=1rnLnui4IXBKZcsDH5zxFHS_rO4TpRPGQD9RY4C_OMAc&callback=pullDone"></script>

Demo page: http://radiansmile.github.io/web/Test/ajax_at_Initial.html

How could I solve this problem?

1
  • This can be done easily using server-side code. Unfortunately you are not able to do that, I my self had been struggling with this kind of Ajax problems also, after a while I decided to switch to MVC.NET and it's a damn right choice. Hope you can fix yours! Nov 7, 2014 at 3:47

1 Answer 1

1

The solution would be to serve the content as html for search engines and js for normal users. But that should be done in a way that is not considered cloaking. So the ideal way for it to happen would be to have exactly two copies of the same page - one using js and another using html and render the page accordingly based on the user agent of the requester. If a crawler is found, serve the html version of the page, and for others, serve the js based page. There are services that convert a page into html, cache it, identify the user agent and serve accordingly. Prerender is one such service.

1
  • But my site is host in a cloud space which host only pure html and js. I could not setup server code like Apache or node.js, so prerender.io could not fit my need. Maybe I should try separate the html for crawler and user manually ? Aug 9, 2014 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.