");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, R_722219_759_1_2_0:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var ctx=vwo_$(x),el; /*vwo_debug log("Revert","content",""); vwo_debug*/; el=vwo_$('[vwo-element-id="1733126851444"]'); el.revertContentOp().remove();})("HEAD")}}, C_722219_759_1_2_1:{ fn:function(log,nonce=''){return (function(x) {})(".leo-col-6")}}, R_722219_759_1_2_1:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; })(".leo-col-6")}}, ct759_16048c03a9b024888f00d49e44c4bca2:{ fn:function(executeTrigger, vwo_$) { (//Visited PDP audience trigger for VWO function() { // ---------------------------------- // ----- Personalization config ----- // ---------------------------------- var productsViewedMaxItems = 3; // Max number of recommended products /* Product master infos: - name = Master product name. Ensure that this matches the master mapping (eg. data layer values) */ var productsViewedCTAArr = [ { "name": "GREAT CareShield" }, { "name": "GoGreat Term Life" }, { "name": "TravelSmart Premier" }, { "name": "HomeGR8 Plus" }, { "name": "GREAT Protector Active" }, { "name": "Essential Protector Plus" }, { "name": "GREAT Junior Protector" }, { "name": "Drive and Save Plus" }, { "name": "GREAT Maid Protect" }, { "name": "GREAT Critical Cover Series" }, { "name": "GREAT Prime Rewards" }, { "name": "GREAT SP" }, { "name": "GREAT Golden Protector" }, { "name": "GREAT Term" }, { "name": "GREAT EV Protect" }, { "name": "GREAT Hospital Cash " }, { "name": "GREAT Cancer Guard" }, { "name": "PA Supreme" }, { "name": "GREAT Home Protect" } ]; // ----------------------------------------- // ----- System config (Do not change) ----- // ----------------------------------------- var productsViewedCookieName = "personalization_products_viewed"; var productsPurchasedCookieName = "personalization_products_purchased"; // ------------------------------- // ----- Get cookie function ----- // ------------------------------- function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } // ------------------------------------------------ // ----- Check last viewed/purchased products ----- // ------------------------------------------------ // Read cookies var productsViewedArr = []; // Default empty array var productsViewedStr = getCookie(productsViewedCookieName); var productsPurchasedArr = []; // Default empty array var productsPurchasedStr = getCookie(productsPurchasedCookieName); // If cookies are not empty, read the unstringified values if(productsViewedStr != "") {productsViewedArr = JSON.parse(productsViewedStr);} if(productsPurchasedStr != "") {productsPurchasedArr = JSON.parse(productsPurchasedStr);} // Remove purchased products from last viewed products productsViewedArr = productsViewedArr.filter(function (a) { return typeof productsPurchasedArr.find(function (b) { return b.name == a.name; }) == "undefined"; }); // Cross check master product infos productsViewedArr = productsViewedArr.filter(function (a) { return typeof productsViewedCTAArr.find(function (b) { return b.name == a.name; }) != "undefined"; }); // Reduce to the latest X array items productsViewedArr = productsViewedArr.slice(-productsViewedMaxItems); // If there are last products viewed, run VWO campaign if(productsViewedArr.length) { executeTrigger(); } })() }}, R_722219_963_1_2_24:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","editElement","html.vwo_p_s_baf0439c6ee7eeb30695dbb63777c8a1 .sticky-nav-cta > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_baf0439c6ee7eeb30695dbb63777c8a1 .sticky-nav-cta > a:nth-of-type(1)")).vwoRevertAttr(),(el=vwo_$("html.vwo_p_s_baf0439c6ee7eeb30695dbb63777c8a1 .sticky-nav-cta > a:nth-of-type(1)")).revertContentOp(),el=vwo_$("html.vwo_p_s_baf0439c6ee7eeb30695dbb63777c8a1 .sticky-nav-cta > a:nth-of-type(1)");})("html.vwo_p_s_baf0439c6ee7eeb30695dbb63777c8a1 .sticky-nav-cta > a:nth-of-type(1)")}}, C_722219_963_1_2_25:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")).replaceWith2('Buy now'),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)"),(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")).vwoAttr({href:"#",id:"ggpbuynow",target:""});})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")}}, R_722219_963_1_2_25:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","editElement","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")).vwoRevertAttr(),(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")).revertContentOp(),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)");})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cta-bottom > a:nth-of-type(1)")}}, C_722219_963_1_2_26:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")).replaceWith2('Buy now'),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)"),(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")).vwoAttr({id:"ggpbuynow2"});})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")}}, R_722219_963_1_2_26:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","editElement","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")).vwoRevertAttr(),(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")).revertContentOp(),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)");})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .sticky-nav-cta > a:nth-of-type(1)")}}, C_722219_963_1_2_27:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link")).replaceWith2(' Scan the QR Code to access Great Eastern App today '),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link");})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link")}}, R_722219_963_1_2_27:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","content","html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link"); vwo_debug*/(el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link")).revertContentOp(),el=vwo_$("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link");})("html.vwo_p_s_529d06731882814587edcdb7fcb47719 .cmp-image__link")}}, C_722219_963_1_2_28:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")).replaceWith2('Buy now'),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)"),(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")).vwoAttr({id:"gjpbuynow",target:"",href:"#"});})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")}}, R_722219_963_1_2_28:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","editElement","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")).vwoRevertAttr(),(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")).revertContentOp(),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)");})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cta-bottom > a:nth-of-type(1)")}}, C_722219_963_1_2_29:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")).replaceWith2('Buy now'),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)"),(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")).vwoAttr({id:"gjpbuynow2"});})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")}}, R_722219_963_1_2_29:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","editElement","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")).vwoRevertAttr(),(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")).revertContentOp(),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)");})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .sticky-nav-cta > a:nth-of-type(1)")}}, C_722219_963_1_2_30:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("content","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link")).replaceWith2(' Scan the QR Code to access Great Eastern App today '),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link");})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link")}}, R_722219_963_1_2_30:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","content","html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link"); vwo_debug*/(el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link")).revertContentOp(),el=vwo_$("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link");})("html.vwo_p_s_117ea7d82ad4208c01b4c082cbb1dcbe .cmp-image__link")}}, C_722219_963_1_2_31:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .breadcrumb > ul:nth-of-type(1)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .breadcrumb > ul:nth-of-type(1)")).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .breadcrumb > ul:nth-of-type(1)")}}, C_722219_1027_1_2_0:{ fn:function(){return (function(x) { try{ var _vwo_sel = vwo_$(""); !vwo_$("head").find("#1739333374834").length && vwo_$('head').append(_vwo_sel); // Start variation JS void (function loadVariation(timeInFuture) { // Main Test object const test = { // Some test specific global letiables id: "EXP-10-V1", // Test init init: function () { // Add a test specific classname to the body element document.body.classList.add(test.id); // Below function calls order is important test.mainJS(); }, // Main JS mainJS: function () { /* ---- LOGO ---- */ const quizLogo = ` `; const crossIcon = ` `; const newCrossIcon = ` `; /* ---- DATA ---- */ // quiz data const collections = [ { quizName: "Healthy heart, Happy life - Quiz 1", quizNumber: "quiz 1", className: "healthy-heart-quiz-one", image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html", header: "Healthy heart, Happy life - Quiz 1", quizDate: "Jan 06, 2025", promoCopy: "Answer 3 simple questions and win an exclusive prize from Eu Yan Sang worth $15!", questionOne: [ "1. One should see a ____________ if he/she is experiencing chest pain and shortness of breath as it could be a possible sign of heart disease and heart failure.", ["Cardiologist", "Dentist", "Gastroenterologist"] ], questionTwo: [ "2. These chronic conditions – diabetes, high blood pressure, and high ___________ (also known as the “Three Highs”), are usually asymptomatic and may be unnoticed. It has been observed that patients are also developing these conditions at an increasingly earlier age.", ["Blood count", "Cholesterol", "Fever"] ] }, { quizName: "Healthy heart, Happy life - Quiz 2", quizNumber: "quiz 2", className: "healthy-heart-quiz-two", image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg", coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg", url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html", header: "Healthy heart, Happy life - Quiz 2", quizDate: "Jan 20, 2025", promoCopy: "Answer 3 simple questions and win an exclusive prize from Fitness First worth $60!", questionOne: [ "1. Even though pineapple tarts are everywhere for the festive season, I should limit my intake to ____ pieces because it is equivalent to 7 teaspoons of sugar, which is within our recommended daily intake of 10 teaspoons.", ["2", "4", "6"] ], questionTwo: [ "2. Nian gao, nian gao, in the box… which is the most calorie-loaded of them all?", ["Steamed", "Fried"] ] }, ]; // quiz image links const imageUrls = [ "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg", "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg" ]; // array of quiz pages const quizPages = [ '/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html', '/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html', ]; // array of pages to show quiz logo const variationPages = [ '/sg/en/personal-insurance/lifepedia.html', '/sg/en/personal-insurance/lifepedia/medical-coverage.html', '/sg/en/personal-insurance/lifepedia/life-protection.html', '/sg/en/personal-insurance/lifepedia/lifestyle-protection.html', '/sg/en/personal-insurance/lifepedia/savings-and-investment.html', '/sg/en/personal-insurance/lifepedia/retirement-income.html', '/sg/en/personal-insurance/lifepedia/career.html', '/sg/en/personal-insurance/rewards-and-promotions.html' ]; /* ---- Utility Functions ---- */ // // image preload function function preloadImages(imageUrls) { imageUrls.forEach(url => { const img = new Image(); img.src = url; }); } // function to validate and process quiz data function validationAndProcessQuizData(quizUrl, quizNumber) { // Cache form elements const formSection = document.querySelector('.form-section'); const questionOneInput = document.querySelectorAll('.form-group-one .radio-item input:checked')[0]; const questionTwoInput = document.querySelectorAll('.form-group-two .radio-item input:checked')[0]; // Validation: Check if questions are answered const isEmpty = !(questionOneInput?.value) || !(questionTwoInput?.value.trim()); const existingError = formSection.querySelector('.error-copy'); const errorHtml = `
Please complete the questions.
` if (isEmpty) { // Add error message if it doesn't exist if (!existingError) { formSection.insertAdjacentHTML('beforeend', errorHtml); formSection.classList.add('form-error'); return; // Exit the function } return; } // Remove error if validation passes if (existingError) { existingError.remove(); } formSection.classList.remove('form-error'); // Prepare quiz data const quizData = [ quizUrl.trim(), questionOneInput.value.trim(), questionTwoInput.value.trim(), ]; // Store the data in session storage sessionStorage.setItem('quizData', JSON.stringify(quizData)); // step 3 - continue CTA click let quizName = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - static`; let eventJourneyCTA = `vworq-hh-3-${quizName}-static`; gaEventTrigger('click', eventLabel, eventJourneyCTA); // Redirect to the quiz URL window.location.href = quizUrl; } // function to trigger GA events function gaEventTrigger(eventAction, eventLabel, eventJourneyCTA = '') { dataLayer.push({ event: "vwoEvent", eventDetails: { category: "[vwo] sticky icon", action: eventAction, label: eventLabel }, contentSubcategory: "healthy heart quiz", ...(eventJourneyCTA ? { journeyCta: eventJourneyCTA } : {}) }); }; // fuction to detect touch device const isTouchDevice = () => { return ( 'ontouchstart' in window || // Check for touch events navigator.maxTouchPoints > 0 || // Check for touch points navigator.msMaxTouchPoints > 0 // Microsoft-specific touch points ); }; /* ---- HTML Templates Markup and Functions ---- */ // create Quiz cards markup const createQuizCard = (className, coverImage, header, quizDate) => { return (`
${className}

Medical Coverage

${header}

${quizDate}

`) }; // create quiz icon markup let quizIconHtml = `
${newCrossIcon}
${quizLogo}
`; // create quiz card markup const QuizCards = collections.map(({ className, coverImage, header, quizDate }) => createQuizCard(className, coverImage, header, quizDate) ).join(''); // create quiz cross icon markup const quizCrossButton = ` `; // function to create inner content for modal level two let modalTwoInnerContent = (className, title, promoCopy) => (` `); //function to generate radio buttons function generateRadioButtons(options, groupName) { // Helper function to generate a single radio item const createRadioItem = (option, index) => { const id = `${groupName}-option-${index + 1}`; // Unique ID for each option return `
`; }; // Generate all radio items const radioItems = options.map((option, index) => createRadioItem(option, index)).join(""); // Wrap the radio items in the section structure return `
${radioItems}
`; } // function to create inner content for modal level two let modalThreeInnerContent = (className, questionOne, questionTwo) => (` `); // function to create markup for modals on level two and three let quizModalfn = (className, quizName, image, modalInnerHtml, modalClassNameOne, modalClassNametwo) => (`
${quizCrossButton} ${className}
${quizCrossButton} ${modalInnerHtml}
`); // markup for quiz modal level one let quizModalLV1 = `
${quizCrossButton}
`; // function to create the initial modal markup let modalMarkup = () => (` `); /* ---- DOM Manipulation ---- */ // current url path const currentPath = window.location.pathname; // Dom manipulation for quiz variation if (variationPages.includes(currentPath)) { // preload images preloadImages(imageUrls); // insert quiz icon if (document.querySelector('.quiz-icon-container')) return; document.querySelector('main.container .cmp-container > .aem-Grid').insertAdjacentHTML('beforeend', quizIconHtml); let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static'; gaEventTrigger('impression', eventLabel); // insert modal markup document.querySelectorAll('main.container .cmp-container > .aem-Grid')[0].insertAdjacentHTML('beforeend', modalMarkup()) // click handler function for variation pages function clickHandler(event) { const { target } = event; //console.log('target: ', target); // Utility: Toggle modal visibility const toggleModal = (selector, addClass, removeClass) => { const modal = document.querySelector(selector); if (modal) { if (addClass !== null) modal.classList.add(addClass); if (removeClass !== null) modal.classList.remove(removeClass); } }; // Utility: Map class names to modal numbers const getModalNum = () => { if (target.closest('.healthy-heart-quiz-one')) return 0; if (target.closest('.healthy-heart-quiz-two')) return 1; if (target.closest('.word-search-edition-three')) return 2; return null; // Default if no match found }; // Utility: Clear form errors const clearFormErrors = () => { document.querySelector('.form-section .error-copy')?.remove(); document.querySelector('.form-section.form-error')?.classList.remove('form-error'); }; // Handle: Quiz icon click (open modal) if (target.closest('.quiz-icon-container .quiz-icon')) { toggleModal('.quiz-modal-container', 'modal--visible', 'modal--hidden'); // click on quiz icon let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static'; let eventJourneyCTA = 'vworq-hh-win prizes-static'; gaEventTrigger('click', eventLabel, eventJourneyCTA); } // Handle: Quiz cross icon click (cross icon) if (target.closest('.quiz-icon-container .cross-icon')) { document.querySelector('.quiz-icon-container').classList.add('hide-quiz-icon'); // hide quiz icon let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static'; gaEventTrigger('close', eventLabel); return; } // Handle: Close modal if ( target.closest('.modal-cross-button .cross-icon') || target.classList.contains('modal--visible') ) { // step 1 modal - close if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) { let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - static`; gaEventTrigger('close', eventLabel); } // step 2 modal - close if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - static`; gaEventTrigger('close', eventLabel); } // step 3 - close if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - static`; gaEventTrigger('close', eventLabel); } toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible'); document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove()); toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one return; } // Handle: Click on modal cards if (target.closest('.quiz-modal-one .quiz-card')) { const modalNum = getModalNum(); if (modalNum !== null) { const { quizName, quizNumber, className, image, promoCopy, details } = collections[modalNum]; const modalTwoInnerHtml = modalTwoInnerContent(className, quizName, promoCopy, details); const modalTwoMarkup = quizModalfn(className, quizName, image, modalTwoInnerHtml, 'quiz-modal-two', 'quiz-level-two'); document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalTwoMarkup); toggleModal('.quiz-modal.quiz-modal-one', 'hide-modal', null); // step 1 - popup card click let quizTitle = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - ${quizTitle} - static`; let eventJourneyCTA = `vworq-hh-1-${quizTitle}-static`; gaEventTrigger('click', eventLabel, eventJourneyCTA); } return; } // Handle: Click on quiz start button in modal two if (target.closest('.quiz-modal.quiz-modal-two .quiz-button')) { const questionModalNum = getModalNum(); if (questionModalNum !== null) { const { quizName, quizNumber, className, image, questionOne, questionTwo } = collections[questionModalNum]; const modalThreeInnerHtml = modalThreeInnerContent(className, questionOne, questionTwo); const modalThreeMarkup = quizModalfn(className, quizName, image, modalThreeInnerHtml, 'quiz-modal-three', 'quiz-level-three'); document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalThreeMarkup); toggleModal('.quiz-modal.quiz-modal-two', 'hide-modal', null); // step 2 - start now CTA click let quizTitle = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizTitle} - static`; let eventJourneyCTA = `vworq-hh-2-${quizTitle}-static`; gaEventTrigger('click', eventLabel, eventJourneyCTA); } return; } // Handle: Click on quiz button in modal three (final action) if (target.closest('.quiz-modal.quiz-modal-three .quiz-button')) { const questionModalNum = getModalNum(); if (questionModalNum !== null) { const { url, quizNumber } = collections[questionModalNum]; // Validate input and process quiz data validationAndProcessQuizData(url, quizNumber); } return; } // Handle: Input focus (clear errors) if (target.closest('input#form-quiestion-one') || target.closest('input#form-quiestion-two')) { clearFormErrors(); return; } } // Attach click handler to the document document.body.addEventListener('click', clickHandler); function touchStartEventHandler(event) { const { target } = event; //console.log('target touch: ', target); // Utility: Toggle modal visibility const toggleModal = (selector, addClass, removeClass) => { const modal = document.querySelector(selector); if (modal) { modal.classList.add(addClass); modal.classList.remove(removeClass); } }; // Handle: Close modal if ( target.closest('.modal-cross-button .cross-icon') || target.classList.contains('modal--visible') ) { // step 1 - close if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) { let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - static`; gaEventTrigger('close', eventLabel); } // step 2 - close if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - static`; gaEventTrigger('close', eventLabel); } // step 3 - close if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - static`; gaEventTrigger('close', eventLabel); } toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible'); document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove()); toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one return; } } if (isTouchDevice()) { document.body.addEventListener('touchstart', touchStartEventHandler) } } // Dom manipulation to populate the quiz modal if (quizPages.includes(currentPath)) { // Retrieve and parse quiz data from sessionStorage const quizData = sessionStorage.getItem('quizData'); if (quizData) { try { const [url, answerOne, answerTwo] = JSON.parse(quizData); const currentUrl = window.location.href; // Check if the current URL matches the stored URL if (currentUrl.includes(url)) { document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerOne}"]`)[0].click(); document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerTwo}"]`)[0].click(); } } catch (error) { //console.error('Failed to parse quiz data from sessionStorage:', error); } } } }, }; // Return if the test ran already! if (document.querySelector(`.${test.id}`)) return; // Polling conditions if (document.querySelector('main.container .cmp-container > .aem-Grid')) { try { // Activate test setTimeout(function () { test.init() }, 1000) // Success log console.log('Vertis Digital: EXP-10: V: 1:05'); } catch (error) { // Error log console.log(`Initialization Error:`, error); } } else { Date.now() < timeInFuture ? setTimeout(loadVariation.bind({}, timeInFuture), 25) : console.log("loadVariation timed out!"); } })(Date.now() + 60000); // End variation JS return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, R_722219_1027_1_2_0:{ fn:function(){return (function(x) { try{ var el,ctx=vwo_$(x); /*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1739333374770"]')).remove(); var ctx=vwo_$(x),el; /*vwo_debug log("Revert","content",""); vwo_debug*/; el=vwo_$('[vwo-element-id="1739333374834"]'); el.revertContentOp().remove(); return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, C_722219_1027_1_3_0:{ fn:function(){return (function(x) { try{ var _vwo_sel = vwo_$(""); !vwo_$("head").find("#1739333374787").length && vwo_$('head').append(_vwo_sel); // Start variation JS void (function loadVariation(timeInFuture) { // Main Test object const test = { // Some test specific global letiables id: "EXP-10-V2", // Test init init: function () { // Add a test specific classname to the body element document.body.classList.add(test.id); // Below function calls order is important test.mainJS(); }, // Main JS mainJS: function () { /* ---- LOGO ---- */ const crossIcon = ` `; const newCrossIcon = ` `; /* ---- DATA ---- */ // quiz data const collections = [ { quizName: "Healthy heart, Happy life - Quiz 1", quizNumber: "quiz 1", className: "healthy-heart-quiz-one", image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html", header: "Healthy heart, Happy life - Quiz 1", quizDate: "Jan 06, 2025", promoCopy: "Answer 3 simple questions and win an exclusive prize from Eu Yan Sang worth $15!", questionOne: [ "1. One should see a ____________ if he/she is experiencing chest pain and shortness of breath as it could be a possible sign of heart disease and heart failure.", ["Cardiologist", "Dentist", "Gastroenterologist"] ], questionTwo: [ "2. These chronic conditions – diabetes, high blood pressure, and high ___________ (also known as the “Three Highs”), are usually asymptomatic and may be unnoticed. It has been observed that patients are also developing these conditions at an increasingly earlier age.", ["Blood count", "Cholesterol", "Fever"] ] }, { quizName: "Healthy heart, Happy life - Quiz 2", quizNumber: "quiz 2", className: "healthy-heart-quiz-two", image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg", coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg", url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html", header: "Healthy heart, Happy life - Quiz 2", quizDate: "Jan 20, 2025", promoCopy: "Answer 3 simple questions and win an exclusive prize from Fitness First worth $60!", questionOne: [ "1. Even though pineapple tarts are everywhere for the festive season, I should limit my intake to ____ pieces because it is equivalent to 7 teaspoons of sugar, which is within our recommended daily intake of 10 teaspoons.", ["2", "4", "6"] ], questionTwo: [ "2. Nian gao, nian gao, in the box… which is the most calorie-loaded of them all?", ["Steamed", "Fried"] ] }, ]; // quiz icon links const animatedIcon = "https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/7a172faba185610e9d0a41c2db03373b_quizicon01.gif"; // quiz image links const imageUrls = [ "https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/2ec24e2a92a520a5701a7de9c9df9671_quizicon01hover.gif", "https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/7a172faba185610e9d0a41c2db03373b_quizicon01.gif", "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg", "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg", "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg" ]; // array of quiz pages const quizPages = [ '/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html', '/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html', ]; // array of pages to show quiz logo const variationPages = [ '/sg/en/personal-insurance/lifepedia.html', '/sg/en/personal-insurance/lifepedia/medical-coverage.html', '/sg/en/personal-insurance/lifepedia/life-protection.html', '/sg/en/personal-insurance/lifepedia/lifestyle-protection.html', '/sg/en/personal-insurance/lifepedia/savings-and-investment.html', '/sg/en/personal-insurance/lifepedia/retirement-income.html', '/sg/en/personal-insurance/lifepedia/career.html', '/sg/en/personal-insurance/rewards-and-promotions.html' ]; /* ---- Utility Functions ---- */ // // image preload function function preloadImages(imageUrls) { imageUrls.forEach(url => { const img = new Image(); img.src = url; }); } // function to validate and process quiz data function validationAndProcessQuizData(quizUrl, quizNumber) { // Cache form elements const formSection = document.querySelector('.form-section'); const questionOneInput = document.querySelectorAll('.form-group-one .radio-item input:checked')[0]; const questionTwoInput = document.querySelectorAll('.form-group-two .radio-item input:checked')[0]; // Validation: Check if questions are answered const isEmpty = !(questionOneInput?.value) || !(questionTwoInput?.value.trim()); const existingError = formSection.querySelector('.error-copy'); const errorHtml = `
Please complete the questions.
` if (isEmpty) { // Add error message if it doesn't exist if (!existingError) { formSection.insertAdjacentHTML('beforeend', errorHtml); formSection.classList.add('form-error'); return; // Exit the function } return; } // Remove error if validation passes if (existingError) { existingError.remove(); } formSection.classList.remove('form-error'); // Prepare quiz data const quizData = [ quizUrl.trim(), questionOneInput.value.trim(), questionTwoInput.value.trim(), ]; // Store the data in session storage sessionStorage.setItem('quizData', JSON.stringify(quizData)); // step 3 - continue CTA click let quizName = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - animated`; let eventJourneyCTA = `vworq-hh-3-${quizName}-animated`; gaEventTrigger('click', eventLabel, eventJourneyCTA); // Redirect to the quiz URL window.location.href = quizUrl; } // function to trigger GA events function gaEventTrigger(eventAction, eventLabel, eventJourneyCTA = '') { dataLayer.push({ event: "vwoEvent", eventDetails: { category: "[vwo] sticky icon", action: eventAction, label: eventLabel }, contentSubcategory: "healthy heart quiz", ...(eventJourneyCTA ? { journeyCta: eventJourneyCTA } : {}) }); }; // fuction to detect touch device const isTouchDevice = () => { return ( 'ontouchstart' in window || // Check for touch events navigator.maxTouchPoints > 0 || // Check for touch points navigator.msMaxTouchPoints > 0 // Microsoft-specific touch points ); }; /* ---- HTML Templates Markup and Functions ---- */ // create Quiz cards markup const createQuizCard = (className, coverImage, header, quizDate) => { return (`
${className}

