Page Speed After widget

We have created a widget for Google review and implemented it on our webpage. We have checked the page speed insights from Google and found that platform.js is getting deferred but it is calling GoolgeReviews.js which is not deferred and blocking the main thread. This is decreasing the SEO score and reducing the page load speed.

Can you please check why GoogleReviews.js is not getting deferred?

1 Like

Hey there @Weekend_Feels

Glad to see you aboard! Welcome to Community :wave:

If you could send me a link to the webpage where your widget is installed, I would be really happy to check things for you :slightly_smiling_face:

Hey Max,

We have implemented this on one webpage only as of now. Please find below the webpage:

The Review js is blocking our main thread. The platform js seems to be working as deferred, but not the Review js. We will need this issue resolved for all our widgets and we can implement after that only.

I’m really sorry that our widget affects your website’s PageSpeed score. However, the good news is that we have a way of improving the performance.

You are very welcome to reinstall your widget by using some kind of lazy loading.

To make it work, you need to:

  1. Add a data-elfsight-app-lazy attribute to the widget installation code. Here’s what the installation code will look like [Changing WIDGET_ID to actual one required] :

<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script> <div class="elfsight-app-WIDGET-ID" data-elfsight-app-lazy="first-activity"></div>

  1. Move the widget installation code given above lower on the page . At the moment the code is added to the header, I recommend you to place it in the footer of the page.

Keep in mind that after installing the widget with the attribute, for the widget to appear on the page, the visitor will need to interact with the page, at least move the cursor.

Here is the article explaining this feature in a more detailed way - How to improve PageSpeed score of a page with our widget.

Please let me know whether this workaround helped you improve the score :slightly_smiling_face:

Thanks, Max. It worked!

1 Like

Wow, that’s great!

You are always welcome :wink: