0
votes

I have an aspx application. In every GET the server respond with a "basic" html containing everything except table grids.

This "grid information" is contained in a input type hidden (json format) in the page.

This is by design and cannot be changed.

A normal visitor wil see the page HTML:

head, body, scripts, meta tags
text, labels, inputs... 

<div id='gridcontainer'></div> 
more html 
more html 

Then onpage load I render dynamically by using javascript a table inside div (gridcontainer). So after onload event is executed, the user see also the table grid inside div.

In this situation google is not indexing the information in tabular grids, because it is rendered by javascript after page load.

The application has the ability to render the exact same content in HTML without using javascript (loosing some functionality). When I say the same exact content I really mean the same page (same content, same headers, same metatags, same title), but not being render by javascript. The content length may be diferent if we compare both responses because HTML responses might be bigger than html + json + javascript.

This is what I want the spider to see:

head, body, scripts, meta tags
text, labels, inputs... 

<div id='gridcontainer'>
<table> table row 1, table row2.....<table>
</div> 
more html 
more html 

To sum up, I want to deliver the "HTML" version to spiders and the other (javascript rendered) to visitors.

Is this cloaking? This may be dangerous to search engines or is a total legal method if the content I am displaying is totally the same (no tricks).

Thanks in advance!

3

3 Answers

1
votes

If the content is basically the same and a human viewer would say that it's the same content, then it's legal. I know of a fairly major site that does this with Google's blessing. Any site that has a page that is largely generated with client-side JS has to do something like this for Google to see anything useful. Since Google doesn't currently evaluate Javascript, there is no other choice for a page that use JS-generated HTML.

I don't know if there's a way to get Google's blessing to avoid any accidental penalty.

The important point is that the actual content of the page needs to be the same. The details of the formatting does not have to be identical.

0
votes

Note: For legal advice, contact a lawyer.

Yes, this is 'cloaking'.

Yes, it's morally questionable.

But No, it isn't illegal. *(subject to the disclaimer at the top of this answer)

But either way don't do it, because Yes, Google will kill your rankings if they catch you trying to serve content to them which the user doesn't get to see.

0
votes

If you use progressive enhancement you won't have any issues at all. What you would do is serve the HTML version so users who don't have JavaScript enabled can still see the content. Then add JavaScript that, when the page loads, removes the current HTML and adds the enhanced version of that same content. They key is that the content is the same, just the experience is different due to lack of JavaScript capabilities. This will never get you in trouble with the search engines and is great accessibility. Accessibility is one of the main tenants of SEO.