1function sendDataToMautic(mauticData, direction, formId) { 2 var napravlenie = direction === undefined ? '' : direction; 3 var _formId = formId === undefined ? '2' : formId; 4 var path = document.location.pathname; 5 6 var lpPattern = /lang_prog/i; 7 var sePattern = /secondary_education/i; 8 var hePattern = /higher_education/i; 9 10 if(lpPattern.test(path)) 11 napravlenie = 'ÑзÑковÑе пÑогÑаммÑ'; 12 else if(sePattern.test(path) || path.indexOf('secondary_education') > -1) 13 napravlenie = 'ÑÑеднее обÑазование'; 14 else if(hePattern.test(path)) 15 napravlenie = 'вÑÑÑее обÑазование'; 16 17 var office = $('.choice-current-sity-val').first().text(); 18 var customerСity = ''; 19 20 if (office === 'London' || office === 'Ðондон') { 21 customerСity = 'Ðондон'; 22 office = "СанкÑ-ÐеÑеÑбÑÑг"; 23 } 24 25 if (office === 'ÐмÑк' || office === 'ÐÑаÑноÑÑÑк' || office === 'ÐаÑнаÑл') { 26 customerСity = office; 27 office = "ÐовоÑибиÑÑк"; 28 } 29 30 if (office === 'ÐкаÑеÑинбÑÑг' || office === 'ЧелÑбинÑк' || office === 'ТÑменÑ') { 31 customerСity = office; 32 office = "УÑа"; 33 } 34 35 //custom mautic!!! 36 mauticData.push({name: 'mautic_url', value: 'https://www.mautic.iqconsultancy.ru'}); 37 mauticData.push({name: 'mauticform[formId]', value: _formId}); 38 39 mauticData.push({'name': 'mauticform[url]', 'value': document.location.href}); 40 //personal 41 mauticData.push({name: 'mauticform[ofis]', value: office}); 42 //napravlenie 43 mauticData.push({'name': 'mauticform[napravlenie]', 'value': napravlenie}); 44 45 var country = getCountry(); 46 if (country) { 47 mauticData.push({name: 'mauticform[strana]', value: country}); 48 } 49 mauticData.push({name: 'mauticform[tip_lida]', value: 'Regular'}); 50 //source 51 mauticData.push({'name': 'mauticform[source]', 'value': getSource()}); 52 mauticData.push({'name': 'mauticform[sessionid]', 'value': sbjs.get.promo.code}); 53 mauticData.push({'name': 'mauticform[skolko_raz_polzovatel_pos]', 'value': sbjs.get.udata.vst}); 54 mauticData.push({'name': 'mauticform[pervyj_istocnik_posetitel]', 'value': getSource(sbjs.get.first.src, sbjs.get.first.mdm, sbjs.get.current.typ)}); 55 56 if (sbjs.get.current_add.rf !== undefined && sbjs.get.current_add.rf.length > 200) { 57 mauticData.push({'name': 'mauticform[referer]', 'value': sbjs.get.current_add.rf.substr(0, 200)}); 58 } else { 59 mauticData.push({'name': 'mauticform[referer]', 'value': sbjs.get.current_add.rf}); 60 } 61 62 mauticData.push({'name': 'mauticform[reklamnaa_kompania]', 'value': sbjs.get.current.cmp}); 63 64 /*-----новÑй коÑÑÑлÑ----*/ 65 var info_o_pr; 66 var ipaddr=''; 67 68 if(getSource()=='ÐонÑекÑÑ Google' || getSource()=='ÐонÑекÑÑ Ð¯Ð½Ð´ÐµÐºÑ'){ 69 info_o_pr= getValue(mauticData, 'mauticform[soobsenie]') + '. ÐапÑоÑ, по коÑоÑÐ¾Ð¼Ñ Ð¿ÑиÑел: '+sbjs.get.current.trm; 70 }else{ 71 info_o_pr= getValue(mauticData, 'mauticform[soobsenie]'); 72 } 73 74 if(getIP()!=''){
75 ipaddr=getIP(); 76 }else{ 77 ipaddr=getValue(mauticData, 'mauticform[ipadres]'); 78 } 79 /*-----новÑй коÑÑÑлÑ----*/ 80 81 var postdata = {}; 82 postdata = { 83 "publicid" : 'c8004a01f7a23c3bbc68afd277fce0c8', 84 "firstname" : getValue(mauticData, 'mauticform[imya]'), 85 "leadsource" : getSource(), 86 "email" : getValue(mauticData, 'mauticform[email]'), 87 "mobile" : getValue(mauticData, 'mauticform[telefon]'), 88 "label:ÐÑиÑ" : getValue(mauticData, 'mauticform[ofis]'), 89 "label:URL ÑÑÑаниÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð²ÐµÐ±ÑоÑмÑ" : document.location.href, 90 "label:ÐапÑавление" : getValue(mauticData, 'mauticform[napravlenie]'), 91 "label:СÑÑана" : getValue(mauticData, 'mauticform[strana]'), 92 "label:SessionID" : sbjs.get.promo.code, 93 "description": info_o_pr, 94 "label:ÐеÑопÑиÑÑиÑ": getValue(mauticData, 'mauticform[registracia_na_meropriati]'), 95 "label:СодеÑжание": getContent(), 96 "label:РекламнÑй_ÑоÑмаÑ": getFormat(), 97 "label:Origin": getMarketingDirection(), 98 "label:УÑÑÑойÑÑво": getTypeDevice(), 99 "label:СÑÑаниÑа_Ð²Ñ Ð¾Ð´Ð°": sbjs.get.current_add.ep, 100 "label:РеÑеÑеÑ": sbjs.get.current_add.rf, 101 "label:ÐлоÑадка": getPlatform(), 102 "label:ÐеÑвÑй_иÑÑоÑник": sbjs.get.first.src + ' ' + sbjs.get.first.mdm, 103 "label:Client ID": IQ_CLIENT_ID, 104 "label:for_GA_(ÑÑÑана)": getRegion().country, 105 "label:for_GA_(оÑиÑ_(edit))": getRegion().city, 106 "label:ÐоÑод_заказÑика": customerСity, 107 "label:IP-адÑеÑ": getValue(mauticData, 'mauticform[ipadres]'), 108 //"label:IP-адÑеÑ": '91.203.172.248', 109 }; 110 111 console.log('postdata', postdata); 112 113 114 /*---ÑÑаÑÑй коннекÑÐ¾Ñ Ð´Ð»Ñ Vtiger---*/ 115 /*$.ajax({ 116 type : 'POST', 117 dataType : 'jsonp', 118 url : 'https://vtiger.iqconsultancy.ru/modules/Webforms/capture.php', 119 data : postdata, 120 success : function() { 121 dataLayer.push({'event': 'forms_sended'}); 122 console.log('DEBAG:', 'ФоÑма ÑÑпеÑно оÑпÑавлена'); 123 }, 124 error : function (xhr, ajaxOptions, thrownError) { 125 console.log(xhr.statusText); 126 console.log(xhr.responseText); 127 console.log(xhr.status); 128 console.log(thrownError); 129 } 130 });*/ 131 132 /*---ÑÑаÑÑй коннекÑÐ¾Ñ Ð´Ð»Ñ Vtiger---*/ 133 134 135 136 /*оÑпÑавка даннÑÑ Ð² INTEGROMAT*/ 137 138 var postdata2 = {}; 139 140 141 postdata2 = { 142 "publicid" : 'c8004a01f7a23c3bbc68afd277fce0c8', 143 "firstname" : getValue(mauticData, 'mauticform[imya]'), 144 "leadsource" : getSource(), 145 "email" : getValue(mauticData, 'mauticform[email]'), 146 "mobile" : getValue(mauticData, 'mauticform[telefon]'), 147 "label:ÐÑиÑ" : getValue(mauticData, 'mauticform[ofis]'), 148 "label:URL ÑÑÑаниÑÑ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð²ÐµÐ±ÑоÑмÑ" : document.location.href, 149 "label:ÐапÑавление" : getValue(mauticData, 'mauticform[napravlenie]'), 150 "label:СÑÑана" : getValue(mauticData, 'mauticform[strana]'), 151 "label:SessionID" : parseInt(sbjs.get.promo.code), 152 //"label:SessionID" : sess_id, 153 "description": info_o_pr, 154 "label:ÐеÑопÑиÑÑиÑ": getValue(mauticData, 'mauticform[registracia_na_meropriati]'), 155 //"label:ÐеÑопÑиÑÑиÑ": "Istituto Marangoni 03.2015", 156 "label:СодеÑжание": getContent(), 157 "label:РекламнÑй_ÑоÑмаÑ": getFormat(), 158 "label:Origin": getMarketingDirection(), 159 "label:УÑÑÑойÑÑво": getTypeDevice(), 160 "label:СÑÑаниÑа_Ð²Ñ Ð¾Ð´Ð°": sbjs.get.current_add.ep, 161 "label:РеÑеÑеÑ": sbjs.get.current_add.rf, 162 "label:ÐлоÑадка": getPlatform(), 163 "label:ÐеÑвÑй_иÑÑоÑник": sbjs.get.first.src + ' ' + sbjs.get.first.mdm, 164 "label:Client ID": IQ_CLIENT_ID, 165 "label:for_GA_(ÑÑÑана)": getRegion().country,
166 "label:for_GA_(оÑиÑ_(edit))": getRegion().city, 167 "label:ÐоÑод_заказÑика": customerСity, 168 //"label:IP-адÑеÑ": getValue(mauticData, 'mauticform[ipadres]'), 169 "label:IP-адÑеÑ": ipaddr, 170 "new_form_service": getValue(mauticData, 'mauticform[service]'), 171 "new_form_countries_select": getValue(mauticData, 'mauticform[countries_select]'), 172 "new_form_select_year": getValue(mauticData, 'mauticform[select_year]'), 173 "new_form_select_birth_date": getValue(mauticData, 'mauticform[select_birth_date]'), 174 "new_form_select_budget": getValue(mauticData, 'mauticform[select_budget]'), 175 "new_form_select_budget_type": getValue(mauticData, 'mauticform[select_budget_type]'), 176 "new_form_select_who": getValue(mauticData, 'mauticform[select_who]'), 177 "new_form_select_specialization": getValue(mauticData, 'mauticform[select_specialization]'), 178 "new_form_select_trip_date": getValue(mauticData, 'mauticform[select_trip_date]'), 179 "new_form_your_location": getValue(mauticData, 'mauticform[your_location]'), 180 "new_form_select_origin": getValue(mauticData, 'mauticform[select_origin]'), 181 "new_form_school_name": getValue(mauticData, 'mauticform[school_name]'), 182 "_fbp": getCookie("_fbp"), 183 "_fbc": getCookie("_fbc"), 184 "_fb_ua": navigator.userAgent 185 }; 186 187 188 189 var request = $.ajax({ 190 //type : 'POST', 191 dataType : 'text', 192 //url: 'https://hook.integromat.com/cdalt5ana8tebyq8r3geqtewxb2ri2hu', 193 url: 'https://hook.eu1.make.com/n13dqpsghzebwp3i1pq5eld8k17ymd4a', 194 data : postdata2, 195 beforeSend:function() { 196 //$('.consultation-form-submit').before('<p class="loader_temp" style="text-align: center;"><img src="https://iqconsultancy.ru/loader.gif">'); 197 //$('.consultation-form-submit').hide(); 198 }, 199 success : function() { 200 //$('.loader_temp').remove(); 201 //$('.consultation-form-submit').show(); 202 dataLayer.push({'event': 'forms_sended'}); 203 dataLayer.push({'event': 'new_form_sended'}); 204 console.log('DEBAG:', 'ФоÑма ÑÑпеÑно оÑпÑавлена'); 205 console.log('temppp'); 206 }, 207 208 error : function (xhr, ajaxOptions, thrownError) { 209 //$('.loader_temp').remove(); 210 //$('.consultation-form-submit').show(); 211 console.log(xhr.statusText); 212 console.log(xhr.responseText); 213 console.log(xhr.status); 214 console.log(thrownError); 215 } 216 }); 217 218 /*var request_test = $.ajax({ 219 //type : 'POST', 220 dataType : 'text', 221 url : 'https://hook.integromat.com/cdalt5ana8tebyq8r3geqtewxb2ri2hu', 222 data : postdata2, 223 beforeSend:function() { 224 }, 225 success : function() { 226 console.log('Ð½Ð¾Ð²Ð°Ñ Ð¡Ð Ð'); 227 }, 228 229 error : function (xhr, ajaxOptions, thrownError) { 230 console.log(xhr.statusText); 231 console.log(xhr.responseText); 232 console.log(xhr.status); 233 console.log(thrownError); 234 } 235 });*/ 236 237 238 temp = function(){ 239 console.log('eeeee'); 240 } 241 242 request.always(function( msg ) { 243 console.log('111'+msg); 244}); 245 246request.fail(function( jqXHR, textStatus ) { 247 console.log('222'+textStatus+jqXHR); 248}); 249 250 /*оÑпÑавка даннÑÑ Ð² INTEGROMAT*/ 251 252 /* 253 $.ajax({ 254 type : 'POST', 255 dataType : 'text', 256 url : 'https://www.mautic.iqconsultancy.ru/form/submit?formId=' + formId, 257 data : mauticData, 258 success : function() { 259 }, 260 error : function (xhr, ajaxOptions, thrownError) { 261 console.log(xhr.statusText); 262 console.log(xhr.responseText); 263 console.log(xhr.status); 264 console.log(thrownError); 265 } 266 }); 267 */ 268 sendTargets(getValue(mauticData, 'form-name')); 269} 270 271$(document).ready(function(){ 272 273console.log(sess_id); 274 275 // Ðодмениваем ÑелеÑон 276 (function () { 277 var city = getCurentCity(); 278 var source = getSource(); 279 var phone = '8 (800) 500-41-99'; 280 281 $.getJSON(PATH_TO_PHONES_JSON, function (json) { 282 // ÐенÑем Ð½Ð¾Ð¼ÐµÑ Ñ ÑекÑÑего гоÑода 283 phone = getPhoneNumberFromJson(json, city, getSource()); 284 el = $('.choice-current-sity .choice-sity__phone'); 285 console.log('DEBAG:', 'Ðодмена номеÑа. Ð½Ð¾Ð¼ÐµÑ : ' + phone + ' иÑÑоÑник: ' + source); 286 replaceNumber(phone, el); 287 288 // ÐенÑем номеÑа в вÑпадаÑÑем ÑпиÑке 289 $('.choice-sity-list-item').each(function(i, item) { 290 city = $(item).attr('data-city'); 291 phone = getPhoneNumberFromJson(json, city, getSource()); 292 el = $(item).find('.choice-sity__phone'); 293 replaceNumber(phone, el); 294 }); 295 296 // ÐенÑем номеÑа в Footer 297 $('li.office-list-item').each(function(i, item) { 298 city = $(item).find('.office-list-item__title a.office-list-item__title-link').text(); 299 phone = getPhoneNumberFromJson(json, city, getSource()); 300 el = $(item).find('.office-list-item__phone a'); 301 replaceNumber(phone, el, el) 302 }); 303 }); 304 }()); 305 306 var office = $('.choice-current-sity-val').first().text(); 307 //sendEventToGA(office); 308}); 309 310 311function getCurentCity() { 312 return $('.choice-current-sity-val').first().text(); 313}
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.