Advertisement
NikolayBezay

IQOS GTM teg with custom HTML teg that will trigger Adoric send SMS form

Sep 29th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.91 KB | None | 0 0
  1. <script>
  2.     //pages where this script have to work
  3.     //https://es.iqos.com/en/registercontact?context=spr
  4.     //https://es.iqos.com/es/registercontact?context=spr
  5.     (function() {
  6.         var waitPageTriggerElement = setInterval(function() {
  7.             var registrationUserEmailField = document.querySelector('.registration-confirmation__items-container');
  8.             if (registrationUserEmailField) {
  9.                 clearInterval(waitPageTriggerElement);
  10.                 if (window.location.href.indexOf('/es/') != -1) {
  11.                     window.adoric && window.adoric.trigger('showGetSMS_form_ES');
  12.                 } else {
  13.                     window.adoric && window.adoric.trigger('showGetSMS_form_EN');
  14.                 }
  15.                
  16.             }
  17.         }, 200);
  18.         setTimeout(function() {
  19.             clearInterval(waitPageTriggerElement);
  20.         }, 7000);
  21.     })();    
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement