1window.addEventListener("load", loadGAAccountEvents); 2function loadGAAccountEvents() { 3 $('#frmAccount .userinput').on('focusout', function (ele) { 4 let data = ''; 5 if (ele.target.value.length > 0) { 6 if (ele.target.id == 'Email') { 7 data = `${gaAccount.Group.Main}Type email address`; 8 } 9 if (ele.target.id == 'Password') { 10 data = `${gaAccount.Group.Main}Type password`; 11 } 12 if (data != '') 13 gaAccount.pushAccountToGTM(data); 14 } 15 }); 16 17 $('#Forgetful .userinput').on('focusout', function (ele) { 18 let data = ''; 19 if (ele.target.value.length > 0) { 20 if (ele.target.id == 'Email') { 21 data = `${gaAccount.Group.Main}Type email address`; 22 gaAccount.pushAccountToGTM(data); 23 } 24 } 25 }); 26 27 $('#Signup .userinput').on('focusout', function (ele) { 28 let data = ''; 29 if (ele.target.value.length > 0) { 30 if (ele.target.id == 'Email') { 31 data = `${gaAccount.Group.Main}Type email address`; 32 gaAccount.pushAccountToGTM(data); 33 } 34 if (ele.target.id == 'Name') { 35 data = `${gaAccount.Group.Main}Type full name`; 36 gaAccount.pushAccountToGTM(data); 37 } 38 if (ele.target.id == 'Password') { 39 data = `${gaAccount.Group.Main}Type password`; 40 gaAccount.pushAccountToGTM(data); 41 } 42 } 43 }); 44 45 $('#Signup #IsOptForCrmPromotion').on('change', function (ele) { 46 let data = ''; 47 if (this.checked) { 48 data = `${gaAccount.Group.Main}Retick GDPR`; 49 gaAccount.pushAccountToGTM(data); 50 } 51 else { 52 data = `${gaAccount.Group.Main}Untick GDPR`; 53 gaAccount.pushAccountToGTM(data); 54 } 55 }); 56 57 $('.breadcrumbs_contrado ul li a').on('click', function (ele) { 58 let data = `${gaAccount.Group.Breadcrumbs}${ele.target.innerHTML}`; 59 gaAccount.pushAccountToGTM(data); 60 }); 61} 62var gaAccount = { 63 Event: { 64 Name: 'custom_event' 65 }, 66 EventCategory : { 67 AccountManagment: 'AccountManagment' 68 }, 69 70 EventList : { 71 Login : 'estore/login' 72 }, 73 Page: { 74 Name:'' 75 }, 76 Group: { 77 Main: 'Main /', 78 Breadcrumbs: 'Breadcrumbs /', 79 View: 'View' 80 }, 81 82 pushAccountToDatalayer : function (data) { 83 console.log(`pushToDatalayer ==> data : " ${JSON.stringify(data)}`); 84 if (data) { 85 if (window.dataLayer != undefined) { 86 dataLayer.push({ 87 "event": data.event, 88 "event_category": data.event_category, 89 "event_action": data.event_action, 90 "event_label": data.event_label 91 }); 92 } 93 } 94 }, 95 96 pushAccountToGTM: function (action) { 97 action = (action == undefined) ? '' : action; 98 const gtaAccount = { 99 event: this.Event.Name, 100 event_category: this.EventCategory.AccountManagment, 101 event_action: `${this.Page.Name} ${action}`.trim(), 102 event_label: window.location.href 103 }; 104 this.pushAccountToDatalayer(gtaAccount); 105 }, 106 107}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.