Medical Coverage

${header}

${quizDate}

`) }; // create quiz icon markup let quizIconHtml = `
${newCrossIcon}
Quiz Icon
`; // create quiz card markup const QuizCards = collections.map(({ className, coverImage, header, quizDate }) => createQuizCard(className, coverImage, header, quizDate) ).join(''); // create quiz cross icon markup const quizCrossButton = ` `; // function to create inner content for modal level two let modalTwoInnerContent = (className, title, promoCopy) => (` `); //function to generate radio buttons function generateRadioButtons(options, groupName) { // Helper function to generate a single radio item const createRadioItem = (option, index) => { const id = `${groupName}-option-${index + 1}`; // Unique ID for each option return `
`; }; // Generate all radio items const radioItems = options.map((option, index) => createRadioItem(option, index)).join(""); // Wrap the radio items in the section structure return `
${radioItems}
`; } // function to create inner content for modal level two let modalThreeInnerContent = (className, questionOne, questionTwo) => (` `); // function to create markup for modals on level two and three let quizModalfn = (className, quizName, image, modalInnerHtml, modalClassNameOne, modalClassNametwo) => (`
${quizCrossButton} ${className}
${quizCrossButton} ${modalInnerHtml}
`); // markup for quiz modal level one let quizModalLV1 = `
${quizCrossButton}
`; // function to create the initial modal markup let modalMarkup = () => (` `); /* ---- DOM Manipulation ---- */ // current url path const currentPath = window.location.pathname; // Dom manipulation for quiz variation if (variationPages.includes(currentPath)) { // preload images preloadImages(imageUrls); // insert quiz icon if (document.querySelector('.quiz-icon-container')) return; document.querySelector('main.container .cmp-container > .aem-Grid').insertAdjacentHTML('beforeend', quizIconHtml); let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - animated'; gaEventTrigger('impression', eventLabel); // insert modal markup document.querySelectorAll('main.container .cmp-container > .aem-Grid')[0].insertAdjacentHTML('beforeend', modalMarkup()) // click handler function for variation pages function clickHandler(event) { const { target } = event; //console.log('target: ', target); // Utility: Toggle modal visibility const toggleModal = (selector, addClass, removeClass) => { const modal = document.querySelector(selector); if (modal) { if (addClass !== null) modal.classList.add(addClass); if (removeClass !== null) modal.classList.remove(removeClass); } }; // Utility: Map class names to modal numbers const getModalNum = () => { if (target.closest('.healthy-heart-quiz-one')) return 0; if (target.closest('.healthy-heart-quiz-two')) return 1; if (target.closest('.word-search-edition-three')) return 2; return null; // Default if no match found }; // Utility: Clear form errors const clearFormErrors = () => { document.querySelector('.form-section .error-copy')?.remove(); document.querySelector('.form-section.form-error')?.classList.remove('form-error'); }; // Handle: Quiz icon click (open modal) if (target.closest('.quiz-icon-container .quiz-icon')) { toggleModal('.quiz-modal-container', 'modal--visible', 'modal--hidden'); // click on quiz icon let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - animated'; let eventJourneyCTA = 'vworq-hh-win prizes-animated'; gaEventTrigger('click', eventLabel, eventJourneyCTA); } // Handle: Quiz cross icon click (cross icon) if (target.closest('.quiz-icon-container .cross-icon')) { document.querySelector('.quiz-icon-container').classList.add('hide-quiz-icon'); // hide quiz icon let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - animated'; gaEventTrigger('close', eventLabel); return; } // Handle: Close modal if ( target.closest('.modal-cross-button .cross-icon') || target.classList.contains('modal--visible') ) { // step 1 modal - close if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) { let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - animated`; gaEventTrigger('close', eventLabel); } // step 2 modal - close if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) { //let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name')?.toLowerCase(); let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - animated`; gaEventTrigger('close', eventLabel); } // step 3 - close if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) { //let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name')?.toLowerCase(); let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - animated`; gaEventTrigger('close', eventLabel); } toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible'); document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove()); toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one return; } // Handle: Click on modal cards if (target.closest('.quiz-modal-one .quiz-card')) { const modalNum = getModalNum(); if (modalNum !== null) { const { quizName, quizNumber, className, image, promoCopy, details } = collections[modalNum]; const modalTwoInnerHtml = modalTwoInnerContent(className, quizName, promoCopy, details); const modalTwoMarkup = quizModalfn(className, quizName, image, modalTwoInnerHtml, 'quiz-modal-two', 'quiz-level-two'); document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalTwoMarkup); toggleModal('.quiz-modal.quiz-modal-one', 'hide-modal', null); // step 1 - popup card click let quizTitle = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - ${quizTitle} - animated`; let eventJourneyCTA = `vworq-hh-1-${quizTitle}-animated`; gaEventTrigger('click', eventLabel, eventJourneyCTA); } return; } // Handle: Click on quiz start button in modal two if (target.closest('.quiz-modal.quiz-modal-two .quiz-button')) { const questionModalNum = getModalNum(); if (questionModalNum !== null) { const { quizName, quizNumber, className, image, questionOne, questionTwo } = collections[questionModalNum]; const modalThreeInnerHtml = modalThreeInnerContent(className, questionOne, questionTwo); const modalThreeMarkup = quizModalfn(className, quizName, image, modalThreeInnerHtml, 'quiz-modal-three', 'quiz-level-three'); document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalThreeMarkup); toggleModal('.quiz-modal.quiz-modal-two', 'hide-modal', null); // step 2 - start now CTA click let quizTitle = quizNumber.toLowerCase(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizTitle} - animated`; let eventJourneyCTA = `vworq-hh-2-${quizTitle}-animated`; gaEventTrigger('click', eventLabel, eventJourneyCTA); } return; } // Handle: Click on quiz button in modal three (final action) if (target.closest('.quiz-modal.quiz-modal-three .quiz-button')) { const questionModalNum = getModalNum(); if (questionModalNum !== null) { const { url, quizNumber } = collections[questionModalNum]; // Validate input and process quiz data validationAndProcessQuizData(url, quizNumber); } return; } // Handle: Input focus (clear errors) if (target.closest('input#form-quiestion-one') || target.closest('input#form-quiestion-two')) { clearFormErrors(); return; } } // Attach click handler to the document document.body.addEventListener('click', clickHandler); function touchStartEventHandler(event) { const { target } = event; //console.log('target touch: ', target); // Utility: Toggle modal visibility const toggleModal = (selector, addClass, removeClass) => { const modal = document.querySelector(selector); if (modal) { modal.classList.add(addClass); modal.classList.remove(removeClass); } }; // Handle: Close modal if ( target.closest('.modal-cross-button .cross-icon') || target.classList.contains('modal--visible') ) { // step 1 - close if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) { let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - animated`; gaEventTrigger('close', eventLabel); } // step 2 - close if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - animated`; gaEventTrigger('close', eventLabel); } // step 3 - close if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) { let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim(); let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - animated`; gaEventTrigger('close', eventLabel); } toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible'); document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove()); toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one return; } } if (isTouchDevice()) { document.body.addEventListener('touchstart', touchStartEventHandler) } } // Dom manipulation to populate the quiz modal if (quizPages.includes(currentPath)) { // Retrieve and parse quiz data from sessionStorage const quizData = sessionStorage.getItem('quizData'); if (quizData) { try { const [url, answerOne, answerTwo] = JSON.parse(quizData); const currentUrl = window.location.href; // Check if the current URL matches the stored URL if (currentUrl.includes(url)) { document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerOne}"]`)[0].click(); document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerTwo}"]`)[0].click(); } } catch (error) { //console.error('Failed to parse quiz data from sessionStorage:', error); } } } }, }; // Return if the test ran already! if (document.querySelector(`.${test.id}`)) return; // Polling conditions if (document.querySelector('main.container .cmp-container > .aem-Grid')) { try { // Activate test setTimeout(function () { test.init() }, 1000) // Success log console.log('Vertis Digital: EXP-10: V: 2:05'); } catch (error) { // Error log console.log(`Initialization Error:`, error); } } else { Date.now() < timeInFuture ? setTimeout(loadVariation.bind({}, timeInFuture), 25) : console.log("loadVariation timed out!"); } })(Date.now() + 60000); // End variation JS return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, R_722219_1027_1_3_0:{ fn:function(){return (function(x) { try{ var el,ctx=vwo_$(x); /*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1739333374850"]')).remove(); var ctx=vwo_$(x),el; /*vwo_debug log("Revert","content",""); vwo_debug*/; el=vwo_$('[vwo-element-id="1739333374787"]'); el.revertContentOp().remove(); return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, R_722219_963_1_2_33:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)")).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)")}}, C_722219_963_1_2_34:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .m-0 > div:nth-of-type(1) > div:nth-of-type(4)"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .m-0 > div:nth-of-type(1) > div:nth-of-type(4)")}}, R_722219_963_1_2_34:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .m-0 > div:nth-of-type(1) > div:nth-of-type(4)"); vwo_debug*/(el=ctx).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .m-0 > div:nth-of-type(1) > div:nth-of-type(4)")}}, C_722219_963_1_2_35:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-download-links"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-download-links")}}, R_722219_963_1_2_35:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-download-links"); vwo_debug*/(el=ctx).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-download-links")}}, C_722219_963_1_2_36:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf")).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf")}}, R_722219_963_1_2_36:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf")).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .cmp-announcement-widget-xf")}}, C_722219_963_1_2_37:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container")).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container")}}, R_722219_963_1_2_37:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container"); vwo_debug*/(el=vwo_$("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container")).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .promotion-container")}}, C_722219_963_1_2_38:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(6)"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(6)")}}, R_722219_963_1_2_38:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(6)"); vwo_debug*/(el=ctx).vwoRevertCss();})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(6)")}}, C_722219_963_1_2_39:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove","html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(4)"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})("html.vwo_p_s_b4e3c967173ff0c7334aa142c9f54d98 .leo-row--gap-xs > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(2) > div:nth-of-type(2) > p:nth-of-type(4)")}}, ct_4ef8057a1a8301f556d56885eba84a87:{ fn:function(executeTrigger, vwo_$, config) { (function() { if (!config || typeof config !== "object") { return; } if (window.vwo_$(config.sel).length > 0) { return executeTrigger(); } window.VWO._.phoenixMT.once("vwo_mutObs." + config.triggerName, () => { if (window.vwo_$(config.sel).length > 0) { executeTrigger(); } }); })() } }, C_722219_889_1_2_0:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove",".breadcrumb > ul:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".breadcrumb > ul:nth-of-type(1)")).vwoCss({display:"none !important"});})(".breadcrumb > ul:nth-of-type(1)")}}, R_722219_889_1_2_0:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove",".breadcrumb > ul:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".breadcrumb > ul:nth-of-type(1)")).vwoRevertCss();})(".breadcrumb > ul:nth-of-type(1)")}}, C_722219_889_1_2_1:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove",".leo-py-md"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})(".leo-py-md")}}, R_722219_889_1_2_1:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove",".leo-py-md"); vwo_debug*/(el=ctx).vwoRevertCss();})(".leo-py-md")}}, C_722219_889_1_2_2:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x); /*vwo_debug log("remove",".main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)"); vwo_debug*/(el=ctx).vwoCss({display:"none !important"});})(".main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)")}}, R_722219_889_1_2_2:{ fn:function(log,nonce=''){return (function(x) { if(!vwo_$.fn.vwoRevertHtml){ return; }; var el,ctx=vwo_$(x); /*vwo_debug log("Revert","remove",".main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)"); vwo_debug*/(el=ctx).vwoRevertCss();})(".main > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(7)")}}},rules:[{"triggers":["11561410"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":4,"c":1028}]},"metricId":0}]},{"triggers":["11561413"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":6,"c":1028}]},"metricId":0}]},{"triggers":["11561416"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":8,"c":1028}]},"metricId":0}]},{"triggers":["10841803"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":1005}]},"metricId":1202800}]},{"triggers":["11534302"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":1005}]},"metricId":1263802}]},{"triggers":["2695525"],"tags":[{"id":"runCampaign","data":"campaigns.2","priority":4}]},{"triggers":["10577338"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":4,"c":998}]},"metricId":0}]},{"triggers":["5291080","11537446"],"tags":[{"id":"runCampaign","data":"campaigns.1028","priority":4}]},{"triggers":["3487732"],"tags":[{"id":"runCampaign","data":"campaigns.653","priority":4}]},{"triggers":["8890476","8890479","8890482"],"tags":[{"id":"runCampaign","data":"campaigns.763","priority":4}]},{"triggers":["11332921"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":3,"c":1029}]},"metricId":0}]},{"triggers":["3487735"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":3,"c":653}]},"metricId":0}]},{"triggers":["9850753"],"tags":[{"id":"runCampaign","data":"campaigns.759","priority":4}]},{"triggers":["3546160"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":816}]},"metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":963}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":819}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":997}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":657}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":763}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":889}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":4,"c":985}]},"id":"metric","metricId":423424},{"data":{"type":"m","campaigns":[{"g":1,"c":965}]},"id":"metric","metricId":423424}]},{"triggers":["10304266","10304269","10304272"],"tags":[{"id":"runCampaign","data":"campaigns.965","priority":4}]},{"triggers":["4496838"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":759}]},"metricId":466124},{"data":{"type":"m","campaigns":[{"g":1,"c":1029}]},"id":"metric","metricId":466124},{"data":{"type":"m","campaigns":[{"g":3,"c":998}]},"id":"metric","metricId":466124},{"data":{"type":"m","campaigns":[{"g":1,"c":1021}]},"id":"metric","metricId":466124},{"data":{"type":"m","campaigns":[{"g":12,"c":980}]},"id":"metric","metricId":466124},{"data":{"type":"m","campaigns":[{"g":1,"c":736}]},"id":"metric","metricId":466124}]},{"triggers":["4496841"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":759}]},"metricId":466127},{"data":{"type":"m","campaigns":[{"g":2,"c":1029}]},"id":"metric","metricId":466127},{"data":{"type":"m","campaigns":[{"g":2,"c":998}]},"id":"metric","metricId":466127},{"data":{"type":"m","campaigns":[{"g":2,"c":1021}]},"id":"metric","metricId":466127},{"data":{"type":"m","campaigns":[{"g":13,"c":980}]},"id":"metric","metricId":466127},{"data":{"type":"m","campaigns":[{"g":2,"c":736}]},"id":"metric","metricId":466127}]},{"triggers":["3546154","3546157"],"tags":[{"id":"runCampaign","data":"campaigns.657","priority":4}]},{"triggers":["5291080"],"tags":[{"id":"runCampaign","data":"campaigns.1027","priority":4},{"data":"campaigns.980","id":"runCampaign","priority":4},{"data":"campaigns.1005","id":"runCampaign","priority":4},{"data":"campaigns.736","id":"runCampaign","priority":4}]},{"triggers":["6644374","6644377","6644380"],"tags":[{"id":"runCampaign","data":"campaigns.819","priority":4}]},{"triggers":["2695522"],"tags":[{"id":"runCampaign","data":"campaigns.1","priority":4}]},{"triggers":["9268389","9268392","9268395"],"tags":[{"id":"runCampaign","data":"campaigns.889","priority":4}]},{"triggers":["10244176"],"tags":[{"id":"runCampaign","data":"campaigns.985","priority":4}]},{"triggers":["11534305"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":1005}]},"metricId":1263805}]},{"triggers":["10577314"],"tags":[{"id":"runCampaign","data":"campaigns.997","priority":4}]},{"triggers":["11308072"],"tags":[{"id":"runCampaign","data":"campaigns.1029","priority":4}]},{"triggers":["10770097","10770100"],"tags":[{"id":"runCampaign","data":"campaigns.1021","priority":4}]},{"triggers":["10635910"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":15,"c":980}]},"metricId":1188703}]},{"triggers":["9125625"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":16,"c":980}]},"metricId":1032369}]},{"triggers":["9125532"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":17,"c":980}]},"metricId":1032258}]},{"triggers":["10641040"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":18,"c":980}]},"metricId":1189237}]},{"triggers":["9522690","9522693","9522696"],"tags":[{"id":"runCampaign","data":"campaigns.963","priority":4}]},{"triggers":["11561404"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":6,"c":1027}]},"metricId":0}]},{"triggers":["11561398"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":1,"c":1027}]},"metricId":0}]},{"triggers":["11561401"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":4,"c":1027}]},"metricId":0}]},{"triggers":["11537467"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":1027}]},"metricId":1242532}]},{"triggers":["10320859"],"tags":[{"id":"runCampaign","data":"campaigns.998","priority":4}]},{"triggers":["8857305","8857308","8857311"],"tags":[{"id":"runCampaign","data":"campaigns.816","priority":4}]},{"triggers":["10583434"],"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":14,"c":980}]},"metricId":1184620}]},{"triggers":["11561407"],"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":1,"c":1028}]},"metricId":0}]},{"triggers":["8"],"tags":[{"id":"groupCampaigns","priority":2},{"priority":3,"id":"prePostMutation"}]},{"triggers":["9"],"tags":[{"id":"visibilityService","priority":2}]},{"triggers":["2"],"tags":[{"id":"runTestCampaign"}]},{"triggers":["75"],"tags":[{"id":"urlChange"}]},{"triggers":["5"],"tags":[{"id":"checkEnvironment"}]}],pages:{"ec":[{"560865":{"inc":["o",["url","urlReg","(?i).*"]]}}]},pagesEval:{"ec":[560865]}}})(); ;;var commonWrapper=function(argument){if(!argument){argument={valuesGetter:function(){return{}},valuesSetter:function(){},verifyData:function(){return{}}}}const getVisitorUuid=function(){if(window._vwo_acc_id>=1037725){return window.VWO&&window.VWO.get("visitor.id")}else{return window.VWO._&&window.VWO._.cookies&&window.VWO._.cookies.get("_vwo_uuid")}};var pollInterval=100;var timeout=6e4;return function(){var accountIntegrationSettings={};var _interval=null;function waitForAnalyticsVariables(){try{accountIntegrationSettings=argument.valuesGetter();accountIntegrationSettings.visitorUuid=getVisitorUuid()}catch(error){accountIntegrationSettings=undefined}if(accountIntegrationSettings&&argument.verifyData(accountIntegrationSettings)){argument.valuesSetter(accountIntegrationSettings);return 1}return 0}var currentTime=0;_interval=setInterval((function(){currentTime=currentTime||performance.now();var result=waitForAnalyticsVariables();if(result||performance.now()-currentTime>=timeout){clearInterval(_interval)}}),pollInterval)}}; commonWrapper({valuesGetter:function(){return {"ga4s":0}},valuesSetter:function(data){var singleCall=data["ga4s"]||0;if(singleCall){window.sessionStorage.setItem("vwo-ga4-singlecall",true)}var ga4_device_id="";if(typeof window.VWO._.cookies!=="undefined"){ga4_device_id=window.VWO._.cookies.get("_ga")||""}if(ga4_device_id){window.vwo_ga4_uuid=ga4_device_id.split(".").slice(-2).join(".")}},verifyData:function(data){if(typeof window.VWO._.cookies!=="undefined"){return window.VWO._.cookies.get("_ga")||""}else{return false}}})(); var pushBasedCommonWrapper=function(argument){var firedCamp={};if(!argument){argument={integrationName:"",getExperimentList:function(){},accountSettings:function(){},pushData:function(){}}}return function(){window.VWO=window.VWO||[];const getVisitorUuid=function(){if(window._vwo_acc_id>=1037725){return window.VWO&&window.VWO.get("visitor.id")}else{return window.VWO._&&window.VWO._.cookies&&window.VWO._.cookies.get("_vwo_uuid")}};var sendDebugLogsOld=function(expId,variationId,errorType,user_type,data){try{var errorPayload={f:argument["integrationName"]||"",a:window._vwo_acc_id,url:window.location.href,exp:expId,v:variationId,vwo_uuid:getVisitorUuid(),user_type:user_type};if(errorType=="initIntegrationCallback"){errorPayload["log_type"]="initIntegrationCallback";errorPayload["data"]=JSON.stringify(data||"")}else if(errorType=="timeout"){errorPayload["timeout"]=true}if(window.VWO._.customError){window.VWO._.customError({msg:"integration debug",url:window.location.href,lineno:"",colno:"",source:JSON.stringify(errorPayload)})}}catch(e){window.VWO._.customError&&window.VWO._.customError({msg:"integration debug failed",url:"",lineno:"",colno:"",source:""})}};var sendDebugLogs=function(expId,variationId,errorType,user_type){var eventName="vwo_debugLogs";var eventPayload={};try{eventPayload={intName:argument["integrationName"]||"",varId:variationId,expId:expId,type:errorType,vwo_uuid:getVisitorUuid(),user_type:user_type};if(window.VWO._.event){window.VWO._.event(eventName,eventPayload,{enableLogs:1})}}catch(e){eventPayload={msg:"integration event log failed",url:window.location.href};window.VWO._.event&&window.VWO._.event(eventName,eventPayload)}};const callbackFn=function(data){if(!data)return;var expId=data[1],variationId=data[2],repeated=data[0],singleCall=0,debug=0;var experimentList=argument.getExperimentList();var integrationName=argument["integrationName"]||"vwo";if(typeof argument.accountSettings==="function"){var accountSettings=argument.accountSettings();if(accountSettings){singleCall=accountSettings["singleCall"];debug=accountSettings["debug"]}}if(debug){sendDebugLogs(expId,variationId,"intCallTriggered",repeated)}if(singleCall&&(repeated==="vS"||repeated==="vSS")||firedCamp[expId]){return}window.expList=window.expList||{};var expList=window.expList[integrationName]=window.expList[integrationName]||[];if(expId&&variationId&&["VISUAL_AB","VISUAL","SPLIT_URL"].indexOf(_vwo_exp[expId].type)>-1){if(experimentList.indexOf(+expId)!==-1){firedCamp[expId]=variationId;var visitorUuid=getVisitorUuid();var pollInterval=100;var currentTime=0;var timeout=6e4;var user_type=_vwo_exp[expId].exec?"vwo-retry":"vwo-new";var interval=setInterval((function(){if(expList.indexOf(expId)!==-1){clearInterval(interval);return}currentTime=currentTime||performance.now();var toClearInterval=argument.pushData(expId,variationId,visitorUuid);if(debug&&toClearInterval){sendDebugLogsOld(expId,variationId,"",user_type);sendDebugLogs(expId,variationId,"intDataPushed",user_type)}var isTimeout=performance.now()-currentTime>=timeout;if(isTimeout&&debug){sendDebugLogsOld(expId,variationId,"timeout",user_type);sendDebugLogs(expId,variationId,"intTimeout",user_type)}if(toClearInterval||isTimeout){clearInterval(interval)}if(toClearInterval){window.expList[integrationName].push(expId)}}),pollInterval||100)}}};window.VWO.push(["onVariationApplied",callbackFn]);window.VWO.push(["onVariationShownSent",callbackFn])}}; var surveyDataCommonWrapper=function(argument){if(!argument){argument={getCampaignList:function(){return[]},surveyStatusChange:function(){},answerSubmitted:function(){}}}return function(){window.VWO=window.VWO||[];function getValuesFromAnswers(answers){var values=[];for(var i=0;i=timeout;if(toClearInterval||isTimeout){clearInterval(interval)}}),pollInterval)}}window.VWO.push(["onSurveyShown",function(data){commonSurveyCallback(data,argument.surveyStatusChange,"surveyShown")}]);window.VWO.push(["onSurveyCompleted",function(data){commonSurveyCallback(data,argument.surveyStatusChange,"surveyCompleted")}]);window.VWO.push(["onSurveyAnswerSubmitted",function(data){commonSurveyCallback(data,argument.answerSubmitted,"surveySubmitted")}])}}; (function(){var VWOOmniTemp={};window.VWOOmni=window.VWOOmni||{};for(var key in VWOOmniTemp)Object.prototype.hasOwnProperty.call(VWOOmniTemp,key)&&(window.VWOOmni[key]=VWOOmniTemp[key]);window._vwoIntegrationsLoaded=1;pushBasedCommonWrapper({integrationName:"GA4",getExperimentList:function(){return [736,759,980,985,1021,997,998,1005,1027,1028,1029]},accountSettings:function(){var accountIntegrationSettings={"setupVia":"","manualSetup":false,"dataVariable":""};if(accountIntegrationSettings["debugType"]=="ga4"&&accountIntegrationSettings["debug"]){accountIntegrationSettings["debug"]=1}else{accountIntegrationSettings["debug"]=0}return accountIntegrationSettings},pushData:function(expId,variationId){var accountIntegrationSettings={"setupVia":"","manualSetup":false,"dataVariable":""};var ga4Setup=accountIntegrationSettings["setupVia"]||"gtag";if(typeof window.gtag!=="undefined"&&ga4Setup=="gtag"){window.gtag("event","VWO",{vwo_campaign_name:window._vwo_exp[expId].name+":"+expId,vwo_variation_name:window._vwo_exp[expId].comb_n[variationId]+":"+variationId});window.gtag("event","experience_impression",{exp_variant_string:"VWO-"+expId+"-"+variationId});return true}return false}})();pushBasedCommonWrapper({integrationName:"GA4-GTM",getExperimentList:function(){return [736,759,980,985,1021,997,998,1005,1027,1028,1029]},accountSettings:function(){var accountIntegrationSettings={"setupVia":"","manualSetup":false,"dataVariable":""};if(accountIntegrationSettings["debugType"]=="gtm"&&accountIntegrationSettings["debug"]){accountIntegrationSettings["debug"]=1}else{accountIntegrationSettings["debug"]=0}return accountIntegrationSettings},pushData:function(expId,variationId){var accountIntegrationSettings={"setupVia":"","manualSetup":false,"dataVariable":""};var ga4Setup=accountIntegrationSettings["setupVia"]||"gtm";var dataVariable=accountIntegrationSettings["dataVariable"]||"dataLayer";if(typeof window[dataVariable]!=="undefined"&&ga4Setup=="gtm"){window[dataVariable].push({event:"vwo-data-push-ga4",vwo_exp_variant_string:"VWO-"+expId+"-"+variationId});return true}return false}})(); ;})();(function(){window.VWO=window.VWO||[];var pollInterval=100;var _vis_data={};var intervalObj={};var analyticsTimerObj={};var experimentListObj={};window.VWO.push(["onVariationApplied",function(data){if(!data){return}var expId=data[1],variationId=data[2];if(expId&&variationId&&["VISUAL_AB","VISUAL","SPLIT_URL"].indexOf(window._vwo_exp[expId].type)>-1){}}])})();; ;var vD=VWO.data||{};VWO.data={content:{"fns":{"list":{"args":{"1":{"6625f8d396bba":"1719722863","6678ed3f31d18":"1733983463","66875a9973fa4":"1727406621","6678ed65bfb87":"1733983463"}},"vn":1}}},as:"r5.visualwebsiteoptimizer.com",dacdnUrl:"https://dev.visualwebsiteoptimizer.com",accountJSInfo:{"mrp":20,"pvn":0,"pc":{"a":100,"t":100},"gC":[{"wt":{"909":99.999998},"id":1,"c":[909],"et":2,"t":1},{"wt":{"899":50,"901":50},"id":5,"c":[901,899],"et":2,"t":1}],"noSS":false,"rp":90,"url":{},"ts":1740254179}};for(var k in vD){VWO.data[k]=vD[k]};;var gcpfb=function(a,loadFunc,status,err,success){function vwoErr() {_vwo_err({message:"Google_Cdn failing for " + a + ". Trying Fallback..",code:"cloudcdnerr",status:status});} if(a.indexOf("/cdn/")!==-1){loadFunc(a.replace("cdn/",""),err,success); vwoErr(); return true;} else if(a.indexOf("/dcdn/")!==-1&&a.indexOf("evad.js") !== -1){loadFunc(a.replace("dcdn/",""),err,success); vwoErr(); return true;}};window.VWO=window.VWO || [];window.VWO._= window.VWO._ || {};window.VWO._.gcpfb=gcpfb;;var d={cookie:document.cookie,URL:document.URL,referrer:document.referrer};var w={VWO:{_:{}},location:{href:window.location.href,search:window.location.search},_vwoCc:window._vwoCc};;window._vwo_cdn="https://dev.visualwebsiteoptimizer.com/cdn/";window._vwo_apm_debug_cdn="https://dev.visualwebsiteoptimizer.com/cdn/";window.VWO._.useCdn=true;window.vwo_eT="br";window._VWO=window._VWO||{};window._VWO.fSeg=["866"];window._VWO.dcdnUrl="/dcdn/settings.js";window.VWO.sTs=1740149319;window._VWO._vis_nc_lib=window._vwo_cdn+"edrv/nc-dca9e8e58ebbedbf4f612cbe1de5de17br.js";var loadWorker=function(url){_vwo_code.load(url,{dSC: true, onloadCb: function(xhr,a){window._vwo_wt_l=true;if(xhr.status===200 ||xhr.status===304){var code="var window="+JSON.stringify(w)+",document="+JSON.stringify(d)+";window.document=document;"+xhr.responseText;var blob=new Blob([code||"throw new Error('code not found!');"],{type:"application/javascript"}),url=URL.createObjectURL(blob);window.mainThread={webWorker:new Worker(url)};window.vwoChannelFW=new MessageChannel();window.vwoChannelToW=new MessageChannel();window.mainThread.webWorker.postMessage({vwoChannelToW:vwoChannelToW.port1,vwoChannelFW:vwoChannelFW.port2},[vwoChannelToW.port1, vwoChannelFW.port2]);if(!window._vwo_mt_f)return window._vwo_wt_f=true;_vwo_code.addScript({text:window._vwo_mt_f});delete window._vwo_mt_f}else{if(gcpfb(a,loadWorker,xhr.status)){return;}_vwo_code.finish("&e=loading_failure:"+a)}}, onerrorCb: function(a){if(gcpfb(a,loadWorker)){return;}window._vwo_wt_l=true;_vwo_code.finish("&e=loading_failure:"+a);}})};loadWorker("https://dev.visualwebsiteoptimizer.com/cdn/edrv/worker-98e040cb58fefde2b754a8c3fcc6ba8cbr.js");;var _vis_opt_file;var _vis_opt_lib;if(window.VWO._.allSettings.dataStore.previewExtraSettings!=undefined&&window.VWO._.allSettings.dataStore.previewExtraSettings.isSurveyPreviewMode){var surveyHash=window.VWO._.allSettings.dataStore.plugins.LIBINFO.SURVEY_DEBUG_EVENTS.HASH;var param1="evad.js?va=";var param2="&d=debugger_new";var param3="&sp=1&a=722219&sh="+surveyHash;_vis_opt_file=vwoCode.use_existing_jquery&&typeof vwoCode.use_existing_jquery()!=="undefined"?vwoCode.use_existing_jquery()?param1+"vanj"+param2:param1+"va_gq"+param2:param1+"edrv/va_gq-ab1a91b572e7545bf54dabb34d20e2edbr.js"+param2;_vis_opt_file=_vis_opt_file+param3;_vis_opt_lib="https://dev.visualwebsiteoptimizer.com/dcdn/"+_vis_opt_file}else if(window.VWO._.allSettings.dataStore.mode!=undefined&&window.VWO._.allSettings.dataStore.mode=="PREVIEW"){ var path1 = 'edrv/pd_'; var path2 = window.VWO._.allSettings.dataStore.plugins.LIBINFO.EVAD.HASH + ".js"; ;_vis_opt_file=vwoCode.use_existing_jquery&&typeof vwoCode.use_existing_jquery()!=="undefined"?vwoCode.use_existing_jquery()?path1+"vanj"+path2:path1+"va_gq"+path2:path1+"edrv/va_gq-ab1a91b572e7545bf54dabb34d20e2edbr.js"+path2;_vis_opt_lib="https://dev.visualwebsiteoptimizer.com/cdn/"+_vis_opt_file}else{_vis_opt_file=vwoCode.use_existing_jquery&&typeof vwoCode.use_existing_jquery()!=="undefined"?vwoCode.use_existing_jquery()?"edrv/vanj-4654aedf44335d951c8f0eab22c8be6fbr.js":"edrv/va_gq-ab1a91b572e7545bf54dabb34d20e2edbr.js":"edrv/va_gq-ab1a91b572e7545bf54dabb34d20e2edbr.js"}window._vwo_library_timer=setTimeout((function(){vwoCode.removeLoaderAndOverlay&&vwoCode.removeLoaderAndOverlay();vwoCode.finish()}),vwoCode.library_tolerance&&typeof vwoCode.library_tolerance()!=="undefined"?vwoCode.library_tolerance():2500),_vis_opt_lib=typeof _vis_opt_lib=="undefined"?window._vwo_cdn+_vis_opt_file:_vis_opt_lib;var loadLib=function(url){_vwo_code.load(url, {dSC: true, onloadCb:function(xhr,a){window._vwo_mt_l=true;if(xhr.status===200 || xhr.status===304){if(!window._vwo_wt_f)return window._vwo_mt_f=xhr.responseText;_vwo_code.addScript({text:xhr.responseText});delete window._vwo_wt_f;}else{if(gcpfb(a,loadLib,xhr.status)){return;}_vwo_code.finish("&e=loading_failure:"+a);}}, onerrorCb: function(a){if(gcpfb(a,loadLib)){return;}window._vwo_mt_l=true;_vwo_code.finish("&e=loading_failure:"+a);}})};loadLib(_vis_opt_lib);VWO.load_co=function(u,opts){return window._vwo_code.load(u,opts);};;;}}catch(e){_vwo_code.finish();_vwo_code.removeLoaderAndOverlay&&_vwo_code.removeLoaderAndOverlay();_vwo_err(e);window.VWO.caE=1}})();

