Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: user5f44c
Added: Jun 16, 2020 12:21 PM
Views: 132
Tags: no tags
  1. <script>
  2.   if(!/CookieConsent/.test(document.cookie)){
  3.     (function(){
  4.       var cookieChecker = setInterval(function(){
  5.         if(/CookieConsent/.test(document.cookie)){
  6.             dataLayer.push({'event':'cookiesAccepted'});
  7.             clearInterval(cookieChecker);
  8.             console.log('Interval cleared');
  9.         }
  10.  
  11.  
  12.  
  13.       }, 500);
  14.     })();
  15. }
  16. </script>