1/**** BE PIXELS FOR WORDPRESS SITES THAT USE HBOOK ****/ 2 3function hbook_show_accom_list() { 4 if(scriptParams.hbook_pixels) { 5 console.log('search pixel'); 6 var adults = parseInt(document.getElementsByClassName("hb-adults-hidden")[0].value); 7 var children = parseInt(document.getElementsByClassName("hb-children-hidden")[0].value); 8 var params = { 9 hd1: document.getElementsByClassName("hb-check-in-hidden")[0].value, /* Check In Date. Format yyyy-mm-dd. Ex: 2015-02-14 */ 10 hd2: document.getElementsByClassName("hb-check-out-hidden")[0].value, /* Check Out Date. Format yyyy-mm-dd. Ex: 2015-02-14 */ 11 hc1: scriptParams.sjrn_city, /* Destination City */ 12 hs1: scriptParams.sjrn_state, /* Destination State or Region */ 13 hn1: scriptParams.sjrn_country, 14 hpr: scriptParams.sjrn_hpr, /* Hotel Property */ 15 t: (adults + children).toString() /* Number of Travelers */ 16 } 17 sojern_be_pixel_call("SEARCH",params); 18 } 19} 20 21function hbook_reservation_done() { 22 if(scriptParams.hbook_pixels) { 23 console.log('conversion pixel'); 24 var adults = parseInt(document.getElementsByClassName("hb-adults-hidden")[0].value); 25 var children = parseInt(document.getElementsByClassName("hb-children-hidden")[0].value); 26 var params = { 27 hd1: document.getElementsByClassName("hb-check-in-hidden")[0].value, /* Check In Date. Format yyyy-mm-dd. Ex: 2015-02-14 */ 28 hd2: document.getElementsByClassName("hb-check-out-hidden")[0].value, /* Check Out Date. Format yyyy-mm-dd. Ex: 2015-02-14 */ 29 hc1: scriptParams.sjrn_city, /* Destination City */ 30 hs1: scriptParams.sjrn_state, /* Destination State or Region */ 31 hn1: scriptParams.sjrn_country, 32 hpr: scriptParams.sjrn_hpr, /* Hotel Property */ 33 t: (adults + children).toString(), /* Number of Travelers */ 34 hp: document.getElementsByClassName("hb-accom-price-raw")[0].value, /* Purchase Price */
35 hcu: scriptParams.sjrn_curr, /* Purchase Currency */ 36 hconfno: (parseInt(scriptParams.confno.id) + 1).toString() /* Confirmation Number */ 37 } 38 params.hconfno = (get_confno(parseInt(params.hconfno))).toString(); 39 sojern_be_pixel_call("CONVERSION",params); 40 } 41} 42 43// !!!! FIGURE OUT HOW TO DO THIS IF WE ARE GETTING LOTS OF DUPLICATE CONVERSIONS 44function get_confno(hconfno){ 45 saved_last_hconfno = 0 // !!!! GET 46 if (hconfno > saved_last_hconfno){ 47 // !!!! update saved_last_hconfno to hconfno 48 return hconfno; 49 } else { 50 return get_confno(hconfno+1) 51 } 52} 53 54function sojern_be_pixel_call(pixel, params) { 55 56 var auto_pl = document.createElement('script'); 57 auto_pl.type = 'text/javascript'; 58 auto_pl.async = true; 59 auto_pl.src = 'https://static.sojern.com/utils/sjrn_autocx.js'; 60 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(auto_pl); 61 62 var p_type = scriptParams.p_type; 63 if(p_type == 'container'){ 64 pixel_id = scriptParams.con_id; 65 params.pt = pixel; 66 params.hpid = scriptParams.hpid; 67 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 68 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 69 var paramsArr = []; 70 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 71 var pl = document.createElement('iframe'); 72 pl.type = 'text/html'; 73 pl.setAttribute('style','height:0; width: 0; display:none;'); 74 pl.async = true; 75 pl.src = "https://static.sojern.com/cip/c/"+pixel_id+".html?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 76 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 77 } else { 78 var pixel_id = ""; 79 if(pixel == "SEARCH") { 80 pixel_id = scriptParams.search_id; 81 } else { 82 pixel_id = scriptParams.conversion_id; 83 } 84 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 85 var cid = []; 86 var paramsArr = []; 87 var cidParams = []; 88 var pl = document.createElement('script'); 89 var defaultParams = {"vid":"hot"}; 90 var key; 91 for(key in defaultParams) { params[key] = defaultParams[key]; }; 92 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 93 params.cid = cid.join('|'); 94 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 95 var pl = document.createElement('iframe'); 96 pl.type = 'text/html'; 97 pl.setAttribute('style','height:0; width: 0; display:none;'); 98 pl.async = true; 99 pl.src = 'https://static.sojern.com/cip/w/s?id='+pixel_id+'&f_v=v6_js&p_v=1&' + paramsArr.join('&'); 100 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 101 } 102} 103 104/**** END BE PIXELS ****/ 105 106/******************************************************************/ 107 108/**** WEBSITE PIXELS FOR ALL WORDPRESS SITES ****/ 109 110 111 112(function( $ ) { 113 'use strict'; 114 115 var auto_pl = document.createElement('script'); 116 auto_pl.type = 'text/javascript'; 117 auto_pl.async = true; 118 auto_pl.src = 'https://static.sojern.com/utils/sjrn_autocx.js'; 119 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(auto_pl); 120 121 setTimeout(sjrn_website, 1500); 122 function sjrn_website() { 123 124 var path_arr = window.location.pathname.split("/"); 125 var path = ""; 126 127 if(path_arr[path_arr.length-1] == ""){ path = path_arr[path_arr.length-2] } 128 else ( path = path_arr[path_arr.length-1] ) 129 var p_type = scriptParams.p_type; 130 131 if(scriptParams.paths == "choose"){ 132 var hp_names = scriptParams.hp_list; 133 var pr_names = scriptParams.pr_list;// note siempre hay una coma al principio 134 var hp_paths = []; 135 var pr_paths = []; 136 var pages = scriptParams.pages; 137 138 for(var i = 0; i < pages.length; i++){ 139 if(hp_names.indexOf(pages[i].post_title) >= 0){ 140 hp_paths.push(pages[i].post_name); 141 console.log(hp_paths); 142 } else if(pr_names.indexOf(pages[i].post_title) >= 0){ 143 pr_paths.push(pages[i].post_name); 144 console.log(pr_paths); 145 } 146 } 147 } else {
148 var hp_paths = scriptParams.hp_path.replace(/\s/g, '').split(",");//delete accidental spaces and split comma separated list 149 var pr_paths = scriptParams.pr_path.replace(/\s/g, '').split(","); 150 path = window.location.pathname; 151 } 152 153 if (hp_paths.indexOf(path) >= 0 || window.location.pathname == "/"){ 154 (function () { 155 156 var params = {}; 157 var pixel_id = scriptParams.hp_id; 158 159 if(p_type == 'container'){ 160 pixel_id = scriptParams.con_id; 161 if (scriptParams.vertical == 'hotel') { 162 params = { 163 hpid: scriptParams.hpid, 164 pt: "HOME_PAGE" 165 }; 166 } else { // tourism 167 params = { 168 vpid: scriptParams.hpid, 169 pt: "HOME_PAGE" 170 }; 171 } 172 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 173 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 174 var paramsArr = []; 175 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 176 177 var pl = document.createElement('iframe'); 178 pl.type = 'text/html'; 179 pl.setAttribute('style','height:0; width: 0; display:none;'); 180 pl.async = true; 181 pl.src = "https://static.sojern.com/cip/c/"+pixel_id+".html?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 182 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 183 } else { 184 /* Please do not modify the below code. */ 185 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 186 var cid = []; 187 var paramsArr = []; 188 var cidParams = []; 189 var defaultParams = {"vid":"hot"}; 190 var key; 191 for(key in defaultParams) { params[key] = defaultParams[key]; }; 192 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 193 params.cid = cid.join('|'); 194 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 195 var pl = document.createElement('iframe'); 196 pl.type = 'text/html'; 197 pl.setAttribute('style','height:0; width: 0; display:none;'); 198 pl.async = true; 199 pl.src = 'https://static.sojern.com/cip/w/s?id='+pixel_id+'&f_v=v6_js&p_v=1&' + paramsArr.join('&'); 200 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 201 } 202 })(); 203 } 204 else if (pr_paths.indexOf(path) >= 0){ 205 (function () { 206 207 var params = { 208 pc: window.location.pathname 209 }; 210 var pixel_id = scriptParams.pr_id; 211 212 if(p_type == 'container'){ 213 pixel_id = scriptParams.con_id; 214 if(scriptParams.vertical == 'hotel') { 215 params.hpid = scriptParams.hpid; 216 } else { // tourism 217 params.vpid = scriptParams.hpid; 218 } 219 params.pt= "PRODUCT"; 220 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 221 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 222 var paramsArr = []; 223 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 224 225 var pl = document.createElement('iframe'); 226 pl.type = 'text/html'; 227 pl.setAttribute('style','height:0; width: 0; display:none;'); 228 pl.async = true; 229 pl.src = "https://static.sojern.com/cip/c/"+pixel_id+".html?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 230 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 231 } else { 232 233 /* Please do not modify the below code. */ 234 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 235 var cid = []; 236 var paramsArr = []; 237 var cidParams = []; 238 var defaultParams = {"vid":"hot"}; 239 var key; 240 for(key in defaultParams) { params[key] = defaultParams[key]; }; 241 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 242 params.cid = cid.join('|');
243 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 244 var pl = document.createElement('iframe'); 245 pl.type = 'text/html'; 246 pl.setAttribute('style','height:0; width: 0; display:none;'); 247 pl.async = true; 248 pl.src = 'https://static.sojern.com/cip/w/s?id='+pixel_id+'&f_v=v6_js&p_v=1&' + paramsArr.join('&'); 249 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 250 } 251 })(); 252 253 } 254 else { 255 (function () { 256 257 var params = { 258 pc: window.location.pathname 259 }; 260 var pixel_id = scriptParams.tr_id; 261 262 if(p_type == 'container'){ 263 pixel_id = scriptParams.con_id; 264 if(scriptParams.vertical == 'hotel') { 265 params.hpid = scriptParams.hpid; 266 } else { // tourism 267 params.vpid = scriptParams.hpid; 268 } 269 params.pt= "TRACKING"; 270 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 271 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 272 var paramsArr = []; 273 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 274 275 var pl = document.createElement('iframe'); 276 pl.type = 'text/html'; 277 pl.setAttribute('style','height:0; width: 0; display:none;'); 278 pl.async = true; 279 pl.src = "https://static.sojern.com/cip/c/"+pixel_id+".html?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 280 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 281 } else { 282 283 /* Please do not modify the below code. */ 284 try{params = Object.assign({}, sjrn_params, params);}catch(e){} 285 var cid = []; 286 var paramsArr = []; 287 var cidParams = []; 288 var defaultParams = {"vid":"hot"}; 289 var key; 290 for(key in defaultParams) { params[key] = defaultParams[key]; }; 291 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 292 params.cid = cid.join('|'); 293 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 294 var pl = document.createElement('iframe'); 295 pl.type = 'text/html'; 296 pl.setAttribute('style','height:0; width: 0; display:none;'); 297 pl.async = true; 298 pl.src = 'https://static.sojern.com/cip/w/s?id='+pixel_id+'&f_v=v6_js&p_v=1&' + paramsArr.join('&'); 299 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 300 } 301 })(); 302 303 } 304 } 305 306/**** END WEBSITE PIXELS ****/ 307 308/******************************************************************/ 309 310//these are the wordpess boilerplate notes, probably ok to ignore: 311 /** 312 * All of the code for your public-facing JavaScript source 313 * should reside in this file. 314 * 315 * Note: It has been assumed you will write jQuery code here, so the 316 * $ function reference has been prepared for usage within the scope 317 * of this function. 318 * 319 * This enables you to define handlers, for when the DOM is ready: 320 * 321 * $(function() { 322 * 323 * }); 324 * 325 * When the window is loaded: 326 * 327 * $( window ).load(function() { 328 * 329 * }); 330 * 331 * ...and/or other possibilities. 332 * 333 * Ideally, it is not considered best practise to attach more than a 334 * single DOM-ready or window-load handler for a particular page. 335 * Although scripts in the WordPress core, Plugins and Themes may be 336 * practising this, we should strive to set a better example in our own work. 337 */ 338 339})( jQuery );
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.