4 ms·
Don't do this. Rendering different content based on user agent is tempting the webspam gods. Rendering nothing but a big gob of javascript to non-googlebot us
by timr 13y ago
Don't do this.
Rendering different content based on user agent is tempting the webspam gods. Rendering nothing but a big gob of javascript to non-googlebot user agents is a recipe to get the banhammer dropped on your head.
You're either gambling that Google is smart enough to know that your particular big gob of javascript isn't cloaking keyword spam (in which case you should just depend on their JS evaluation, since you already are, implicitly), or you're gambling that they won't bust you even though your site looks like a classic keyword stuffer.
- robmcm 13y agoGoogle actually recommend you do this, provided it's the same content that is shown with JS enabled: https://support.google.com/webmasters/answer/66353 https://support.google.com/webmasters/answer/66353 "JavaScript: Place the same content from the JavaScript in a <noscript> tag. If you use this method, ensure the contents are exactly the same as what’s contained in the JavaScript, and that this content is shown to visitors who do not have JavaScript enabled in their browser." This was done for years with Flash sites and I never saw Google black list anyone doing it legitimately. You can also provide different content if you want the content to be behind a pay wall, although personally I find this is a little annoying.
- timr 13y agoPlacing the text content on the same page in a <noscript> tag is entirely different than rendering different content based on user agent. That's what the noscript tag is meant to do -- Google is telling you to follow best practices for fallback to non-JS browsers.
- gcb1 13y agoand much easier btw
- benaiah 13y agoHiding keyword spam behind JS doesn't make any sense in this situation - the whole point is that the JS isn't being served to Google. That's who keyword spammers are trying to fool, not actual humans.
- timr 13y agoIt works either way. If I'm allowed to serve a big blob of javascript to my users and not to the googlebot, I load up my googlebot page with keyword content, and use the JS blob to render my "secret" page to real users.
- stephenheron 13y agoGoogle does have a section within their guidelines on creating "HTML Snapshots". "If a lot of your content is created in JavaScript, you may want to consider using a technology such as a headless browser to create an HTML snapshot." https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot https://developers.google.com/webmasters/ajax-crawling/docs/...
- Wintamute 13y agoWell said. Really not sure why your parent is recommending against this, when Google are recommending in favour of it in their webmaster docs ...
- timr 13y agoDid you read that page, or did you just skim it? They're telling you to use a "headless browser" as one possible (clunky) way of responding to _escaped_fragment_ requests, which is a workaround wherein you put a special tag in your original page to tell the googlebot to make another request to get a static version of the page. Using _escaped_fragment_ is not the same thing as rendering different content based on user agent.