OSHC

Me


Me {Krux.segments = retrieve(‘segs’) ? retrieve(‘segs’).split(‘,’) : [];} syncKruxSegments(); })(); // interchange snippet (function() { window.targetGlobalSettings = { globalMboxAutoCreate:false, viewsEnabled:false }; const AT_DMP_LAST_VISIT_KEY = ‘medibank_at_dmp_lastvisit’ const MAX_SEG_DELAY = 86400000; const MAX_TARGET_DELAY = 2000; let last_visit = localStorage.getItem(AT_DMP_LAST_VISIT_KEY); let currentTimeStamp = Date.now(); hideBodyForTarget(); let triggerGTMEvent = ()=>{window.dataLayer.push({event:’DMPSegmentUpdated’});} if (!last_visit || (currentTimeStamp – last_visit) {triggerGTMEvent()},{}); } else { // tracker exist and is past the max wait time (return visitor after a long time) Krux(‘ns:medibankprivate’, ‘on:user_data_response’, ()=>{ syncKruxSegments(), initTarget(), triggerGTMEvent()},{}); // init target after user data had be fetched } localStorage.setItem(AT_DMP_LAST_VISIT_KEY,currentTimeStamp) function hideBodyForTarget() { (function(win, doc, style, timeout) { const STYLE_ID = ‘at-body-style’; function getParent() { return doc.getElementsByTagName(‘head’)[0]; } function addStyle(parent, id, def) { if (!parent) { return; } let style = doc.createElement(‘style’); style.id = id; style.innerHTML = def; parent.appendChild(style); } function removeStyle(parent, id) { if (!parent) { return; } let style = doc.getElementById(id); if (!style) { return; } parent.removeChild(style); } addStyle(getParent(), STYLE_ID, style); setTimeout(function() { removeStyle(getParent(), STYLE_ID); }, timeout); }(window, document, “body {opacity: 0 !important}”, MAX_TARGET_DELAY + 10)); } function initTarget() { var executeOffer = ()=>{ if(document.querySelector(‘head style#at-body-style’)) { //don’t bother with target if the flicker ctrl timed out or target offer has already been executed adobe.target.getOffers({ request: { execute : { pageLoad : {} }, prefetch: { views: [{}] } }, “timeout”: MAX_TARGET_DELAY }).then(response => adobe.target.applyOffers({ response: response })) } }; if(window.adobe && window.adobe.target && window.adobe.target.getOffer ) { executeOffer(); } else { document.addEventListener(‘at-library-loaded’,executeOffer); } } })(); // custom ]]> = 0) { var unsupportedBrowserUrl = document.getElementsByName(‘url.unsupportedBrowser’)[0].value; if (window.location.href.indexOf(unsupportedBrowserUrl) === -1) { window.location.href = unsupportedBrowserUrl; } } })(); ]]>

Source

oshcinsurance-logo

Leave a Reply

Your email address will not be published. Required fields are marked *