Spinning Wheel: How to hide the widget for users who span the wheel

By default, the Spinning Wheel widget will show up every time the page loads, even if you’ve spun it before. However, there’s an option to hide the wheel popup for users who have already interacted with it.

Just add the code below to the Custom JS field on the Settings tab of your widget’s settings:

const WIDGET_ID = 'YOUR WIDGET ID';

const containerClass = '.eapps-spinning-wheel-' + WIDGET_ID + '-custom-css-root';
const storageValue = localStorage.getItem('SpinningWheel.winningRewardId.' + WIDGET_ID);
if (storageValue) {
  const spinResult = JSON.parse(storageValue);
  if (spinResult?.value) {
    document.querySelector('.es-portal-root' + containerClass).style.display = 'none';
  }
}

Note: Do not forget to replace YOUR WIDGET ID in the 1st line of the code with the ID of your own widget.


Let us know if this solution was helpful :slightly_smiling_face:

1 Like