1var _learnq = _learnq || []; 2 3function getBirthYear() { 4 var currVal = jQuery("#txtBirthDate").val(); 5 6 var rxDatePattern = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/; 7 var dtArray = currVal.match(rxDatePattern); // is format OK? 8 var yearFirst = false; 9 if (dtArray == null) { 10 rxDatePattern = /^(\d{4})(\/|-)(\d{1,2})(\/|-)(\d{1,2})$/; 11 dtArray = currVal.match(rxDatePattern); // is format OK? 12 yearFirst = true; 13 } 14 if (dtArray == null) 15 return null; 16 17 //Checks for mm/dd/yyyy format. 18 if (yearFirst == true) { 19 return dtArray[1]; 20 } 21 else { 22 return dtArray[5]; 23 } 24} 25 26function getImageUrl() { 27 var imgUrl =""; 28 if (planObject.selectedPlan.Plan_Code_Desc == "Auto Security Plan") { 29 imgUrl = window.location.origin + "/wp-content/plugins/EComm/design/images/ASP.png"; 30 } 31 else { 32 imgUrl = window.location.origin + "/wp-content/plugins/EComm/design/images/" + planObject.selectedPlan.Plan_Type_Code + ".png"; 33 } 34 return imgUrl; 35} 36 37function identifyUser() { 38 _learnq.push(['identify', { 39 '$email': jQuery("#txtEmail").val().trim(), 40 '$first_name': jQuery("#txtFirstName").val().trim(), 41 '$last_name': jQuery("#txtLastName").val().trim(), 42 'Birth Year': getBirthYear() 43 }]); 44} 45 46function trackViewedItem() { 47 var item = { 48 "ProductName": planObject.selectedPlan.Plan_Code_Desc, 49 "ProductID": planObject.selectedPlan.Product_ID, 50 "Categories": [planObject.selectedPlan.Plan_Type_Code], 51 "ImageURL": getImageUrl(), 52 "URL": window.location.href, 53 "Price": planObject.selectedPlan.finalSaleAmount 54 }; 55 56 _learnq.push(["track", "Viewed Product", item]); 57 58 _learnq.push(["trackViewedItem", { 59 Title: item.ProductName, 60 ItemId: item.ProductID, 61 Categories: item.Categories, 62 ImageUrl: item.ImageURL, 63 Url: item.URL, 64 Metadata: { 65 Price: item.Price 66 } 67 }]); 68} 69 70function startedCheckOut() { 71 var eventId = Math.random(); 72 sessionStorage.setItem("eventId", eventId); 73 74 _learnq.push(["track", "Started Checkout", { 75 "$event_id": eventId.toString(), 76 "$value": planObject.selectedPlan.finalSaleAmount, 77 "ItemNames": [planObject.selectedPlan.Plan_Code_Desc], 78 "CheckoutURL": window.location.href, 79 "Items": [{ 80 "ProductID": planObject.selectedPlan.Product_ID, 81 "ProductName": planObject.selectedPlan.Plan_Code_Desc, 82 "Quantity": 1, 83 "ItemPrice": planObject.selectedPlan.finalSaleAmount, 84 "RowTotal": planObject.selectedPlan.finalSaleAmount, 85 "ProductURL": window.location.href, 86 "ImageURL": getImageUrl() 87 } 88 ] 89 }]); 90} 91 92function placedOrder(clientNumber) { 93 _learnq.push(["track", "Placed Order", { 94 "$event_id": sessionStorage.getItem("eventId"), 95 "$value": planObject.selectedPlan.finalSaleAmount, 96 "ItemNames": [planObject.selectedPlan.Plan_Code_Desc], 97 "Items": [{ 98 "ProductID": planObject.selectedPlan.Product_ID, 99 "ProductName": planObject.selectedPlan.Plan_Code_Desc, 100 "Quantity": 1, 101 "ItemPrice": planObject.selectedPlan.finalSaleAmount, 102 "RowTotal": planObject.selectedPlan.finalSaleAmount, 103 "ProductURL": window.location.href, 104 "ImageURL": getImageUrl() 105 } 106 ] 107 }]); 108} 109 110 111
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.