Advertisement
orenchuck

gtm jpost trigger campaign MOB

Nov 29th, 2022 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <script>
  2. (function () {
  3. var currentURLDev = 'https://stgmobile.jpost.com/conferences';
  4. var currentURLProd = 'https://m.jpost.com/conferences';
  5. if (window.location.href == currentURLDev || window.location.href == currentURLProd) {
  6. var WAITING_TIMER_COUNTER = 10;
  7. var PART_OF_SECOND = 200;
  8.  
  9. function waitPageSelector() {
  10. WAITING_TIMER_COUNTER--;
  11. var nativePageSelector = document.querySelector('.jpost-spotlight-wrap.line');
  12.  
  13. if ((!nativePageSelector && WAITING_TIMER_COUNTER > 0) || !window.adoric || !window.adoric.trigger) {
  14. setTimeout(waitPageSelector, PART_OF_SECOND);
  15. } else if (window.adoric) {
  16. adoric.trigger('showAdoricUpcomingEventsMB');
  17. }
  18. }
  19. waitPageSelector();
  20. }
  21. })();
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement