1(function( $ ) { 2 'use strict'; 3 var path_arr = window.location.pathname.split("/"); 4 var path = ""; 5 if(path_arr[path_arr.length-1] == ""){ path = path_arr[path_arr.length-2] } 6 else ( path = path_arr[path_arr.length-1] ) 7 var p_type = scriptParams.p_type; 8 9 if(scriptParams.paths == "choose"){ 10 var hp_names = scriptParams.hp_list; 11 var pr_names = scriptParams.pr_list;// note siempre hay una coma al principio 12 var hp_paths = []; 13 var pr_paths = []; 14 var pages = scriptParams.pages; 15 16 for(var i = 0; i < pages.length; i++){ 17 if(hp_names.indexOf(pages[i].post_title) >= 0){ 18 hp_paths.push(pages[i].post_name); 19 console.log(hp_paths); 20 } else if(pr_names.indexOf(pages[i].post_title) >= 0){ 21 pr_paths.push(pages[i].post_name); 22 console.log(pr_paths); 23 } 24 } 25 } else { 26 var hp_paths = scriptParams.hp_path.replace(/\s/g, '').split(",");//delete accidental spaces and split comma separated list 27 var pr_paths = scriptParams.pr_path.replace(/\s/g, '').split(","); 28 path = window.location.pathname; 29 } 30 31 if (hp_paths.indexOf(path) >= 0 || window.location.pathname == "/"){ 32 (function () { 33 34 var params = {}; 35 var pixel_id = scriptParams.hp_id; 36 37 if(p_type == 'container'){ 38 pixel_id = scriptParams.con_id; 39 if (scriptParams.vertical == 'hotel') { 40 params = { 41 hpid: scriptParams.hpid, 42 pt: "HOME_PAGE" 43 }; 44 } else { // tourism 45 params = { 46 vpid: scriptParams.hpid, 47 pt: "HOME_PAGE" 48 }; 49 } 50 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 51 var paramsArr = []; 52 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 53 54 var pl = document.createElement('script'); 55 pl.type = 'text/javascript'; 56 pl.async = true; 57 pl.src = "https://beacon.sojern.com/pixel/cp/"+pixel_id+"?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 58 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 59 } else { 60 /* Please do not modify the below code. */ 61 var cid = []; 62 var paramsArr = []; 63 var cidParams = []; 64 var pl = document.createElement('script'); 65 var defaultParams = {"vid":"hot"}; 66 var key; 67 for(key in defaultParams) { params[key] = defaultParams[key]; }; 68 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 69 params.cid = cid.join('|'); 70 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 71 pl.type = 'text/javascript'; 72 pl.async = true; 73 pl.src = 'https://beacon.sojern.com/pixel/p/'+pixel_id+'?f_v=v6_js&p_v=1&' + paramsArr.join('&'); 74 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 75 } 76 })(); 77 } 78 else if (pr_paths.indexOf(path) >= 0){ 79 (function () { 80 81 var params = { 82 pc: window.location.pathname 83 }; 84 var pixel_id = scriptParams.pr_id; 85 86 if(p_type == 'container'){ 87 pixel_id = scriptParams.con_id; 88 if(scriptParams.vertical == 'hotel') { 89 params.hpid = scriptParams.hpid; 90 } else { // tourism 91 params.vpid = scriptParams.hpid; 92 } 93 params.pt= "PRODUCT"; 94 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 95 var paramsArr = []; 96 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 97 98 var pl = document.createElement('script'); 99 pl.type = 'text/javascript'; 100 pl.async = true; 101 pl.src = "https://beacon.sojern.com/pixel/cp/"+pixel_id+"?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 102 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 103 } else { 104 105 /* Please do not modify the below code. */ 106 var cid = []; 107 var paramsArr = []; 108 var cidParams = []; 109 var pl = document.createElement('script'); 110 var defaultParams = {"vid":"hot"}; 111 var key; 112 for(key in defaultParams) { params[key] = defaultParams[key]; }; 113 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 114 params.cid = cid.join('|');
115 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 116 pl.type = 'text/javascript'; 117 pl.async = true; 118 pl.src = 'https://beacon.sojern.com/pixel/p/'+pixel_id+'?f_v=v6_js&p_v=1&' + paramsArr.join('&'); 119 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 120 } 121 })(); 122 123 } 124 else { 125 (function () { 126 127 var params = { 128 pc: window.location.pathname 129 }; 130 var pixel_id = scriptParams.tr_id; 131 132 if(p_type == 'container'){ 133 pixel_id = scriptParams.con_id; 134 if(scriptParams.vertical == 'hotel') { 135 params.hpid = scriptParams.hpid; 136 } else { // tourism 137 params.vpid = scriptParams.hpid; 138 } 139 params.pt= "TRACKING"; 140 params.et = {"HOME_PAGE":null,"SEARCH":"hs","PRODUCT":"hpr","SHOPPING_CART":"hcart","CONVERSION":"hc","TRACKING":null}[params.pt] || ''; 141 var paramsArr = []; 142 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 143 144 var pl = document.createElement('script'); 145 pl.type = 'text/javascript'; 146 pl.async = true; 147 pl.src = "https://beacon.sojern.com/pixel/cp/"+pixel_id+"?f_v=cp_v3_js&p_v=8&" + paramsArr.join('&'); 148 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 149 } else { 150 151 /* Please do not modify the below code. */ 152 var cid = []; 153 var paramsArr = []; 154 var cidParams = []; 155 var pl = document.createElement('script'); 156 var defaultParams = {"vid":"hot"}; 157 var key; 158 for(key in defaultParams) { params[key] = defaultParams[key]; }; 159 for(key in cidParams) { cid.push(params[cidParams[key]]); }; 160 params.cid = cid.join('|'); 161 for(key in params) { paramsArr.push(key + '=' + encodeURIComponent(params[key])) }; 162 pl.type = 'text/javascript'; 163 pl.async = true; 164 pl.src = 'https://beacon.sojern.com/pixel/p/'+pixel_id+'?f_v=v6_js&p_v=1&' + paramsArr.join('&'); 165 (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(pl); 166 } 167 })(); 168 169 } 170 171 172//these are the wordpess boilerplate notes: 173 /** 174 * All of the code for your public-facing JavaScript source 175 * should reside in this file. 176 * 177 * Note: It has been assumed you will write jQuery code here, so the 178 * $ function reference has been prepared for usage within the scope 179 * of this function. 180 * 181 * This enables you to define handlers, for when the DOM is ready: 182 * 183 * $(function() { 184 * 185 * }); 186 * 187 * When the window is loaded: 188 * 189 * $( window ).load(function() { 190 * 191 * }); 192 * 193 * ...and/or other possibilities. 194 * 195 * Ideally, it is not considered best practise to attach more than a 196 * single DOM-ready or window-load handler for a particular page. 197 * Although scripts in the WordPress core, Plugins and Themes may be 198 * practising this, we should strive to set a better example in our own work. 199 */ 200 201})( 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.