# Reduce widget size

**URL:** <https://community.elfsight.com/t/reduce-widget-size/6026>\
**Category:** Google Reviews\
**Tags:** Released\
**Created:** [February 20, 2021, 5:36pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026 "2021-02-20T17:36:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaytee](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jaytee](https://community.elfsight.com/u/Jaytee)\
**Post date:** [February 20, 2021, 5:36pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/1 "2021-02-20T17:36:43Z")

</div>

Widget size/unused java script is slowing down page loading time significantly.

---

<div class="post-metadata">

**Author:** ![Helga](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/helga/32/1155_2.png) [@Helga](https://community.elfsight.com/u/Helga)\
**Post date:** [October 11, 2022, 12:00am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/2 "2022-10-11T00:00:00Z")

</div>

Folks, our former Wishlist portal, where our users shared their requests and suggestions, was transferred to this forum. You’re most welcome to vote, add new ideas, and leave your comments here — we surely will consider them all! 🤩

Original Votes: 4

---

<div class="post-metadata">

**Author:** ![Helga](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/helga/32/1155_2.png) [@Helga](https://community.elfsight.com/u/Helga)\
**Post date:** [August 23, 2022, 12:00am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/3 "2022-08-23T00:00:00Z")

</div>

Hello folks,

I’m happy to tell about the lazy loading beta version for embedded widgets, that might be a solution here!

It doesn’t work as a built-in option yet due to a couple of unresolved matters, but you can adjust your widget manually in order to make it work 🙂

To turn it on, please add the “data-elfsight-app-lazy” attribute to a

 element in your installation code.

For example, here’s how the code looks like initially:

```auto
<script src="https://apps.elfsight.com/p/platform.js" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX"></div>

```

  

And here’s how it should look like with the attribute added:

```auto
<script src="https://apps.elfsight.com/p/platform.js" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX" data-elfsight-app-lazy></div>

```

Please keep in mind that it will work only for widgets which are not in the initial viewport (e.g. users have to scroll down at least for a little bit before they reach the widget).

Please let me know if it worked for you!

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [October 19, 2022, 7:53am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/4 "2022-10-19T07:53:44Z")

</div>

Hey!

The code before and after is not showing for me. Could you please update it, would love to lazy load it on my website!

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Helga](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/helga/32/1155_2.png) [@Helga](https://community.elfsight.com/u/Helga)\
**Post date:** [October 19, 2022, 11:05am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/5 "2022-10-19T11:05:24Z")

</div>

Hi @Niels, welcome to the community forum! 😍

My apologies for this, it seems the codes got distorted when transferring from the previous portal—but all is good now 🙂

Could you please try them and let me know if it worked?

---

<div class="post-metadata">

**Author:** ![Jaytee](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jaytee](https://community.elfsight.com/u/Jaytee)\
**Post date:** [October 19, 2022, 12:43pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/6 "2022-10-19T12:43:19Z")

</div>

Hi Helga,

is the widget supposed to be smaller in size now? From everything I can tell in Page Speed Insights, it’s not. But maybe I’m doing something wrong/am missing something. I did apply the new code.

Thanks!

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [October 19, 2022, 1:03pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/7 "2022-10-19T13:03:33Z")

</div>

I am also having problems where sites like Lighthouse, GTMetrix and Google report that the payload of Elfsight is “enormous”. Anything I can do about this? Looks like it messes up my site speed quite significantly.

> **[GTmetrix Performance Report](https://gtmetrix.com/reports/fiks.nl/TFomuYs8/)**
>
> GTmetrix Grade: E (Performance: 46% / Structure: 81%)

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [October 20, 2022, 12:47pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/9 "2022-10-20T12:47:42Z")

</div>

Hello @Niels!

This is Maksim stepping in for Helga!

I am deeply sorry for any inconvenience caused!

Unfortunately, the Reviews script size is quite big. Please accept my sincere apologies!

We are working on it and will try to improve the situation as much as possible!

I’ve forwarded your request to our devs and they will try to reduce its size. I’ll keep you updated 😉

---

<div class="post-metadata">

**Author:** ![Jaytee](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jaytee](https://community.elfsight.com/u/Jaytee)\
**Post date:** [October 20, 2022, 3:09pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/10 "2022-10-20T15:09:17Z")

</div>

Thanks - what Niels is saying is exactly why I’d made the post originally, because it slows down performance and thus affects user experience and Google rankings.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [October 20, 2022, 7:44pm UTC](https://community.elfsight.com/t/reduce-widget-size/6026/11 "2022-10-20T19:44:22Z")

</div>

Hello @Jaytee!

Thank you for your kind feedback 🙂 I totally understand your point.

We’ll try all our best to improve it and make our customers a bit happier!

---

<div class="post-metadata">

**Author:** ![Jaytee](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jaytee](https://community.elfsight.com/u/Jaytee)\
**Post date:** [October 24, 2022, 11:25am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/12 "2022-10-24T11:25:58Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [October 28, 2022, 9:43am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/13 "2022-10-28T09:43:03Z")

</div>

Hi @Max ,

Just did a quick test and the script is really impacting performance a lot. Do you perhaps have a timeline on when speed could be improved? Due to the big impact I think in the meantime we will stop using it until it’s fixed.

Screenshots of our test attached.

 ![Xnapper-2022-10-28-16.42.11](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/2X/6/66be5f5050919f7336963088a442991e67ee8e24.jpeg)

I would suggest to just load the latest 5 reviews and have a link to the google reviews page on Google if users want to see more. It loads quite a lot of reviews now, but no idea if that would speed up performance a lot.

Maybe an iframe that is lazy loaded would help as well? Not sure tho.

Seems that the main thing the widget is effecting is the Total Blocking time.  
Also 1,369 ms total Javascript execution time, which is a lot.

I’d be happy to test things out if you have beta versions ready. Feel free to reach out.

Best,  
Niels

---

<div class="post-metadata">

**Author:** ![ivanenko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/ivanenko/32/756_2.png) [@ivanenko](https://community.elfsight.com/u/ivanenko)\
**Post date:** [November 2, 2022, 9:18am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/14 "2022-11-02T09:18:25Z")

</div>

Hi @Neils,

Just to be on the same page could you please tell me whether you’re using the lazy-loading or not?  
Anyway it would be so kind of you if you can share the page URL for me to check it out.  
I’m sure we can make it better.

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [November 2, 2022, 9:24am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/15 "2022-11-02T09:24:46Z")

</div>

Hi!

Yes I am using the lazy-loading addition. It’s not on my homepage anymore, the performance simply is too bad. I could embed it on our testing environment. Would that help?

---

<div class="post-metadata">

**Author:** ![ivanenko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/ivanenko/32/756_2.png) [@ivanenko](https://community.elfsight.com/u/ivanenko)\
**Post date:** [November 2, 2022, 9:26am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/16 "2022-11-02T09:26:57Z")

</div>

I believe it would. Let’s give it a try.

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [November 2, 2022, 9:49am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/17 "2022-11-02T09:49:13Z")

</div>

I don’t want a referring url to our testing environment so it’s: sandbox . fiks.nl without the space bars 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [November 2, 2022, 9:51am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/18 "2022-11-02T09:51:36Z")

</div>

Haven’t tested this, but what about something like this?

```auto
var scrollLoader = function() {
// script here
    window.removeEventListener('scroll', scrollLoader);
}

window.addEventListener('scroll', scrollLoader);

```

Would that work u think?

---

<div class="post-metadata">

**Author:** ![ivanenko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/ivanenko/32/756_2.png) [@ivanenko](https://community.elfsight.com/u/ivanenko)\
**Post date:** [November 2, 2022, 10:24am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/19 "2022-11-02T10:24:39Z")

</div>

Thank you. It seems we got an interesting case here. I should admit that the lazy-loading feature is quite “young” if we can say so. We thoughtfully [tested it](https://community.elfsight.com/t/you-now-can-improve-your-pagespeed/2562/22) in standard environments. A bunch of our customers have successfully configured it on their websites. However, it looks like we missed something and your case gonna help us revealing what. Please could you keep the widget on the sandbox page for some time and let me investigate and think a bit?

---

<div class="post-metadata">

**Author:** ![Niels](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@Niels](https://community.elfsight.com/u/Niels)\
**Post date:** [November 2, 2022, 10:30am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/20 "2022-11-02T10:30:28Z")

</div>

will do!

---

<div class="post-metadata">

**Author:** ![ivanenko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/ivanenko/32/756_2.png) [@ivanenko](https://community.elfsight.com/u/ivanenko)\
**Post date:** [November 3, 2022, 11:23am UTC](https://community.elfsight.com/t/reduce-widget-size/6026/21 "2022-11-03T11:23:22Z")

</div>

Hi @Niels,

Just a quick update from me. I’ve found that the lazy-loading feature is not working properly when a widget is being added in a late document mutation - which is happening on your site when it’s opened on a mobile device. By the way, the lazy-loading works on a desktop as expected. I’m going to deploy the fix to our platform early next week once the change gets approved by my peers. I’ll keep you in the loop. Thanks for the sample, your help is crucial 🤘

[Next page](https://community.elfsight.com/t/reduce-widget-size/6026.md?page=2)
