(function(){ var onReady = function(){ var interval = setInterval(function(){ if (typeof Comagic !== "undefined" && typeof Comagic.setProperty !== "undefined" && typeof Comagic.hasProperty !== "undefined") { Comagic.setProperty("roistat_visit", window.roistat.visit); Comagic.hasProperty("roistat_visit", function(resp){if (resp === true){clearInterval(interval);}}); } }, 1000); }; var onRoistatReady = function(){window.roistat.registerOnVisitProcessedCallback(function(){onReady();});}; if (typeof window.roistat !== "undefined"){ onReady(); } else { if (typeof window.onRoistatModuleLoaded === "undefined"){ window.onRoistatModuleLoaded = onRoistatReady; } else { var previousOnRoistatReady = window.onRoistatModuleLoaded; window.onRoistatModuleLoaded = function(){ previousOnRoistatReady(); onRoistatReady(); }; } } })(); }, 2000);