Advertisement
orenchuck

gtm laline trigger reminder

Oct 30th, 2023 (edited)
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.86 KB | None | 0 0
  1. <script>
  2.     (function () {
  3.         function cartClick(event) {
  4.             if (event.target.closest('.widget-wrap > a:nth-child(1)')) {
  5.                 setTimeout(function () {
  6.                     var nativeCart = document.querySelector('.popup-container');
  7.                     if (nativeCart) {
  8.                         adoric && adoric.trigger('showCelebrationCampaign');
  9.                         document.body.removeEventListener('click', cartClick, true);
  10.                     }
  11.                 }, 500);
  12.             }
  13.         }
  14.         function showAdoricCampaign() {
  15.             document.body.addEventListener('click', cartClick, true);
  16.         }
  17.  
  18.         if (document.readyState === 'loading') {
  19.             document.addEventListener('DOMContentLoaded', showAdoricCampaign);
  20.         } else {
  21.             showAdoricCampaign();
  22.         }
  23.     })();
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement