NikolayBezay

GSK - checking the status of the Adoric campaigns(GTM teg).

Mar 1st, 2021 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.36 KB | None | 0 0
  1. <script>
  2. /*=============save mark to the local Storage=============*/
  3. (function() {
  4.     if (adoric) {
  5.         adoric.on('lightbox:after:show', function() {
  6.             window.localStorage.setItem('adoricCampaignIsShowing','true');
  7.         });
  8.         adoric.on('lightbox:after:close', function() {
  9.             var campaignShowing = false;
  10.             adoric.lightboxes.forEach(function(item) {
  11.                 if (item.isShowing) {
  12.                     campaignsShowing = true;
  13.                 }
  14.             });
  15.             if (!campaignShowing) {
  16.                 window.localStorage.setItem('adoricCampaignIsShowing','false');
  17.             }
  18.         });
  19.     }
  20. })();
  21. </script>
  22. <script>
  23. /*=============save mark to the cookies=============*/
  24. (function() {
  25.     if (adoric) {
  26.         adoric.on('lightbox:after:show', function() {
  27.             window.document.cookie = "adoricCampaignIsShowing=true; expires=session; path=/";
  28.         });
  29.         adoric.on('lightbox:after:close', function() {
  30.             var campaignShowing = false;
  31.             adoric.lightboxes.forEach(function(item) {
  32.                 if (item.isShowing) {
  33.                     campaignsShowing = true;
  34.                 }
  35.             });
  36.             if (!campaignShowing) {
  37.                 window.document.cookie = "adoricCampaignIsShowing=false; expires=session; path=/";
  38.             }
  39.         });
  40.     }
  41. })();
  42. </script>
  43.  
Add Comment
Please, Sign In to add comment