Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
29 kB
1
Indexable
Never
Evergage.init({
    cookieDomain: "macro.com.ar",
}).then(() => {

    const config = {
        global: {},
        pageTypes: [
            {
                name:"Home - Page Salesforce", 
                isMatch: () => /\/home-page/.test(window.location.href),
                action:"Home - Page Salesforce",
                contentZones: [
                    { name: "Home_Page_banner_slider_1_Carrousel", selector: ".Personalizacion_Salesforce_HomeCarrouselSlider1" },
                    { name: "Home_Page_BannerAutoTeEspera", selector: ".Personalizacion_Salesforce_HomeBannersFormatowide1" },
                    { name: "Home_Page_BannerAcompanaATuNegocio", selector: ".personalizacionSFBannerAcompanaATuNegocio" },
                    { name: "Home_Page_CardP_AdquiriTarjetas", selector: ".Personalizacion_Salesforce_HomeMCardsCard1" }
                    ],
                listeners: [
                    Evergage.listener("click", ".Action_SalesforceHomeCarrouselSlider1", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Home_Page_banner slider boton 1 - Carrousel",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForceHOMEAutoTeEspera", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Banner Un auto te está esperando en GCDC",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForcePS_ActivaToken", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Activá tu token",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForcePS_EnvioTarjeta", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Seguí el envío de tu tarjeta",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForcePS_Seguros", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Conocé nuestros seguros",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForcePS_DesbloqueaTD", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Desbloquea tu tarjeta de débito",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                    Evergage.listener("click", ".salesForcePS_ReponeTD", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Reponé tu tarjeta de débito",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                }),
                Evergage.listener("click", ".salesForcePS_DescargaApp", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Descargá App Macro",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                Evergage.listener("click", ".salesForcePS_AdheriResumen", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Adherí tu e-resumen",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                Evergage.listener("click", ".salesForcePS_ActualizaDatos", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Actualizá tus datos",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                Evergage.listener("click", ".salesForcePS_AbriCuenta", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Abri una cuenta",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                Evergage.listener("click", ".salesForcePS_PotenciaTuSueldo", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Potencia tu Sueldo",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                 Evergage.listener("click", ".salesForcePS_ActualizaDatos", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    Evergage.sendEvent({
                            action: "Botón Actualizá tus datos",
                            user: {
                                attributes: {
                                  id: customerId
                                }
                            }
                        });
                }),
                    Evergage.listener("click", ".salesForceHOMEAcompanaATuNegocio", () => {
                        const customerId = sessionStorage.getItem('_cltk');
                        Evergage.sendEvent({
                                action: "Botón Banner Queremos acompañar a tu negocio",
                                user: {
                                    attributes: {
                                      id: customerId
                                    }
                                }
                            });
                    }),
                        Evergage.listener("click", ".salesForceButtonHeaderAbriCuenta", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Abrir tu cuenta",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                        Evergage.listener("click", ".salesForceButtonHeaderCobraSueldo", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Cobra tu sueldo",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                        Evergage.listener("click", ".Action_SalesforceHomeMCardsCard1", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Home_Page_CardP_AdquiriTarjetas_Boton",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                        Evergage.listener("click", ".salesForceCP_TraeSueldo", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Traé tu sueldo",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                        Evergage.listener("click", ".salesForceCP_UsaModo", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Usa MODO",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                        Evergage.listener("click", ".salesForceCP_BeneficiosMacroSelecta", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Beneficios con Macro Selecta",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                ]
            },
            {
                name:"Cobrá tu jubilación en Banco Macro", 
                isMatch: () => /\/jubilados\/servicios\/cambio-de-banco/.test(window.location.href),
                action:"Cobrá tu jubilación en Banco Macro",
                listeners: [
                        Evergage.listener("click", ".salesForceJB_ButtonContacten", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Quiero que me contacten",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                ]
            },
            {
                name:"derivacion_OB", 
                isMatch: () => /\/derivacion_OB/.test(window.location.href),
                action:"derivacion_OB",
                listeners: [
                        Evergage.listener("click", ".salesForceDOB_TraeTuSuedo", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón ¿QUERÉS TRAER TU SUELDO A MACRO?",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                ]
            },
            {
                name:"Cobra tus haberes con Macro", 
                isMatch: () => /\/jubilados$/.test(window.location.href),
                action:"Cobra tus haberes con Macro",
                listeners: [
                        Evergage.listener("click", ".salesForceJB_ButtonSaberMas", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Quiero Saber Más",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                ]
            },
            {
                name:"Abrí tu cuenta", 
                isMatch: () => /\/operacionessimples\/soluciones\/hacete-cliente/.test(window.location.href),
                action:"Abrí tu cuenta",
                listeners: [
                        Evergage.listener("click", ".salesForceButtonOperSimpleAbriCuenta", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            Evergage.sendEvent({
                                    action: "Botón Abrir una cuenta por la Web",
                                    user: {
                                        attributes: {
                                          id: customerId
                                        }
                                    }
                                });
                        }),
                ]
            },
            {
                name:"Personas Sueldos", 
                isMatch: () => /\/personas\/sueldos/.test(window.location.href),
                action:"Personas Sueldos",
                listeners: [
                        Evergage.listener("blur", ".salesForceFPS_Email", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            var userEmail = Evergage.cashDom(".salesForceFPS_Email").val();
                            if(validacionCorreo(userEmail) == 0){
                                 Evergage.sendEvent({
                                    action: "Email Personas Sueldos Formulario",
                                    user: {
                                        attributes: {
                                          id: customerId,
                                          Email_Per_Sueldos_: userEmail
                                        }
                                    }
                                })
                            }else if(validacionCorreo(userEmail) == 1){
                                    Evergage.sendEvent({
                                    action: "Email Personas Sueldos Formulario",
                                    user: {
                                        attributes: {
                                          id: customerId,
                                          Email_Per_Sueldos_: userEmail
                                        }
                                    }
                                })
                            }
                        }),
                          Evergage.listener("change", ".salesForceFPS_CodAreaCel , .salesForceFPS_NroCel", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            const userArea = Evergage.cashDom(".salesForceFPS_CodAreaCel").val();
                            const userTel = Evergage.cashDom(".salesForceFPS_NroCel").val();
                            
                            let validateArea = typeof userArea === 'string'
                            && /^\d+$/.test(userArea)
                            && userArea.length >= 2
                            && userArea.length <= 5;

                            let validateTel = typeof userTel === 'string'
                            && /^\d+$/.test(userTel)
                            && userTel.length >= 6
                            && userTel.length <= 10; 

                            if (validateArea && validateTel) {
                                const telefoneCompleto = '549' + userArea + userTel;
                                Evergage.sendEvent({
                                    action: "Telefono Personas Sueldos Formulario",
                                    user: {
                                        attributes: {
                                            id: customerId,
                                            Celular_Per_Sueldos: telefoneCompleto
                                        }
                                    }
                                })
                            }
                        }),
                    Evergage.listener("click", ".salesForceFPS_ButtonEnviar", () => { 
                        const Nombre = Evergage.cashDom(".salesForceFPS_NombreApellido.form-control").val();
                        const Email_Per_Sueldos = Evergage.cashDom(".salesForceFPS_Email").val();
                        let Genero = Evergage.cashDom(".salesForceFPS_Genero").val();
                        Genero = genero (Genero);
                        const Sucursal_mas_cerca_Per_Sueldos = Evergage.cashDom(".salesForceFPS_SucCercana").val();
                        const Tipo = Evergage.cashDom(".salesForceFPS_TpoDoc").val();
                        const NUMERO_ID = Evergage.cashDom(".salesForceFPS_NroDoc").val();
                        const userArea = Evergage.cashDom(".salesForceFPS_CodAreaCel").val();
                        const userTel = Evergage.cashDom(".salesForceFPS_NroCel").val();
                        let  Celular_Per_Sueldos = '549' + userArea + userTel; 

                        if(!checkIfEmpty(Nombre) || !checkIfEmpty(Tipo) ||
                            !checkIfEmpty(NUMERO_ID) || !checkIfEmpty(Genero) || !checkIfEmpty(Email_Per_Sueldos) ||
                            !checkIfEmpty(userArea) || !checkIfEmpty(userTel) || !checkIfEmpty(Sucursal_mas_cerca_Per_Sueldos)){                       
                            if( Tipo === "DNI")  {
                                Evergage.sendEvent({
                                action: "Clique Enviar Formulario Web", 
                                user: {
                                attributes: {
                                    Nombre: Nombre,
                                    DNI: NUMERO_ID,
                                    Tipo: Tipo,
                                    Genero: Genero,
                                    Email_Per_Sueldos_: Email_Per_Sueldos,
                                    Celular_Per_Sueldos: Celular_Per_Sueldos,
                                    Sucursal_mas_cerca_Per_Sueldos: Sucursal_mas_cerca_Per_Sueldos
                                }
                                }
                            })
                            }else if(Tipo === "CUIL") {
                                    Evergage.sendEvent({
                                        action: "Clique Enviar Formulario Web", 
                                        user: {
                                        attributes: {
                                            Nombre: Nombre,
                                            NUMERO_ID: NUMERO_ID,
                                            Tipo: Tipo,
                                            Genero: Genero,
                                            Email_Per_Sueldos_: Email_Per_Sueldos,
                                            Celular_Per_Sueldos: Celular_Per_Sueldos,
                                            Sucursal_mas_cerca_Per_Sueldos: Sucursal_mas_cerca_Per_Sueldos
                                        }
                                        }
                                 })
                             } else{
                                Evergage.sendEvent({
                                    action: "Clique Enviar Formulario Web", 
                                    user: {
                                    attributes: {
                                        Nombre: Nombre,
                                        customerId: NUMERO_ID,
                                        Tipo: Tipo,
                                        Genero: Genero,
                                        Email_Per_Sueldos_: Email_Per_Sueldos,
                                        Celular_Per_Sueldos: Celular_Per_Sueldos,
                                        Sucursal_mas_cerca_Per_Sueldos: Sucursal_mas_cerca_Per_Sueldos
                                    }
                                    }
                                })
                                }
                        }
    
                    })
                
                ]
            },
            {
                name:"Cobra tus haberes Formulario", 
                isMatch: () => /\/jubilados\/contacto/.test(window.location.href),
                action:"Cobra tus haberes Formulario",
                listeners:[
                Evergage.listener("blur", ".salesForceFJB_Email", () => {
                    const customerId = sessionStorage.getItem('_cltk');
                    var contactEmail = Evergage.cashDom(".salesForceFJB_Email").val();
                    if(validacionCorreo(contactEmail) == 0){
                        Evergage.sendEvent({
                            action:"Email Jubilados Formulario",
                            user: {
                                attributes: {
                                    id: customerId,
                                    Email_Hb: contactEmail,

                                    }
                                }
                            })
                        }else if(validacionCorreo(contactEmail) == 1){
                                Evergage.sendEvent({
                            action:"Email Jubilados Formulario",
                            user: {
                                attributes: {
                                    id: customerId,
                                    Email_Hb: contactEmail,

                                    }
                                }
                            })
                        }
                    }),
                       Evergage.listener("change", ".salesForceFJB_CodAreaCel , .salesForceFJB_NroCel", () => {
                            const customerId = sessionStorage.getItem('_cltk');
                            const Area = Evergage.cashDom(".salesForceFJB_CodAreaCel").val();
                            const Tel = Evergage.cashDom(".salesForceFJB_NroCel").val();
                            
                            let validateArea = typeof Area === 'string'
                            && /^\d+$/.test(Area)
                            && Area.length >= 2
                            && Area.length <= 5;

                            let validateTel = typeof Tel === 'string'
                            && /^\d+$/.test(Tel)
                            && Tel.length >= 6
                            && Tel.length <= 10; 

                            if (validateArea && validateTel) {
                                const telefonoCompleto = '549' + Area + Tel;
                                Evergage.sendEvent({
                                    action: "Telefono Jubilados Formulario",
                                    user: {
                                        attributes: {
                                            id: customerId,
                                            Numero_Hb: telefonoCompleto
                                        }
                                    }
                                });
                            }
                        }),
                    Evergage.listener("click", ".salesForceFJB_ButtonEnviar", () => {  
                        const Nombre = Evergage.cashDom(".salesForceFJB_NombreApellido").val();
                        const Tipo = Evergage.cashDom(".salesForceFJB_TpoDoc").val();
                        const NUMERO_ID = Evergage.cashDom(".salesForceFJB_NroDoc").val();
                        let Genero = Evergage.cashDom(".salesForceFJB_Genero").val();
                        Genero = genero (Genero);
                        const Email_Hb = Evergage.cashDom(".salesForceFJB_Email").val();
                        const Area = Evergage.cashDom(".salesForceFJB_CodAreaCel").val();
                        const Tel = Evergage.cashDom(".salesForceFJB_NroCel").val();
                        const Sucursal_Hb = Evergage.cashDom(".salesForceFJB_SucCercana").val();
                        let   Numero_Hb = '549' + Area + Tel;
                        if(!checkIfEmpty(Nombre) || !checkIfEmpty(Tipo) ||
                            !checkIfEmpty(NUMERO_ID) || !checkIfEmpty(Genero) || !checkIfEmpty(Email_Hb) ||
                            !checkIfEmpty(Area) || !checkIfEmpty(Tel) || !checkIfEmpty(Sucursal_Hb)){
                            if( Tipo === "DNI")  {Evergage.sendEvent({
                                action: "Boton enviar Formulario",
                                user: {
                                attributes: {
                                    Nombre: Nombre,
                                    Tipo: Tipo,
                                    DNI: NUMERO_ID,
                                    Genero: Genero,
                                    Email_Hb: Email_Hb,
                                    Numero_Hb: Numero_Hb,
                                    Sucursal_Hb: Sucursal_Hb
                                }
                            }
                        })
                        } else if(Tipo === "LC") {
                            Evergage.sendEvent({
                                action: "Boton enviar Formulario",
                                    user: {
                                    attributes: {
                                        Nombre: Nombre,
                                        Tipo: Tipo,
                                        DNI: NUMERO_ID,
                                        Genero: Genero,
                                        Email_Hb: Email_Hb,
                                        Numero_Hb: Numero_Hb,
                                        Sucursal_Hb: Sucursal_Hb
                                    }
                                }
                            })
                        } else{
                            Evergage.sendEvent({
                                action: "Boton enviar Formulario", 
                                user: {
                                attributes: {
                                    Nombre: Nombre,
                                    Tipo: Tipo,
                                    DNI: NUMERO_ID,
                                    Genero: Genero,
                                    Email_Hb: Email_Hb,
                                    Numero_Hb: Numero_Hb,
                                    Sucursal_Hb: Sucursal_Hb
                                }
                                }
                            })
                        }
                    }
                    })
                ]
            },
        ]
    };
Evergage.initSitemap(config);
});