1/* 2 3 This script is supposed to handle shift digital tagging on static forms 4 5 */ 6$(document).ready(function(){ 7 var formType = $(".gform_title").text(); 8/* var formVehicle; 9 var tradeIn;*/ 10 11 //console.log('inside sdforms.js'); 12 13 if (typeof(sd) !== 'undefined' ) { 14 15 function getFormType () { 16 var location = window.location.href; 17 18 if ( location.includes('/trade-value/') ) { 19 formType = 'Trade In'; 20 } else if ( location.includes('/contact/')) { 21 formType = 'General Contact'; 22 } else if ( location.includes('/vehicle-finder-service/')) { 23 formType = 'Vehicle Finder'; 24 } else if ( location.includes('/parts/') ) { 25 formType = 'Parts'; 26 } else if ( location.includes('/service/')) { 27 formType = 'Service'; 28 } else if ( location.includes('/finance/') ) { 29 formType = 'Finance'; 30 } 31 } 32 33 function plainSdShown() { 34 //console.log('sending formShown event (plain)'); 35 sd('dataLayer', { 36 formType: formType, 37 displayType: 'in-page', 38 events: 'formShown' 39 }); 40 sd('send'); 41 } 42 43 function plainSdInitiation() { 44 $("[id^=input]").click(function () { 45 var form = $(this).closest("form")[0]; 46 47 if (form && form.dataset.sdFormInitiationTracked !== 'true' && typeof (sd) !== 'undefined') { 48 //console.log('sending formInitiation event'); 49 form.dataset.sdFormInitiationTracked = 'true'; 50 51 sendShiftDigitalFormEvent({ 52 formType: formType, 53 displayType: 'in-page', 54 eventName: 'formInitiation' 55 }); 56 } 57 }); 58 } 59 60 function plainSdFieldInteraction() { 61 $("[id^=input]").on("input change", function () { 62 var form = $(this).closest("form")[0]; 63 64 if (form && typeof (sd) !== 'undefined' && shouldTrackShiftDigitalFieldInteraction(this)) { 65 sendShiftDigitalFormEvent({ 66 formType: formType, 67 displayType: 'in-page', 68 eventName: 'formFieldInteraction', 69 fieldTarget: this 70 }); 71 } 72 }); 73 } 74 75 getFormType(); 76 77/* if ( forType == 'Trade In' ) { 78 formVehicle = { 79 status: 'New', 80 year: $('#input_9_12').val(), 81 make: $('#input_9_1').val(), 82 model: $('#input_9_2').val(), 83 trim: '', 84 engine: '', 85 transmission: '', 86 interiorColor: '', 87 exteriorColor: '', 88 vin: '', 89 msrp: '', 90 displayedPrice: '', 91 fuelType: '' 92 } 93 }*/ 94 95 plainSdShown(); 96 plainSdInitiation(); 97 plainSdFieldInteraction(); 98 } 99});
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.