NikolayBezay

Adoric GTM teg to prepare User City key

Feb 16th, 2021 (edited)
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.60 KB | None | 0 0
  1. <script>
  2. (function() {
  3.     function checkAdress() {
  4.         var pageAdress = JSON.parse(window.localStorage.getItem('ngStorage-searchedAddresses'));
  5.         window.localStorage.setItem('adoricUserCity', pageAdress[0].city);
  6.     }
  7.     checkAdress();
  8.     document.body.addEventListener('click', function(event) {
  9.         if (event.target.getAttribute('id') === 'searchResturantsButton') {
  10.             setTimeout(checkAdress, 300);
  11.         }  
  12.     });
  13.     document.body.addEventListener('touchend', function(event) {
  14.         if (event.target.getAttribute('id') === 'searchResturantsButton') {
  15.             setTimeout(checkAdress, 300);
  16.         }  
  17.     });
  18. })();    
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment