Is google rich snippet automatic after installing google review widget?

No worries about the Google Reviews with Photos. You can use the Full reviews instead.

2 Likes

Got you!

I’ve passed it on to the devs and will update you once everything is done :slightly_smiling_face:

1 Like

Thank you for waiting!

The widgets are reinstalled and the issue with the mobile display is fixed. Please check your website and let me know if everything is fine now :slightly_smiling_face:

Just in case, here is the full code we’ve added to the Custom Code section in your Wix dashboard to reinstall the widgets:

<script>
  (function() {
    const languages = ['de', 'it', 'es', 'fr', 'zh'];
    
    const pages = {
  '': ['FLOATING', {
    DEFAULT: 'elfsight-app-9a03df4d-6212-4d4e-8546-23817defadec',
    de: 'elfsight-app-137a42f0-6702-441f-b444-4ac6b5352f90',
    es: 'elfsight-app-13252902-712f-4dcc-8112-8dd32fb2fdc8',
    fr: 'elfsight-app-670c98ea-513a-4eda-b9a8-b80b5de06e9b'
  }],
  'reviews': ['[data-mesh-id="comp-m71zuwcginlineContent-gridContainer"]', {
    DEFAULT: 'elfsight-app-337678e9-fc51-4ddd-9c5c-d9c17121291d',
    de: 'elfsight-app-4b78797d-5ff0-470c-aeab-8d1a6e6db616',
    es: 'elfsight-app-be815bcf-a606-4b7f-810a-c685da1d3e43',
    fr: 'elfsight-app-3ed288dd-7fd4-4b51-8046-5d44a7d8f0ce'
  }],
  'cenotes': ['FLOATING', {
    DEFAULT: 'elfsight-app-9a03df4d-6212-4d4e-8546-23817defadec',
    de: 'elfsight-app-137a42f0-6702-441f-b444-4ac6b5352f90',
    es: 'elfsight-app-13252902-712f-4dcc-8112-8dd32fb2fdc8',
    fr: 'elfsight-app-670c98ea-513a-4eda-b9a8-b80b5de06e9b'
  }],
  'courses': ['FLOATING', {
    DEFAULT: 'elfsight-app-9a03df4d-6212-4d4e-8546-23817defadec',
    de: 'elfsight-app-137a42f0-6702-441f-b444-4ac6b5352f90',
    es: 'elfsight-app-13252902-712f-4dcc-8112-8dd32fb2fdc8',
    fr: 'elfsight-app-670c98ea-513a-4eda-b9a8-b80b5de06e9b'
  }],
  'rates': ['FLOATING', {
    DEFAULT: 'elfsight-app-9a03df4d-6212-4d4e-8546-23817defadec',
    de: 'elfsight-app-137a42f0-6702-441f-b444-4ac6b5352f90',
    es: 'elfsight-app-13252902-712f-4dcc-8112-8dd32fb2fdc8',
    fr: 'elfsight-app-670c98ea-513a-4eda-b9a8-b80b5de06e9b'
  }],
  'contact': ['FLOATING', {
    DEFAULT: 'elfsight-app-9a03df4d-6212-4d4e-8546-23817defadec',
    de: 'elfsight-app-137a42f0-6702-441f-b444-4ac6b5352f90',
    es: 'elfsight-app-13252902-712f-4dcc-8112-8dd32fb2fdc8',
    fr: 'elfsight-app-670c98ea-513a-4eda-b9a8-b80b5de06e9b'
  }],
  'our-team': ['#comp-lu10u77d', {
    DEFAULT: 'elfsight-app-337678e9-fc51-4ddd-9c5c-d9c17121291d',
    de: 'elfsight-app-4b78797d-5ff0-470c-aeab-8d1a6e6db616',
    es: 'elfsight-app-be815bcf-a606-4b7f-810a-c685da1d3e43',
    fr: 'elfsight-app-3ed288dd-7fd4-4b51-8046-5d44a7d8f0ce'
  }],
  'itinerary': ['#comp-lditfkk8', {
    DEFAULT: 'elfsight-app-337678e9-fc51-4ddd-9c5c-d9c17121291d',
    de: 'elfsight-app-4b78797d-5ff0-470c-aeab-8d1a6e6db616',
    es: 'elfsight-app-be815bcf-a606-4b7f-810a-c685da1d3e43',
    fr: 'elfsight-app-3ed288dd-7fd4-4b51-8046-5d44a7d8f0ce'
  }],
  'what-is-a-cenote': ['#comp-ldj82upt1', {
    DEFAULT: 'elfsight-app-337678e9-fc51-4ddd-9c5c-d9c17121291d',
    de: 'elfsight-app-4b78797d-5ff0-470c-aeab-8d1a6e6db616',
    es: 'elfsight-app-be815bcf-a606-4b7f-810a-c685da1d3e43',
    fr: 'elfsight-app-3ed288dd-7fd4-4b51-8046-5d44a7d8f0ce'
  }],
  'our-selection-of-cenotes': ['#comp-lesbngvn', {
    DEFAULT: 'elfsight-app-337678e9-fc51-4ddd-9c5c-d9c17121291d',
    de: 'elfsight-app-4b78797d-5ff0-470c-aeab-8d1a6e6db616',
    es: 'elfsight-app-be815bcf-a606-4b7f-810a-c685da1d3e43',
    fr: 'elfsight-app-3ed288dd-7fd4-4b51-8046-5d44a7d8f0ce'
  }]
};

const waitForElement = (selector, root = document) => new Promise(res => {
  let i = 0;

  const check = () => {
    const component = root.querySelector(selector);

    if (component) {
      res(component);
    } else if (i !== 100) {
      setTimeout(check, 100);
      i++;
    }
  };

  check();
});

    const config = {childList: true};
    

    const callback = () => {
      const pagesEntries = Object.entries(pages);
      for (let i = 0; i < pagesEntries.length; ++i) {
        const [pattern, [selector, widgetClasses]] = pagesEntries[i];

        if (new RegExp(`^(/(${languages.join('|')})?)?/${pattern}?/?$`).test(window.location.pathname)) {
          const lang = window.location.pathname.split('/')[1];

          const widgetClass = widgetClasses[lang ?? 'DEFAULT'] ?? widgetClasses['DEFAULT'];

          if (document.querySelector(`[class*='${widgetClass}']`)) return;

          installWidget(selector, widgetClass);
          return;
        }
      }
    };

    const observer = new MutationObserver(callback);

    function installWidget(selector, widgetClass) {
      if (selector === 'FLOATING') {
        const targetNode = document.getElementById("SITE_PAGES_TRANSITION_GROUP");

        if (!targetNode) {
          selector = '#SITE_PAGES > div';
        } else {
          selector = '#SITE_PAGES_TRANSITION_GROUP > div';
        }
      }
      
      let divElement = document.querySelector(`${selector}`);
      if (!divElement) return;

      let script = document.createElement('script');
      let widgetBlock = document.createElement('div');

      script.setAttribute('src', 'https://apps.elfsight.com/p/platform.js');
      script.setAttribute('async', '');
      widgetBlock.classList.add(widgetClass);

      divElement.appendChild(script);
      divElement.appendChild(widgetBlock);
    }

    setTimeout(() => {
      waitForElement('[data-testid="language-selector-container"]').then(() => setTimeout(() => {
        callback();
        let targetNode = document.getElementById("SITE_PAGES_TRANSITION_GROUP");
        if (!targetNode) {
          targetNode = document.getElementById('SITE_PAGES');
        }
        observer.observe(targetNode, config);
      }, 500));
    }, 2500);
  })();
