How to improve PageSpeed score of a page with our widget
We are happy to inform you that we now have a new lazy loading feature, which will help you significantly improve Google Page Speed Score of the page where the widget is installed.
This new method makes the widget load only when a visitor interacts with the page, e.g. scroll or simply move the mouse over the page's content. Thus, the widget is not loaded immediately, so the page speed performance shouldn’t be affected.
Once you make sure that the widget is installed in the right place, you can move on to creating code for lazy loading.
To do it, you just need to add the “data-elfsight-app-lazy” attribute to the <div> element of your installation code. For example, here’s what the code looks like initially:
<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script> <div class="elfsight-app-86c61122-896c-43d7-a080-5709c75753f7"></div>
And here’s what it should look like with the attribute added:
<script src=“https://static.elfsight.com/platform/platform.js” data-use-service-core defer></script> <div class=“elfsight-app-86c61122-896c-43d7-a080-5709c75753f7" data-elfsight-app-lazy></div>
The code is ready! Now you should add this code to your website and the PageSpeed score will become better.
If you still need our assistance, please feel free to contact our Support Team, we will be delighted to help.