Yotpo Integration

How Scroll to Yotpo Reviews on Page Reload or Link?

To scroll to reviews on a page reload, add #reviews to the end of a site URL in the address bar. For a link, use #reviews in the link URL. Add the code to Code Injection.

<!-- Scroll to Yotpo Reviews on Page Reload / Link -->
<script src="https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll@14/dist/smooth-scroll.polyfills.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ryanmorr/ready@1/dist/ready.min.js"></script>
<script>
(function(){
  if (document.location.hash !== '#reviews') return null;
  var ready = ryanmorrready || ready;
  ready('.main-widget.yotpo-display-wrapper', function(target) {
    setTimeout(function() { scrollHandler(target) }, 150);
  });
  function scrollHandler(target) {
    var scroll = new SmoothScroll();
    scroll.animateScroll(target, null, {
      updateURL: false,
      header: window.innerWidth >= 641 ? '.Header' : '.Mobile'
    });
  }
})();
</script>
<!-- end Scroll to Yotpo Reviews on Page Reload / Link -->