</script>
1 Like

Thanks Max. It is fine thanks. If I make somes changes on the widgets, would we have to reinstall them or would they be automatically udated ?

2 Likes

All changes will be applied automatically, so you don’t need to reinstall your widgets :slightly_smiling_face:

1 Like

Hi again Max!
The floating widget on mobile version is above the buttons to contact us directly (see the screen shot attached).
Could you please fix that ?
Thanks a lot !

2 Likes

Hi @La_Calypso_Dive_Cent
you can move the badge a litle bit upwards. here 20px. try it out

@media(max-width: 480px) {
.es-badge-container {
  bottom: 20px;
  }
}
3 Likes

Hi @La_Calypso_Dive_Cent :wave:

Yep, the solution by Sina should work. Just add this code to the Custom CSS field on the Style tab of your widget’s settings and let us know if it helped :wink:

1 Like

Thanks. It worked for the spanish version but not for the other languages which don’t move when I change the number of pixels

2 Likes

Please send me a link to the page where this issue occurs :slightly_smiling_face:

1 Like

It’s on the mobile version of www.lacalypsodivecenter.com/fr and www.lacalypsodivecenter.com/de www.lacalypsodivecenter.com/ www.lacalypsodivecenter.com/it and www.lacalypsodivecenter.com/zh
Actually I could only fix the spanish version of it

2 Likes

I see that you’ve replaced es in the code with fr, gr, etc:

The thing is that esstands for Elfsight, but not for Spain. So, you should use this code for all language versions and everything will be working fine :slightly_smiling_face:

@media(max-width: 480px) {
.es-badge-container {
  bottom: 20px;
  }
}
2 Likes

Oh I got you thanks a lot !

2 Likes

No sweat :wink:

1 Like