Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Chris Beardsley
Added: Oct 8, 2018 7:32 AM
Views: 11
Tags: no tags
  1. <script>
  2. function ads(){
  3.         dataLayer.push({
  4.                 "event": "relevant ads"
  5.         });
  6.   setTimeout(function(){
  7.     if(localStorage.getItem('userAcceptedCookies') == null){
  8.         localStorage.setItem('userAcceptedCookies',true);
  9.    }
  10.   }, 1000)
  11. }
  12.   ads();
  13. </script>
  14.  
  15. //Then
  16.  
  17. function(){
  18.   return localStorage.getItem('userAcceptedCookies')
  19. }