Advertisement
NikolayBezay

IQOS ES GTM teg with custom HTML teg what will help to implement auto filling Adoric form

Sep 23rd, 2021
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.49 KB | None | 0 0
  1. <script>
  2. //pages where this script have to work
  3. //https://es.iqos.com/es/registro
  4. //https://es.iqos.com/en/register
  5. (function() {
  6.     var waitPageTriggerElement = setInterval(function() {
  7.         var registrationUserEmailField = document.querySelector('#dwfrm_registrationaccount_email');
  8.         if (registrationUserEmailField) {
  9.             clearInterval(waitPageTriggerElement);
  10.             registrationUserEmailField.addEventListener('input', function() {
  11.                 window.sessionStorage.setItem('registrationUserEmailForAdoric', registrationUserEmailField.value);
  12.             });
  13.         }
  14.     }, 500);
  15.     setTimeout(function() {
  16.         clearInterval(waitPageTriggerElement);
  17.     }, 7000);
  18. })();    
  19. </script>
  20.  
  21.  
  22.  
  23. <script>
  24. //pages where this script have to work
  25. //https://es.iqos.com/en/registerform?context=spr
  26. //https://es.iqos.com/es/registro?context=spr
  27. (function() {
  28.     var waitPageTriggerElement = setInterval(function() {
  29.         var registrationUserPhoneField = document.querySelector('#dwfrm_registrationcontact_mobileNumber');
  30.         if (registrationUserPhoneField) {
  31.             clearInterval(waitPageTriggerElement);
  32.             registrationUserPhoneField.addEventListener('input', function() {
  33.                 window.sessionStorage.setItem('registrationUserPhoneForAdoric', registrationUserPhoneField.value);
  34.             });
  35.         }
  36.     }, 500);
  37.     setTimeout(function() {
  38.         clearInterval(waitPageTriggerElement);
  39.     }, 7000);
  40. })();    
  41. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement