1 2 3/** 4 * @see https://developers.facebook.com/docs/facebook-pixel/reference/ 5 * @see https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters/#normalize-and-hash 6 */ 7function TrackingMa() 8{ 9 this.test_event_code = ''; 10} 11 12TrackingMa.prototype.viewQuantityPage = function () { 13 $(document).ready(function () { 14 gtag( 15 'event', 16 'view_quantity_page', 17 {} 18 ); 19 }); 20}; 21 22TrackingMa.prototype.viewRdvPage = function () { 23 $(document).ready(function () { 24 gtag( 25 'event', 26 'view_rdv_page', 27 {} 28 ); 29 }); 30}; 31 32TrackingMa.prototype.viewAddressPage = function () { 33 $(document).ready(function () { 34 gtag( 35 'event', 36 'view_address_page', 37 {} 38 ); 39 }); 40}; 41 42TrackingMa.prototype.stepDeclinaison = function (stepLabel) { 43 gtag( 44 'event', 45 'step_declinaison', 46 { 47 declinaison_clicked: stepLabel, 48 } 49 ); 50}; 51 52TrackingMa.prototype.addToCart = function (data) { 53 gtag( 54 'event', 55 'add_to_cart', 56 { 57 'x-fb-event_id': data.event_id, 58 content_name: data.name, 59 content_category: data.category, 60 content_ids: [data.id], 61 content_type: 'product', 62 value: data.price, 63 currency: 'EUR' 64 } 65 ); 66}; 67TrackingMa.prototype.viewItem = function (data) { 68 $(document).ready(function () { 69 gtag( 70 'event', 71 'view_item', 72 { 73 content_ids: data.content_ids, 74 content_category: data.content_category, 75 content_name: data.content_name, 76 content_type: data.content_type, 77 value: data.value, 78 currency: 'EUR' 79 } 80 ); 81 }); 82}; 83 84TrackingMa.prototype.initCheckout = function (data) { 85 $(document).ready(function () { 86 gtag( 87 'event', 88 'begin_checkout', 89 { 90 'x-fb-event_id': 'init-checkout-' + data.cmp_id, 91 currency: 'EUR' 92 } 93 ); 94 }); 95}; 96 97TrackingMa.prototype.trackLoginMethod = function (method) { 98 gtag( 99 'event', 100 'login_method_choose', 101 { 102 login_method: method 103 } 104 ); 105}; 106 107TrackingMa.prototype.trackForgotPassword = function () { 108 gtag( 109 'event', 110 'forgot_password_clicked', 111 {} 112 ); 113}; 114 115TrackingMa.prototype.trackOrderScreen = function (screen) { 116 gtag( 117 'event', 118 'order_screen_view', 119 { 120 screen_name: screen 121 } 122 ); 123}; 124 125TrackingMa.prototype.trackHomeChoice = function (choice) { 126 gtag( 127 'event', 128 'home_page_choice', 129 { 130 choice: choice 131 } 132 ); 133}; 134 135TrackingMa.prototype.purchase = function (data) { 136 let items = []; 137 let products = []; 138 for (let i = 0; i < data.products.length; i++) { 139 items.push({ 140 item_id: data.products[i].id, 141 item_name: data.products[i].name, 142 quantity: data.products[i].quantity, 143 price: data.products[i].price 144 }); 145 products.push({ 146 'id': data.products[i].id, 147 'name': data.products[i].name, 148 'price': data.products[i].price, 149 'quantity': data.products[i].quantity, 150 }) 151 } 152 153 $(document).ready(function () { 154 gtag( 155 'event', 156 'purchase', 157 { 158 'x-fb-event_id': 'purchase-' + data.mtr_id, 159 'transaction_id': data.mtr_id, 160 'currency': 'EUR', 161 'value': data.mtr_amount, 162 user_data: { 163 email_address: data.int_email, 164 phone_number: data.int_tel, 165 address: { 166 first_name: data.int_prenom, 167 last_name: data.int_nom, 168 city: data.int_ville, 169 postal_code: data.int_cp, 170 country: 'fr' 171 }, 172 }, 173 content_type: 'product', 174 items: items, 175 } 176 ); 177 window.dataLayer = window.dataLayer || []; 178 window.dataLayer.push({ 179 'event': 'purchase', 180 'transactionId': data.mtr_id + '_dl', 181 'orderTotal': data.mtr_amount, 182 'currency': 'EUR', 183 'products': products 184 }); 185 });
186}; 187 188TrackingMa.prototype.nouveauDevis = function (dev_id, met_id) { 189 let shareProgramKey = null; 190 if (met_id == 20) { 191 shareProgramKey = '627d08c886bcc60722e76262-6274db4d874299353bcd3f66'; 192 } else if (met_id == 18) { 193 shareProgramKey = '627d08c986bcc60722e76263-6274db4d874299353bcd3f66'; 194 } else if (met_id == 27) { 195 shareProgramKey = '6274e2d586bcc60722e64716-6274db4d874299353bcd3f66'; 196 } else if (met_id == 26) { 197 shareProgramKey = '627d08ca86bcc60722e76264-6274db4d874299353bcd3f66'; 198 } 199 200 let lastClickProgramKey = null; 201 if (met_id == 20) { 202 lastClickProgramKey = '627d154386bcc60722e76635-627d154386bcc60722e76631'; 203 } else if (met_id == 18) { 204 lastClickProgramKey = '627d154386bcc60722e76636-627d154386bcc60722e76631'; 205 } else if (met_id == 27) { 206 lastClickProgramKey = '627d154386bcc60722e76634-627d154386bcc60722e76631'; 207 } else if (met_id == 26) { 208 lastClickProgramKey = '627d154386bcc60722e76637-627d154386bcc60722e76631'; 209 } 210 $(document).ready(function () { 211 gtag( 212 'event', 213 'new_quote', 214 { 215 dev_id: dev_id, 216 shareProgramKey: shareProgramKey, 217 lastClickProgramKey: lastClickProgramKey 218 } 219 ); 220 }); 221}; 222 223TrackingMa.prototype.iaReformulationClick = function () { 224 gtag('event', 'ia_reformulation_click', {}); 225}; 226 227TrackingMa.prototype.iaReformulationNext = function () { 228 gtag('event', 'ia_reformulation_next', {}); 229}; 230 231TrackingMa.prototype.iaArtisanFirstResponse = function () { 232 gtag('event', 'ia_artisan_first_response', {}); 233}; 234 235TrackingMa.prototype.iaArtisanFinishedNext = function () { 236 gtag('event', 'ia_artisan_finished_next', {}); 237};
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.