$(document).ready(function(){_isLoggedInUser==="True"&&$.ajax({url:_urlDataLayer,type:"GET",dataType:"json",headers:"",success:function(n){var r=new Date(n.CustomerDetails.Birthdate.match(/\d+/)[0]*1),o=r.getFullYear().toString(),t=(r.getMonth()+1).toString(),i=r.getDate().toString();i.length==1&&(i="0"+i);t.length==1&&(t="0"+t);var s=o+"-"+t+"-"+i,u=null,f=null,e={clientNumber:n.CustomerDetails.Id,dob:s,clientStatus:n.CustomerStatus,registeredBy:n.RegisteredBy,loansCount:n.LoansCount,"postal-code":n.CustomerDetails.CurrentAddress.ZipCode,city:n.CustomerDetails.CurrentAddress.City,hFN:n.CustomerDetails.FirstName,hLN:n.CustomerDetails.LastName,hTN:n.CustomerDetails.MobilePhoneNumber,hMA:n.CustomerDetails.Email};n.LatestApplication!==null&&(u={id:n.LatestApplication.Id,amount:n.LatestApplication.CreditAmount,term:n.LatestApplication.Days});n.LatestLoan!==null&&n.LatestLoan!==undefined&&(f={bank:{id:n.LatestLoan.Id,amount:n.LatestLoan.CreditAmount,interestAmount:n.LatestLoan.Interest,status:n.LatestLoan.Status,dueDays:n.LatestLoan.DueDays,transactionType:n.TransactionTypeBank,repaymentDate:n.LatestLoan.RepaymentDate},vexcash:{id:n.LatestLoan.Id,amount:n.LatestLoan.ExtrasAmount,status:n.LatestLoan.Status,dueDays:n.LatestLoan.DueDays,transactionType:n.LatestLoan.TransactionTypeVexcash,repaymentDate:n.LatestLoan.RepaymentDate}});n.LatestApplication!==null&&n.LatestApplication!==undefined&&n.LatestLoan!==null&&n.LatestLoan!==undefined?dataLayer.push({event:"clientDataLoaded",client:e,application:u,latest_loan:f}):dataLayer.push({event:"clientDataLoaded",client:e,application:u})},error:function(){console.log("error datalayer")}})})