How to avoid overide of different widgets

  • Issue Description:
    I am using age verification, WhatsApp, and back-to-top widgets on all pages, however, I can only see one. How can I fix this?
  • Link to the page with the widget in question:
  • www.budscure.com
1 Like

Hello @Wess_Zheng! I have checked your website and wasn’t able to find the WhatsApp Chat and Back to Top installation codes:


In this case, could you please install the widgets back if you removed them - Adding Elfsight widget to Hostinger website - Elfsight Help Center? :pray:

I did not remove or uninstall the widgets. One came and the other just disappeared. and I am also adding social sharing button, it was gone too.
please help.

Hey @Wess_Zheng, thanks for clarifications!

Our devs have reviewed your website and reported to me that they found only the code for the Back to Top widget. This suggests that there might have been a small issue with the code you added :pray:

They recommend trying to update the current installation in the Integrations → Custom Code section with the following updated code:

<script src="https://static.elfsight.com/platform/platform.js" async></script>
<script>
        (() => {
                const widgets = [
                        "elfsight-app-2fc03286-84bf-4803-ad71-3d76216f8ad3",
                        "elfsight-app-7b493df9-293e-423a-a6fc-0f722b1252d1",
                        "elfsight-app-8260d3b6-886a-4a55-8946-a2f2a307e54d",
                        "elfsight-app-3d06f326-d466-4053-a326-3d48c030ab65"
                ];

                const installWidget = (widgetId) => {
                        const widget = document.createElement("div");
                        widget.classList.add(widgetId);
                        document.body.appendChild(widget);
                };

                const installWidgets = () => {
                        widgets.forEach((widgetId) => {
                                installWidget(widgetId);
                        });
                }

                if (document.readyState === 'loading') {
                        document.addEventListener('DOMContentLoaded', installWidgets);
                } else {
                        installWidgets();
                }
        })();
</script>

Could you please try this code and let me know how it goes?