Campaigns to reward users

Overview

Certain user actions on your website or on your app can be rewarded using On Site Messaging(OSM). There are a few user actions that you may choose to incentivize using Coupon codes. Some examples of user actions to incentivize are:  

Web Push Opt-In

Generally, Web Push Opt-In rates are very low. You may increase the subscription to Web-Push using various user incentives immediately after s/he accepts the Web Push using OSM. Refer to the below video to see this use case in action. 

To achieve this, set up an OSM with 'Allowed Web Push Subscription' as the trigger event. Refer to this document to learn how to create an event triggered OSM campaign. 

The content and placement of the OSM require a Custom HTML template.

Custom HTML

Create a Custom HTML template for the content and its placement.

HTML

<html><head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=ABeeZee|Abel|Aclonica|Acme|Actor|Advent+Pro|Alata|Alatsi|Aldrich|Alef|Alegreya+Sans|Alegreya+Sans+SC|Allerta|Allerta+Stencil|Almarai|Amaranth|Amiko|Anaheim|Andika|Andika+New+Basic|Antic|Anton|Archivo|Archivo+Black|Archivo+Narrow|Arimo|Armata|Arsenal|Arya|Asap|Asap+Condensed|Assistant|Asul|Athiti|Average+Sans|B612|Bai+Jamjuree|Barlow|Barlow+Condensed|Barlow+Semi+Condensed|Basic|Be+Vietnam|Belleza|BenchNine|Biryani|Black+And+White+Picture|Black+Han+Sans|Blinker|Bubbler+One|Cabin|Cabin+Condensed|Cagliostro|Cairo|Cambay|Candal|Cantarell|Cantora+One|Capriola|Carme|Carrois+Gothic|Carrois+Gothic+SC|Catamaran|Chakra+Petch|Changa|Chathura|Chau+Philomene+One|Chivo|Coda+Caption|Commissioner|Convergence|Cuprum|DM+Sans|Darker+Grotesque|Days+One|Denk+One|Dhurjati|Didact+Gothic|Do+Hyeon|Doppio+One|Dorsa|Dosis|Duru+Sans|Economica|El+Messiri|Electrolize|Encode+Sans|Encode+Sans+Condensed|Encode+Sans+Expanded|Encode+Sans+Semi+Condensed|Encode+Sans+Semi+Expanded|Englebert|Epilogue|Exo|Exo+2|Fahkwang|Farro|Federo|Fira+Sans|Fira+Sans+Condensed|Fira+Sans+Extra+Condensed|Fjalla+One|Francois+One|Fresca|GFS+Neohellenic|Gafata|Galdeano|Gayathri|Geo|Gidugu|Gothic+A1|Gotu|Gudea|Hammersmith+One|Harmattan|Heebo|Hind|Hind+Guntur|Hind+Madurai|Hind+Siliguri|Hind+Vadodara|Homenaje|IBM+Plex+Sans|IBM+Plex+Sans+Condensed|Imprima|Inder|Inria+Sans|Inter|Istok+Web|Jaldi|Jockey+One|Josefin+Sans|Jost|Jua|Julius+Sans+One|Jura|K2D|Kanit|Kantumruy|Karla|Khand|Khula|Kite+One|KoHo|Kodchasan|Kosugi|Kosugi+Maru|Krona+One|Krub|Kulim+Park|Kumbh+Sans|Lato|Lekton|Lexend+Deca|Lexend+Exa|Lexend+Giga|Lexend+Mega|Lexend+Peta|Lexend+Tera|Lexend+Zetta|Libre+Franklin|Livvic|M+PLUS+1p|M+PLUS+Rounded+1c|Mada|Magra|Mako|Mallanna|Mandali|Manjari|Manrope|Marmelad|Martel+Sans|Marvel|Maven+Pro|Meera+Inimai|Merriweather+Sans|Metrophobic|Michroma|Mina|Miriam+Libre|Mitr|Molengo|Monda|Montserrat|Montserrat+Alternates|Montserrat+Subrayada|Mouse+Memoirs|Mukta|Mukta+Mahee|Mukta+Malar|Mukta+Vaani|Mulish|NTR|Nanum+Gothic|News+Cycle|Niramit|Nobile|Notable|Noto+Sans|Noto+Sans+HK|Noto+Sans+JP|Noto+Sans+KR|Noto+Sans+SC|Noto+Sans+TC|Numans|Nunito|Nunito+Sans|Open+Sans|Open+Sans+Condensed|Orbitron|Orienta|Oswald|Overpass|Oxygen|PT+Sans|PT+Sans+Caption|PT+Sans+Narrow|Padauk|Palanquin|Palanquin+Dark|Pathway+Gothic+One|Pattaya|Pavanam|Paytone+One|Philosopher|Play|Pontano+Sans|Poppins|Port+Lligat+Sans|Pragati+Narrow|Prompt|Proza+Libre|Public+Sans|Puritan|Quantico|Quattrocento+Sans|Questrial|Quicksand|Rajdhani|Raleway|Ramabhadra|Rambla|Rationale|Recursive|Red+Hat+Display|Red+Hat+Text|Reem+Kufi|Roboto|Roboto+Condensed|Ropa+Sans|Rosario|Rubik|Rubik+Mono+One|Ruda|Ruluko|Rum+Raisin|Russo+One|Saira|Saira+Condensed|Saira+Extra+Condensed|Saira+Semi+Condensed|Sansita|Sarabun|Sarala|Sarpanch|Sawarabi+Gothic|Sawarabi+Mincho|Scada|Secular+One|Sen|Seymour+One|Shanti|Share+Tech|Signika|Signika+Negative|Sintony|Six+Caps|Snippet|Sora|Source+Sans+Pro|Space+Grotesk|Spartan|Spinnaker|Strait|Stylish|Sulphur+Point|Sunflower|Syncopate|Syne|Tajawal|Tauri|Teko|Telex|Tenali+Ramakrishna|Tenor+Sans|Text+Me+One|Thasadith|Timmana|Titillium+Web|Tomorrow|Trispace|Ubuntu|Ubuntu+Condensed|Varela|Varela+Round|Varta|Viga|Voltaire|Wendy+One|Wire+One|Work+Sans|Yanone+Kaffeesatz|Yantramanav">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/coliff/bootstrap-rfs/bootstrap-rfs.css">
     <meta name="viewport" content="width=device-width, initial-scale=1.0" charset="UTF-8">
       <style>
            .close-icon {
                position: absolute;
                top: 5px;
                right: 1px;
                width: 32px;
                height: 32px;
                color: #000000;
            }

                   .coupon {
                background-color: white;
                border: solid 1px #1F610C;
                padding:5%;
                min-width: 300px;
                max-height: 500px;
                box-shadow: 5px 5px 5px 5px rgb(0 0 0 / 100%);
            }

