<script src="//www.googletagservices.com/tag/js/gpt.js"></script>
    <script>
      function loadAd() {
        $(".reward_icon").css("display", "none");
        googletag = window.googletag || { cmd: [] };

        googletag.cmd.push(() => {
          const rewardedSlot = googletag
            .defineOutOfPageSlot(
              "/23032124618/shl_RWD",
              googletag.enums.OutOfPageFormat.REWARDED
            )

            .addService(googletag.pubads());

          googletag.enableServices();

          googletag
            .pubads()
            .addEventListener("rewardedSlotReady", function (evt) {
              evt.makeRewardedVisible();
            });

          googletag
            .pubads()
            .addEventListener("rewardedSlotGranted", function (evt) {
              let getone = localStorage.getItem("coin");
              let balance = Number(getone) + Number(100);
              localStorage.setItem("coin", balance);
              let newresult = localStorage.getItem("coin");
              $(".coin").html(newresult);
            });

          googletag
            .pubads()
            .addEventListener("rewardedSlotClosed", function (evt) {
              googletag.destroySlots([rewardedSlot]);
            });

          googletag.display(rewardedSlot);
        });
        adClose();
      }
    </script>

    
