what are the rules with google (or any other search engine) in regards to cloaking (e.g. showing different content for bots vs real users)

The question is what if we want to load certain content only when the user scrolls/interacts but still have google/bots (which doesn’t scroll) crawl that content.. Would it be OK to have a condition in JS that checks if this is a BOT (via userAgent) and loads that content.. but for regular user (non bots) this will only happen when they first interact with the page (e.g. mousemove keypress scroll).

It is not really cloaking as by the end of the day the content will be the same for both (as soon as the user interacts with the page)

In this particular example this is about navigation mega Menu that fetches data and loads only upon user's first interaction. This increases the page performance by not fetching unnecessary calls and heavy DOM before it is ever needed.

Sample code:

  // load and render content
} else {
 onFirstInteraction.then(event => {
  // load and render content

1 Answer 1


What you're talking about is called an infinite scrolling page (E.g. TechCrunch which just loads a new article as you keep scrolling down).

The SEO advice from Google regarding the matter is to ensure you also have a paginated series available. The infinite scrolling will help users, while the pagination will allow Google to jump through pages and see the rest of the content.

You can read more here: https://webmasters.googleblog.com/2014/02/infinite-scroll-search-friendly.html

I would highly recommend against filtering by user-agent. There's a high risk of that being considered cloaking.

  • Not exactly like infinite scrolling, it is rather a navigation mega menu that is deferred to load only after interactions..
    – adardesign
    Commented Dec 19, 2019 at 18:37
  • I get deferring loading of a menu for performance, but it seems like it could be deferred until after page load rather than until user interaction. Then users and bots would both see it. Commented Dec 19, 2019 at 18:54

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.