Can your website rank in Google with content placed in js events like onScroll, onClick or after timeout? How long will Google wait for your content? What does it mean in terms of your content placement approach? The answers are below.
by Slawek Czajkowski
Legitimate methodology is crucial for every test. When creating test environment we pay attention to eliminate as many external signals as possible. That is why we run every test on new domains with clean history in terms of traffic and behavioral signals. Every test is based on unique keyword which was not used on any other website before.
First, we need to determine groups that we will be testing:
|5 seconds timeout||after 5 seconds||robot waits or simulates short waiting|
|60 seconds timeout||after 60 seconds||robot waits or simulates long waiting|
|onScroll event||after scrolling||robot scrolls the page to reveal content|
|onClick event on a||after clicking on an anchor||robot clicks on links|
|onClick event on span||after clicking on a span||robot clicks on arbitrary elements|
For each of the case, we create a website that has:
After we have all websites set up, we verify them in Search Console and request Google indexing. Then we make sure the domain has been indexed and we are ready to go!
After searching each of our unique keywords, we were able to identify following results:
|group||visible on SERP?|
|5 seconds timeout||✅|
|60 seconds timeout||❌|
|onClick event on||❌|
|onClick event on||❌|
Except of control group, the only recognized and ranked content was the timeout with 5 second delay. Despite of showing up on SERPs, it did not appear on text-only cache.
These test results inspired us to conduct another test. We wanted to answer the question:
If the keyword was recognized after 5s but wasn't for 60s timeout, what is exactly the time that robot "waits" for timeouts?
A naive way of testing this case would be to increase timeout by one second until our keyword is no longer indexed. It would work, but it's a very time consuming way, eg. if the wall is at 30 seconds, we need to create 25 test cases.
To do it more efficiently, we utilized technique called "binary search".
We know the robot waits 5 seconds, but it fails to index content for 60 seconds timeout. To pick the next case, we calculate the midpoint using following formula:
(successful case + failed case) / 2
The first test turned out to be at (5 + 60) / 2 = 33 seconds. This test failed, so we calculated the time again: (5 + 32) / 2 = 19. This one turned out successful, let's do the math again: (19 + 32) / 2 = 26. Test for 26 seconds finally failed, which means the wait time is somewhere in between 19 and 26.
We concluded our tests at this point, knowing that robots wait between 19 and 26 seconds for content to appear.
Another thing we noticed is that content with 5 second delay was indexed immediately, while longer timeouts required a few hours to be seen by Google.
This is only the beginning of our testing journey. In case you want to suggest a test or you have any feedback about this particular test, make sure to leave a comment below.