0

To improve my site performance I'm trying to lazy load images only when they are available to viewport and to make sure google bot index them.

I'm doing lazy loading as per below steps:

  1. Created a component using Intersection Observer to lazy load images based on view port.
  2. Added following Intersection observer polyfill to support lazy loading in all browsers
  3. I've used <noscript> to load images in non lazy way in order for google bot to index images in a non supported JavaScript browsers.

So now I want to test this lazy load images to make sure SEO is not impacted. As Google recommended, I tested this change with Google's Puppeteer script to verify whether the lazy loaded images are properly indexed by GoogleBot. But when I run the script I get this failed response:

Lazy images loaded correctly: Failed
Found 160557 pixels differences.
Dimension image A: 300x719
Dimension image B: 300x719

I'm doing this exercise for the first time but I'm unable to find a way to fix why the script is failing.

Here are the things I am stuck on in particular:

  1. Do I still need to worry about SEO indexing even after using Intersection observer API with polyfill?
  2. Do we really need to load images inside <noscript> tag for google bot to index images in non supported JavaScript browsers?
  3. I'm only lazy loading images but I don't have any place holder yet to display while the image is in loading state. Could this be a reason for Puppeteer script failure?
  4. Is there anything else that I'm missing here and that's why the script is failing?

Edit

I also saw that Puppeteer script is waiting for certain amount of time let’s say 2000 to capture screenshots one without page scrolling and one after page scrolling. So if this is the case, then how can I load images within that time?

Puppeteer results screenshot

halfer
  • 19,824
  • 17
  • 99
  • 186
Hemadri Dasari
  • 32,666
  • 37
  • 119
  • 162

1 Answers1

1
  1. Do we really need to load images inside <noscript> tag for google bot to index images in non support javascript browsers?

I don't think it makes sense to support non-JS browsers in any circumstance, even with SEO. A lot of webpages need JavaScript to load and still don't use noscript.

  1. I'm only lazy loading images but I don't have any place holder yet to display while the image is in loading state. Could this be a reason for pupeteer script failure?

It is hard to tell.

  1. Is there anything else that i'm missing here and thats why the script is failing?

The best way to debug this is to take a screenshot using page.screenshot and see what is different.

Tips

Shivam
  • 1,345
  • 7
  • 28
  • Thanks for your suggestions. Yeah I agree but everywhere it was recommended to use noscript so that google bot will index them even if user manually disables JavaScript. I also saw that puppeteer script is waiting for certain amount of time let’s say 2000 to capture screenshots one without page scrolling and one after page scrolling. So if this is the case, then how can I load my images within that time? – Hemadri Dasari Aug 06 '21 at 01:40
  • I've updated my question with puppeteer screenshot as well. Can you please advise what could be the reason for failure – Hemadri Dasari Aug 06 '21 at 13:55
  • Is it 3 screenshots combined? Can you please explain the screenshot for me to better understand what is happening? Thanks. – Shivam Aug 06 '21 at 14:03
  • Its result of puppeteer script. I've shared full result page screenshot in the question again. Can you please check again – Hemadri Dasari Aug 06 '21 at 14:27
  • Sorry for the delay, but it looks like the page after scrolling just has each image one right on the Featured Properties area. All the images are loading properly it seems. – Shivam Aug 07 '21 at 00:56
  • Maybe there is some code in your app that clicks the left arrow but only on Googlebot. – Shivam Aug 07 '21 at 00:57
  • Understood it make sense. I will check it out. So do you mean somehow google bot is doing the left arrow click while scrolling? – Hemadri Dasari Aug 07 '21 at 05:07
  • Do you have any idea why the puppeteer script passes 5 times and fails once. its happening constantly like 5(Passed):1(failed) ratio. Is this natural behavior of puppeteer script can we take this result as SEO indexing works or it has to be passed all the time – Hemadri Dasari Aug 07 '21 at 14:09