.title{
  font-weight:900;
  line-height: 2.6;
  font-family: "Open Sans", sans-serif !important
  font-size: 14px !important;

}
.message{
font-family: "Open Sans", sans-serif;!important
  line-height: 2.6;
  font-size: 14px !important;

}
.couponbtn{

            height: 30px !important;
            min-width: 150px ;
            font-size: 14px !important;
            cursor: pointer !important;
            line-height: 1.1em !important;
            border-radius: 4px !important;
            color: #fff !important;
            background:linear-gradient(to bottom, #1F610C, #1F610C) !important;
            border: 1px solid #1F610C !important;
            display: inline-block !important;
            font-weight: 400 !important;
            margin: 0 0 0 23% !important;
            padding: 5px !important;
            text-transform: none !important;
            box-sizing: border-box !important;
            font-family: Arial !important;
            text-shadow: none !important;
            box-shadow: none !important;
            white-space: nowrap !important
            
            
}

            body {
                display: inline-block;
                overflow: hidden;
                background: transparent;
                margin: 0px;
                padding: 0px;
            }
        </style>
        <style id="moe-media-queries">
          @media (max-width: 768px) {
            .image-container {
                background-position: center;
                background-repeat: no-repeat;
                min-height: 250px;
                max-width:100%;
            }
            .close-icon {
              position: absolute;
              top: 4px;
              right: 15px;
              width: 32px;
              height: 32px;
              color: #000000;
            }
          }
        </style>
    </head>
    <body data-template-type="SIDE_BANNER" marginheight="0" data--w-e-b="top_right" class="" style="z-index: 9999;">
   <div style="position: relative; z-index: 999999; background-color: rgb(255, 255, 255);" data-id="CONTAINER" data-editor-type="MOE_EDITOR" class="moe-element moe-container">
  <div class="coupon"><p><span class="message">Here you go!</span><br><span class="message">Use coupon code NEW20 to get Flat 20% OFF.</span></p>
   
            <button data-id="COUPONCOPY" id="copy" class="couponbtn moe-inapp-click">Copy Coupon Code</button></div>
            <img data-id="IMAGE" class="image-container moe-element" src="https://all-campaign-images-moe-staging.s3.amazonaws.com/campaigns/static/inapps/templates/images/sidebanner_image.png" style="z-index: 999999; display: none;">
            <button data-id="CLOSE" type="button" class="close close-icon moe-inapp-close moe-element" aria-label="Close" id="close-icon"> x </button>
        </div>
    <script>
      var copy = document.getElementById("copy");
      
      copy.onclick = function(){
        navigator.clipboard.writeText("NEW20");
        document.getElementById("copy").innerHTML = "Copied!"
      }
    </script>

</body></html>

 

info

Note

  • Use a template with the option to select the OSM position.

  • Select the required position after the code is copied.

  • Edit Line 95 of the HTML code to change content.

  • Edit Line 105 of the HTML code to change the coupon code after it is copied.

User Detail Submission

MoEngage helps capture details of the user when they visit your website through lead generation template in our OSM library. Adding an incentive for filling this pop-up will help in higher conversions. This use case helps you to configure a static coupon code to be displayed to the user, when the user enters a mobile number and clicks 'Subscribe Now'. Refer to the below video to see this use case in action. 

Refer to this document to learn how to create an OSM campaign. The content and placement of the OSM require a Custom HTML template.

Custom HTML

Create a Custom HTML template for the content and its placement.

HTML

<html><head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=ABeeZee|Abel|Aclonica|Acme|Actor|Advent+Pro|Alata|Alatsi|Aldrich|Alef|Alegreya+Sans|Alegreya+Sans+SC|Allerta|Allerta+Stencil|Almarai|Amaranth|Amiko|Anaheim|Andika|Andika+New+Basic|Antic|Anton|Archivo|Archivo+Black|Archivo+Narrow|Arimo|Armata|Arsenal|Arya|Asap|Asap+Condensed|Assistant|Asul|Athiti|Average+Sans|B612|Bai+Jamjuree|Barlow|Barlow+Condensed|Barlow+Semi+Condensed|Basic|Be+Vietnam|Belleza|BenchNine|Biryani|Black+And+White+Picture|Black+Han+Sans|Blinker|Bubbler+One|Cabin|Cabin+Condensed|Cagliostro|Cairo|Cambay|Candal|Cantarell|Cantora+One|Capriola|Carme|Carrois+Gothic|Carrois+Gothic+SC|Catamaran|Chakra+Petch|Changa|Chathura|Chau+Philomene+One|Chivo|Coda+Caption|Commissioner|Convergence|Cuprum|DM+Sans|Darker+Grotesque|Days+One|Denk+One|Dhurjati|Didact+Gothic|Do+Hyeon|Doppio+One|Dorsa|Dosis|Duru+Sans|Economica|El+Messiri|Electrolize|Encode+Sans|Encode+Sans+Condensed|Encode+Sans+Expanded|Encode+Sans+Semi+Condensed|Encode+Sans+Semi+Expanded|Englebert|Epilogue|Exo|Exo+2|Fahkwang|Farro|Federo|Fira+Sans|Fira+Sans+Condensed|Fira+Sans+Extra+Condensed|Fjalla+One|Francois+One|Fresca|GFS+Neohellenic|Gafata|Galdeano|Gayathri|Geo|Gidugu|Gothic+A1|Gotu|Gudea|Hammersmith+One|Harmattan|Heebo|Hind|Hind+Guntur|Hind+Madurai|Hind+Siliguri|Hind+Vadodara|Homenaje|IBM+Plex+Sans|IBM+Plex+Sans+Condensed|Imprima|Inder|Inria+Sans|Inter|Istok+Web|Jaldi|Jockey+One|Josefin+Sans|Jost|Jua|Julius+Sans+One|Jura|K2D|Kanit|Kantumruy|Karla|Khand|Khula|Kite+One|KoHo|Kodchasan|Kosugi|Kosugi+Maru|Krona+One|Krub|Kulim+Park|Kumbh+Sans|Lato|Lekton|Lexend+Deca|Lexend+Exa|Lexend+Giga|Lexend+Mega|Lexend+Peta|Lexend+Tera|Lexend+Zetta|Libre+Franklin|Livvic|M+PLUS+1p|M+PLUS+Rounded+1c|Mada|Magra|Mako|Mallanna|Mandali|Manjari|Manrope|Marmelad|Martel+Sans|Marvel|Maven+Pro|Meera+Inimai|Merriweather+Sans|Metrophobic|Michroma|Mina|Miriam+Libre|Mitr|Molengo|Monda|Montserrat|Montserrat+Alternates|Montserrat+Subrayada|Mouse+Memoirs|Mukta|Mukta+Mahee|Mukta+Malar|Mukta+Vaani|Mulish|NTR|Nanum+Gothic|News+Cycle|Niramit|Nobile|Notable|Noto+Sans|Noto+Sans+HK|Noto+Sans+JP|Noto+Sans+KR|Noto+Sans+SC|Noto+Sans+TC|Numans|Nunito|Nunito+Sans|Open+Sans|Open+Sans+Condensed|Orbitron|Orienta|Oswald|Overpass|Oxygen|PT+Sans|PT+Sans+Caption|PT+Sans+Narrow|Padauk|Palanquin|Palanquin+Dark|Pathway+Gothic+One|Pattaya|Pavanam|Paytone+One|Philosopher|Play|Pontano+Sans|Poppins|Port+Lligat+Sans|Pragati+Narrow|Prompt|Proza+Libre|Public+Sans|Puritan|Quantico|Quattrocento+Sans|Questrial|Quicksand|Rajdhani|Raleway|Ramabhadra|Rambla|Rationale|Recursive|Red+Hat+Display|Red+Hat+Text|Reem+Kufi|Roboto|Roboto+Condensed|Ropa+Sans|Rosario|Rubik|Rubik+Mono+One|Ruda|Ruluko|Rum+Raisin|Russo+One|Saira|Saira+Condensed|Saira+Extra+Condensed|Saira+Semi+Condensed|Sansita|Sarabun|Sarala|Sarpanch|Sawarabi+Gothic|Sawarabi+Mincho|Scada|Secular+One|Sen|Seymour+One|Shanti|Share+Tech|Signika|Signika+Negative|Sintony|Six+Caps|Snippet|Sora|Source+Sans+Pro|Space+Grotesk|Spartan|Spinnaker|Strait|Stylish|Sulphur+Point|Sunflower|Syncopate|Syne|Tajawal|Tauri|Teko|Telex|Tenali+Ramakrishna|Tenor+Sans|Text+Me+One|Thasadith|Timmana|Titillium+Web|Tomorrow|Trispace|Ubuntu|Ubuntu+Condensed|Varela|Varela+Round|Varta|Viga|Voltaire|Wendy+One|Wire+One|Work+Sans|Yanone+Kaffeesatz|Yantramanav">
    <style>
        .container {
            background: #ffffff;
            padding: 20px;
            display: inline-block;
            text-align: center;
            width: 340px;
            position: relative;
            border: 1px solid #cccccc;
            max-width: 800px;
            word-break: break-all;
            background-repeat: no-repeat;
            background-size: 100%;
        }

        .flex-v-container {
            display: flex;
            flex-direction: column;
            margin-top: 50px;
        }

        .input-container {
            margin-top: 20px;
            padding: 10px;
            border: 0px solid transparent;
            border-bottom: 1px solid #ccc;
            width: 90%;
        }

        .button-container {
            margin-top: 20px;
            background: #000000;
            color: #ffffff;
            padding: 10px;
            padding-right: 20px;
            padding-left: 20px;
            font-weight: bold;
            font-family: Montserrat;
            font-size: 14px;
            width: 90%;
            cursor: pointer;
        }

        .header {
            font-size: 27px;
            font-family: Montserrat;
            font-weight: bold;
            word-break: break-word;
        }

        .title {
            font-size: 22px;
            font-family: Montserrat;
            word-break: break-word;
        }

        .close-icon {
            position: absolute;
            top: 10px;
            right: 10px;
            border: none;
            font-size: 20px;
            cursor: pointer;
            background: transparent;
        }

        button:focus {
            outline: none;
        }

        input:focus {
            outline: none;
            border-bottom: 1px solid #000000;
        }

        body {
            display: flex;
            flex: 1;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-repeat: no-repeat;
        }

        @media only screen and (max-width: 600px) {
            .container {
                width: 100%;
                background-size: 100%;
                margin: 10px;
                /* background-position: center center; */

            }

            .lead-gen-container {
                min-width: 300px;
            }
        }

        .moe-error {
            border: 1px solid #ec4b39;
        }

        .moe-error-text.invisible {
            display: none;
        }

        .moe-error-text {
            color: red;
            font-size: 12px;
            margin-top: 1px;
        }

        .lead-gen-container {
            background: #fff;
        }
    </style>
</head>

<body data-editor-type="MOE_EDITOR" data-template-type="LEAD_GEN" marginheight="0" data--w-e-b="center" class="" data-new-gr-c-s-check-loaded="14.1073.0" data-gr-ext-installed="" style="z-index: 9999;" data-new-gr-c-s-loaded="14.1068.0">
    <div style="display: flex; justify-content: center; position: relative;" class="lead-gen-container">
        <div class="container moe-container moe-element" data-id="CONTAINER" style="z-index: 999999; background-image: none; background-color: transparent;">
            <div class="no-bounds">
                <img src="https://cdn.shopify.com/s/files/1/0092/3831/5068/files/330x300.jpg?v=1657876112" style="z-index: 999999;">

                <p id="title" class="title moe-element" data-id="HEADER2" style="z-index: 999999; display: inline-block;" contenteditable="false">Sign Up to be a
                    Avail 10% off instantly</p>
                <p id="s_thnx" class="s_thnx" style="z-index: 999999; display: none;">Thank you Muse! <br> Use your code <br> <b> COUPON_CODE </b><br> Enjoy 10% off on your purchase<br><br></p>

            </div>
            <div class="flex-v-container no-bounds" id="flex-v-container">

                <input placeholder="Mobile Number" class="input-container moe-element" data-id="INPUT2" id="TEXT_INPUT_2" data-user="u_mb" required="" style="z-index: 999999; margin-top: -42px; margin-left: 6px; margin-right: 0px; display: inline-block;">
                <label class="moe-error-text invisible">This field is required</label>
            </div>
            <div class="no-bounds" style="display: flex;" id="lead-gen-submit-container">
                <span class="button-container moe-element" id="lead-gen-submit" data-id="SUBMIT" style="z-index: 999999; display: inline-block;" contenteditable="false">Subscribe Now</span>
            </div>
            <div class="no-bound" id="lead-gen-save-container" style="display: none;">
                <span class="button-container moe-element" id="lead-gen-save" data-id="SUBMIT">Close</span>
            </div>

            <button class="close-icon moe-element moe-inapp-close" id="moe-close-element" data-id="CLOSE" style="z-index: 999999; display: inline-block; outline: transparent solid 1px;" contenteditable="false">x</button>
        </div>
    </div>

    <script>
        const buttonElem = document.getElementById('lead-gen-submit');
        const inputElement1 = document.getElementById('TEXT_INPUT_2');
        const leadGenSave = document.getElementById('lead-gen-save');
        const attributeObj = {};
        buttonElem.disabled = true;

        function removeError(targetElement) {
            const nextSiblings = targetElement.nextElementSibling;
            if (targetElement && targetElement.classList.contains("moe-error")) {
                targetElement.classList.remove("moe-error");
            }
            if (nextSiblings) {
                nextSiblings.classList.add('invisible');
            }
        }

        function addError(targetElement, validationMsg) {
            const nextSiblings = targetElement.nextElementSibling;
            targetElement.classList.add("moe-error");
            if (nextSiblings && nextSiblings.classList.contains('invisible')) {
                nextSiblings.classList.remove('invisible');
            }
            if (nextSiblings && validationMsg) {
                nextSiblings.textContent = validationMsg;
            }
        }

        function isEmailAddressValid(email) {
            const emailRegex =
                /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
            return emailRegex.test(String(email.trim()).toLowerCase());
        }

        function isFormDataValid() {
            let isFormValid = true;
            const inputElements = document.querySelectorAll("input");
            for (let i = 0; i < inputElements.length; i++) {
                let validationMsg;
                let isValid = true;
                if (
                    inputElements[i].hasAttribute("required") &&
                    !inputElements[i].value
                ) {
                    isValid = false;
                    validationMsg = 'This field is required';
                }
                // email validation
                if (isValid && inputElements[i].dataset.inputValidationType === "email") {
                    if (!isEmailAddressValid(inputElements[i].value)) {
                        isValid = false;
                        validationMsg = 'Please enter valid email address';
                    }
                }

                if (!isValid) {
                    addError(inputElements[i], validationMsg);
                    isFormValid = false;
                } else {
                    removeError(inputElements[i]);
                }
            }
            return isFormValid;
        }

        function submitLeadgenData(targetElement) {
            const isMoeInAppCloseBtnAvailable = leadGenSave && leadGenSave.classList.contains("moe-inapp-close");
            const isMoeInAppClickBtnAvailable = leadGenSave && leadGenSave.classList.contains('moe-inapp-click');
            if (!isFormDataValid()) {
                // remove moe-inapp-close class to prevent popup close
                if (isMoeInAppCloseBtnAvailable) {
                    leadGenSave.classList.remove("moe-inapp-close");
                }
                // remove moe-inapp-click class to prevent click tracking
                if (isMoeInAppClickBtnAvailable) {
                    leadGenSave.classList.remove("moe-inapp-click");
                }
                return false;
            }
            if (!isMoeInAppCloseBtnAvailable) {
                leadGenSave.classList.add("moe-inapp-close");
            }
            if (!isMoeInAppClickBtnAvailable) {
                leadGenSave.classList.add('moe-inapp-click');
            }
            const ATTR_MAP = {
                uid: "USER_ATTRIBUTE_UNIQUE_ID",
                u_em: "USER_ATTRIBUTE_USER_EMAIL",
                u_mb: "USER_ATTRIBUTE_USER_MOBILE",
                u_fn: "USER_ATTRIBUTE_USER_FIRST_NAME",
                u_ln: "USER_ATTRIBUTE_USER_LAST_NAME",
                u_n: "USER_ATTRIBUTE_USER_NAME",
                u_gd: "USER_ATTRIBUTE_USER_GENDER",
                u_bd: "USER_ATTRIBUTE_USER_BDAY",
            };
            const inputElements = document.querySelectorAll("input");
            for (let i = 0; i < inputElements.length; i++) {
                const inputElement = inputElements[i];
                if (inputElement.style.display !== "none") {
                    const userAttribute = ATTR_MAP[inputElement.dataset.user] || inputElement.dataset.user;
                    attributeObj[userAttribute] = inputElement.value;
                }
            }
            document.getElementById('flex-v-container').style.display = 'none';
            document.getElementById('lead-gen-submit-container').style.display = 'none';
            document.getElementById('title').style.display = 'none';
            document.getElementById('s_thnx').style.display = 'inline-block';
            document.getElementById('lead-gen-save-container').style.display = 'inline-block';
            document.getElementById('moe-close-element').style.display = 'none';
        }

        function trackUserAttribute() {
            Object.keys(attributeObj).forEach((key) => {
                window.parent.Moengage.add_user_attribute(key, attributeObj[key]);
            });
            window.parent.Moengage.track_event("MOE_RESPONSE_SUBMITTED", attributeObj);
        }

        function enableButton() {
            if (inputElement1.style.display !== 'none') {
                if (inputElement1.value.length) {
                    buttonElem.disabled = false;
                }
            }
        }
        inputElement1.addEventListener('input', (event) => {
            enableButton();
        });

        document.getElementById('lead-gen-submit').addEventListener('click', (event) => {
            if (window.parent.Moengage) {
                submitLeadgenData(event.target);
                // $('.title moe-element').hide();
                // $('.s_thnx').show();
            }
        });
        leadGenSave.addEventListener('click', (event) => {
            if (window.parent.Moengage) {
                trackUserAttribute();
            }
        });
    </script>
</body>
info

Note

Edit lines 132-134 of the HTML code to change custom coupon code and heading.

 

Was this article helpful?
0 out of 0 found this helpful