Be wary of phishing scams. Please visit our Security Advisory page for more information.

Assign policy to new owner

Assigning a policy to a new owner, also called an absolute assignment, is a transfer of ownership from the existing policyholder (assignor) to another person or company/institution (assignee). 

The assignee becomes the new policyholder and assumes full legal rights over the policy. All proceeds, including surrender, maturity and claims will be payable to the assignee.

A policy can be assigned if both assignor and assignee are of sound mind, not bankrupt or under duress, and if the policy is:

  • Not using CPF/SRS funds for premium payments
  • Not effected under trust
  • Not used to be exempted from CPF Board's Home Protection Scheme (HPS)
  • Allowed to be assigned under the plan

Additionally, the assignor must be at least 18 years old. For policies issued on or after 1 March 2009, the assignee must be at least 18 years old. For policies issued before 1 March 2009, the assignee must be at least 21 years old.

 

How to assign a policy to a new owner

Both the assignor and assignee must come to our Customer Service Centre at the following address with their NRICs:

1 Pickering Street
Great Eastern Centre #01-01
Singapore 048659

If the assignment is made between spouses, parent and child, or siblings, and relationship can be established by producing a marriage or birth certificate, they need not be present at our Customer Service Centre. You can call our Customer Service Officers at 1800 248 2888 for assistance in making the assignment.

 

Questions and Answers

No. Once a policy is absolutely assigned, the policy ownership will belong to the assignee. However, the policy ownership can be transferred back to you provided the assignee agrees to it. A new assignment will need to be done.

You can still assign the policy if the nomination made is a revocable nomination. The revocable nomination will be automatically revoked once the policy is assigned. If the policy has a trust nomination, the trust nomination will have to be revoked before you make an assignment.