Suggest a feature
×

Welcome to TagMyCode

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