1var g_utm_source,g_utm_medium,g_utm_campaign,g_utm_content,g_utm_term,retailleadsource,ls,saveLsm,currentDate,currentLsm,ls_m,g_lsm; 2var g_affid="",g_cpaid="",g_ls="",g_cxd="",g_am="",g_bta="",g_c="",g_wid="",g_cs="",g_irclickid="",geoIPPromise=null,ipPromise = null,cloudflarePromise=null; 3function getDomain() { 4 const local_url = document.location.href; 5 let domain = local_url.split("/"); 6 if (domain[2]) { 7 domain = domain[2]; 8 } 9 else { 10 domain = ""; 11 } 12 let domains = domain.split("."); 13 let domain_str = ""; 14 if (domains.length > 2) { 15 for (i = domains.length; i > 1; i--) { 16 if (i == domains.length) { 17 domain_str = domains[i - 1]; 18 } 19 else { 20 domain_str = domains[i - 1] + "." + domain_str; 21 } 22 } 23 } 24 else { 25 domain_str = domain; 26 } 27 return domain_str; 28} 29function getPar(par) { 30 const urlParams = new URLSearchParams(window.location.search); 31 return urlParams.get(par) || ""; 32} 33 34function setCookie(name,value,days) { 35 if (days) { 36 var date = new Date(); 37 date.setTime(date.getTime()+(days*24*60*60*1000)); 38 var expires = "; expires="+date.toGMTString(); 39 } 40 else expires = ""; 41 document.cookie = name+"="+value+expires+"; path=/;domain=" + getDomain(); 42} 43 44function getCookie(name) { 45 var nameEQ = name + "="; 46 var ca = document.cookie.split(';'); 47 for(var i=0;i < ca.length;i++) { 48 var c = ca[i]; 49 while (c.charAt(0)==' ') c = c.substring(1,c.length); 50 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 51 } 52 return ""; 53} 54 55function GetUrl(par) { 56 const urlParams = new URLSearchParams(window.location.search); 57 return urlParams.get(par) || ""; 58} 59 60 61 getGeoIPOnce().catch(() => {}); 62 getIPOnce().catch(() => {}); 63 64function getGeoIPOnce() { 65 if (geoIPPromise) return geoIPPromise; 66 67 geoIPPromise = (async () => { 68 try { 69 const cfInfo = await getCloudflareInfoOnce(2000); 70 if (cfInfo.country) { 71 return cfInfo.country; 72 } 73 74 const geoInfo = await getInfoFromGeoIP2(5000); 75 if (geoInfo.country) { 76 return geoInfo.country; 77 } 78 79 return null; 80 81 } catch (err) { 82 console.warn("Geo detection failed completely", err); 83 return null; 84 } 85 })(); 86 87 return geoIPPromise; 88} 89 90//æ§è¡ip跳转 91getIPOnce() 92 .then(ip => { 93 const blockedIPs = [ 94 '13.228.57.17', 95 '54.179.95.215', 96 '13.228.0.184', 97 '18.163.82.234', 98 '18.166.161.181', 99 '16.163.46.171', 100 '119.75.30.114', 101 '118.201.188.222', 102 '52.221.100.82', 103 '118.201.188.222' 104 ]; 105 106 if (blockedIPs.includes(ip)) { 107 return null; 108 } 109 110 return getGeoIPOnce(); 111 }) 112 .then(code => { 113 if (!code) return; 114 115 const queryParameter = []; 116 ['affid', 'cpaid', 'cxd', 'am', 'bta'].forEach(key => { 117 if (getPar(key)) { 118 queryParameter.push(key); 119 } 120 }); 121 122 if (code === 'AU') { 123 if (queryParameter.length > 0) { 124 window.location.replace('/error-notice/'); 125 } else { 126 let url_Data = window.location.pathname + window.location.search; 127 window.location.href = 'https://www.puprime.au' + url_Data; 128 } 129 return; 130 } else if (code === 'SG') { 131 window.location.replace('/error-notice/'); 132 return; 133 } 134 135 if(getPar('jump')) return; 136 getDomainTLD(code); 137 }) 138 .catch(err => console.error('Error:', err)); 139 140function getIPOnce() { 141 if (ipPromise) return ipPromise; 142 143 ipPromise = (async () => { 144 try { 145 const cfInfo = await getCloudflareInfoOnce(2000); 146 if (cfInfo.ip){ 147 setCookie('real_ip', cfInfo.ip, 15); 148 return cfInfo.ip; 149 } 150 151 const geoInfo = await getInfoFromGeoIP2(5000); 152 if (geoInfo.ip){ 153 setCookie('real_ip', geoInfo.ip, 15); 154 return geoInfo.ip; 155 } 156 157 return null; 158 159 } catch (err) { 160 console.warn("IP detection failed completely", err); 161 return null; 162 } 163 })(); 164 165 return ipPromise; 166} 167 168 169 170function getCloudflareInfoOnce() { 171 if (cloudflarePromise) return cloudflarePromise; 172 173 cloudflarePromise = getInfoFromCloudflare(2000); 174 175 return cloudflarePromise; 176} 177 178async function getInfoFromCloudflare(timeout = 2000) { 179 try { 180 const controller = new AbortController(); 181 const timer = setTimeout(() => controller.abort(), timeout); 182 183 const res = await fetch('/cdn-cgi/trace', { 184 cache: 'no-store', 185 signal: controller.signal 186 }); 187 188 clearTimeout(timer); 189 190 if (!res.ok) return null; 191 192 const text = await res.text(); 193 194 const data = Object.fromEntries( 195 text.trim().split('\n').map(line => line.split('=')) 196 ); 197 198 if (!data.ip && !data.loc) return null; 199 200 return { 201 ip: data.ip ?? null, 202 country: data.loc ?? null 203 }; 204 205 } catch (err) { 206 console.warn("Cloudflare failed", err); 207 return null; 208 } 209 } 210 211async function getInfoFromGeoIP2(timeout = 5000) { 212 try { 213 await waitForGeoIP2(timeout); 214 215 return await new Promise(resolve => { 216 217 geoip2.city( 218 res => { 219 const info = { 220 ip: res?.traits?.ip_address ?? null, 221 country: res?.country?.iso_code ?? null 222 }; 223 224 resolve(info); 225 }, 226 () => resolve(null) 227 ); 228 }); 229 230 } catch (err) { 231 console.warn("GeoIP2 failed", err); 232 return null; 233 } 234 } 235 236function waitForGeoIP2(timeout = 5000) { 237 return new Promise((resolve, reject) => { 238 if (window.geoip2) return resolve(); 239 240 const start = Date.now(); 241 242 const check = () => { 243 if (window.geoip2) { 244 resolve(); 245 } else if (Date.now() - start > timeout) { 246 reject(new Error("geoip2 load timeout")); 247 } else { 248 requestAnimationFrame(check); 249 } 250 }; 251 252 check(); 253 }); 254} 255 256const fuzzyKeywords = [ 257 'test', 258 'thank', 259 'success' 260 ]; 261 262const pages = ["/mohamed-jamtih/","/david-radysew/","/alaa-elharfaoui/","/reeve-lingu/","/leong-ren-zhong-leo/","/black-friday-bonus/","/fr-copy-trading2/","/de-copy-trading2/","/starter-kit/","/lpen/signupnew/","/lpen-promo5020/","/exclusive-sports-season-offer/","/lpen-promo5020nl/","/lpen-ggreg/","/gg-50/","/exclusive-sports-season-offers/","/lpenhp-promo5020/","/gg-50-hp/","/gg-50-deposit-bonus/","/50deposit-impact/","/13-growth-promo/","/fast-and-easy-account/","/lpen-ggreg-ca/","/lpen/signupnew-ca/","/th-fast-and-easy-account/","/es-fast-and-easy-account/","/lpen/signupnew-hp/","/fast-live-account-hp/","/gg-50-hp-2/","/13-growth-promo-hp/","/lpen-ggreg-hp/","/in-tp-101024/","/lpen/signupnew-hp/inv/","/lpen-ggreg-th/","/lpen-ggreg-eu/","/th-lpen-ggreg/","/trust-pilot/","/xmas-promotion-it/","/xmas-promotion-es/","/xmas-promotion-de/","/copy-trading-lp/","/io-impact/","/100-rebate/","/deposit-cashback/","/copy-trading-impact/","/copy-trading-lp-2/","/copy-trading-lp-3/","/home-uk/5020-promo/","/copy-trading-50-bonus/","/home-uk/10020-promo/","/copy-trading-100-bonus/","/100deposit-impact/","/th-promotions-1/","/copy-trading-3-th/","/copy-trading-2-th/","/signupnew-th/","/vps-promo/","/copy-trading-5/","/10020-bonus/","/th-copy-trading-5/","/th-copy-trading/","/copy-trading2/","/copy-trading3/","/copy-trading-tw/","/copy-trading-5-tw/","/
262home/tw-10020-promo/","/copytrading/","/tw-gold-cashback/","/afa-sponsor/","/tw-gg-50/","/de-afa-sponsor/","/it-afa-sponsor/","/copy-trading-10020/","/trust-pilot-review/","/copy-trading-contest/","/it-copy-trading-contest/","/official-be/","/signuppage/","/home-ca-app/","/home-ca-app2/","/home-ca-app3/","/ca-partner/","/canada-official/","/ca-offical/","/afa-50bonus/","/official-de/","/canada-official-mobile/","/official-me/","/home-forex/","/home-commodities/","/home-stocks/","/home-crypto/","/home-mt/","/50-bonus/","/afa-sponsor2/","/official-puprime/","/trade-or-treat-promotion/","/home-english/10020-bonus/","/home-italy/10020-bonus/","/home-spanish/10020-bonus/","/home-german/10020-bonus/","/home-french/10020-bonus/","/afa-copytrading-bonus/","/afa-10020bonus/","/afa-copytrading-50bonus/","/afa-5020bonus/","/blackfriday-promo/","/copy-trading-6/","/fr-blackfriday-promo/","/de-blackfriday-promo/","/canada-10020-bonus/","/ca-refer-a-friend/","/fr-afa-sponsor/","/home-uk/it-10020-promo/","/home-uk/de-10020-promo/","/home-uk/fr-10020-promo/","/it-copy-trading2/","/homepage-uk/","/home-dark-theme/","/home-india/","/home-belgium/","/homepage-india/","/home-canada/","/home-germany/","/home-tp/","/ctmt/","/home-nigeria/","/dark-ca/","/home-canada2/","/dark-be/","/uk-home-app/","/official-ca/","/
262home-uk-cahomepage/","/official-canada/","/home-ca/","/home-english/","/home-italy/","/home-german/","/home-spanish/","/home-french/","/xmas-promotion/","/christmas-promo/","/FR-AFA-Jan-Feb-Promo/","/IT-AFA-Jan-Feb-Promo/","/DE-AFA-Jan-Feb-Promo/","/DUTCH-AFA-Jan-Feb-Promo/","/AFA-Jan-Feb-Promo/","/FR-christmas-promo/","/DE-christmas-promo/","/IT-christmas-promo/","/DUTCH-christmas-promo/","/webinar-ads/","/carmenlim/","/salwa-azele/","/zack-damun/","/rayane-adrhami/","/christopher-chen/","/jag/","/jamal/","/jing-pei-chin/","/sally-loh/","/joyce-beh/","/darren-yong/","/wan-adam/","/jason-lim/","/alaa-eddine-bouchgua/","/angela-ogechi/","/kemi-sosina/","/low-shien-de-k-d/","/heng-loon-chin/","/rania-belkhlifi/","/georgemarianconstantinescu/","/ceylan-ong/","/shafiq-adli/","/tatchipoon/","/serena-di-pietro/","/anas-bakka/","/xhesida-prenga/","/kseniia-poralova/","/hakim/","/andrei-serikov/","/insaf-rhechaoui/","/ou-ming-xiu/","/insaf-ghechaoui/","/carmen-lim/","/vivien-wong/","/steve-lee/","/yassine-elyoufi/","/isaiah-alexander/","/dasson-cheah/","/amoljadhav/","/anas-elkortobi/","/luis-lui/","/kevin-chen-tze-zhiong/","/renugadevi-a-p-subramaniam/","/daniel-tee/","/foong-zi-jun/","/joe-choong/","/julian-toh/","/hafsah-azmi/","/shaun-tan/","/giuseppe-giallongo/","/eric-ho-yung-min/","/wong-weng-hong/","/cristiandellefratte/","/ashely-see/","/nicusor-darius-nicolae/","/alessia-vegro/","/khaoula-ben-hammadi/","/bianca-mirita/","/fitrah-aishah/","/laila-yassine/","/anthony-quan/","/emad-arafat-abo-soliman/","/alex-kwon/","/soufiane-oussidi/","/alessandra-timothy-jominol/","/timothy-liew/","/lea-mendoza/","/jeremiah-michael-intia/","/axel-rui/","/andresnacimba/","/marlonllumiquinga/","/alejandroavila/","/polina-smirnova/","/dr-ilizah-sian/","/jay-yew/","/malvn-singh/","/reena-nagalingam/","/noureddine-ait-balla/","/safae-segrani/","/khairunisa-khadzar/","/willie-ong/","/eddie-choo/","/aidensmith/","/billguan/","/tonytan/","/theoshane/","/davidaugustine/","/josemiguelmelo/","/tiagodias/","/hardikpanchal/","/haidyahmedsokar/","/yasirmubarak/","/mohanadyakout/","/sherifmosaad/","/abdelilahidelsi/","/alaeeddinebnouhachem/","/aymanhilal/","/sheldonchai/","/yassineouasbir/","/fatimaezahrayassine/","/ceylanong/","/fatinnurshazlin/","/fatimaabelhad/","/mustaphaamghar/","/anassberdaa/","/ze-han/","/yewhimchia/","/williamwong/","/samuelyong/","/nicsonyeohboonthong/","/kuoleongho/","/10020-bonus1/","/exclusive-starter/","/elite-reward/","/be-refer-a-friend/","/hemamitra-seribalamurugan/","/copy-trading-it-5/","/copy-trading-de-5/","/copy-trading-ar-5/","/copy-trading-fr-5/","/cashback-premium/","/official-trading/","/navinthar-nandanathan/","/official-trading/vietnam-paid/","/official-trading/thai-paid/","/gurmit-singh-a-l-garnam-singh/","/ayman-eljabri/","/pu-card/","/anand-prakash/","/nurul-intan-albaniah/","/home-india-in/","/home-india-tw/","/home-india-th/","/copy-trading3-tw/","/copy-trading3-in/","/copy-trading2-tw/","/copy-trading2-in/","/jayasri-eanpinjoth/","/sara-meftah/","/muizz-imanuddin-bin-shaharudin/","/alessia-oliva/","/raja-sehar/","/bobby-tan/","/anghuixin/","/darvin-raj-chandran/","/alvin-loke/","/jade-fanj/","/AFAJerseyGiveaway/","/AFAJerseyGiveaway-es/","/AFAJerseyGiveaway/MENA/","/AFAJerseyGiveaway/MENA-ar/","/7trades_ebook/","/najihah-rafee/","/top1_ebook/","/pu-prime-fsa-privacy-policy/","/pu-prime-mauritius-privacy-policy/","/pu-prime-llc-privacy-policy/","/pu-prime-south-africa-privacy-policy/","/5min-ebook/","/stanislav-vladimirov/","/stewart-nicolas/","/roberto-rojas/","/jose-antonio-fernandez/","/antonio-enrico-monaco/","/enderson-rojas/","/pu-stx-card/","/mohamed-amine-lotfi/","/paid/forex/register/","/paid/paid-ads-mkt-es/","/paid/paid-ads-mkt/","/paid/paid-ads-mkt-pt/","/mariana-stefanova/","/paid/copy-trading-1-ar/","/paid/copy-trading-2-ar/","/paid/copy-trading-3-ar/","/paid/copy-trading-4-ar/","/paid/copy-trading-5-ar/","/sara-simjanoska/","/ivan-yong/"] 263function getDomainTLD(code) { 264 const currentPath = window.location.pathname.replace(/\/+$/, ''); 265 const matched =currentPath !== "" && pages.some(p =>{ 266 const cleanP = p.replace(/\/+$/, ''); 267 return cleanP.includes(currentPath) || currentPath.includes(cleanP); 268 }); 269 const isFuzzyMatch = fuzzyKeywords.some(k => 270 currentPath.includes(k) 271 ); 272 if(matched || isFuzzyMatch){ 273 setCookie("jump","1",0); 274 } 275 var jump=getCookie("jump"); 276 const hasCrypto = window.location.href.toLowerCase().includes('crypto'); 277 const cryptoVisited = getCookie('crypto_visited'); 278 let url_data = window.location.pathname+window.location.search; 279 if(jump!="1"){ 280 if(getCookie('not_jump') && getCookie('not_jump')=='no'){ 281 }else{ 282 if(hasCrypto){ 283 if(!cryptoVisited){ 284 285 switch(code) { 286 case 'JP': 287 window.location.href = "https://jp.puprime.com"; 288 break; 289 case 'HK': 290 window.location.href = "https://tw.puprime.com"; 291 break; 292 case 'TW': 293 window.location.href = "https://tw.puprime.com"; 294 break; 295 case 'KR': 296 window.location.href = "https://kr.puprime.online"; 297 break; 298 case 'LV': 299 window.location.href = "https://lv.puprime.com"; 300 break; 301 case 'ES': 302 window.location.href = "https://es.puprime.pro"; 303 break; 304 case 'PT': 305 window.location.href = "https://pt.puprime.com"; 306 break; 307 case 'RO': 308 window.location.href = "https://ro.puprime.com"; 309 break; 310 case 'DE': 311 window.location.href = "https://de.puprime.com"; 312 break; 313 case 'IT': 314 window.location.href = "https://it.puprime.com"; 315 break; 316 case 'RU': 317 case 'BY': 318 window.location.href = "https://ru.puprime.com"; 319 break; 320 case 'IN': 321 window.location.href = "https://in.puprime.com"; 322 break; 323 case 'TH': 324 window.location.href = "https://th.puprime.com"; 325 break; 326 case 'VN': 327 window.location.href = "https://vn.puprime.pro"; 328 break; 329 case 'CN': 330 window.location.href = "https://cn.puprime.com"; 331 break; 332 case 'ID': 333 window.location.href = "https://id.puprime.pro"; 334 break;
335 case 'MY': 336 window.location.href = "https://my.puprime.online"; 337 break; 338 case 'BG': 339 window.location.href = "https://bg.puprime.com"; 340 break; 341 case 'NL': 342 window.location.href = "https://nl.puprime.com"; 343 break; 344 case 'PL': 345 window.location.href = "https://pl.puprime.com"; 346 break; 347 case 'SA': 348 window.location.href = "https://ar.puprime.com"; 349 break; 350 case 'FR': 351 case 'PF': 352 case 'NC': 353 case 'WF': 354 case 'YT': 355 case 'GP': 356 case 'MQ': 357 case 'RE': 358 case 'BL': 359 case 'GF': 360 case 'PM': 361 case 'MF': 362 window.location.href = "https://fr.puprime.org"; 363 break; 364 default: 365 window.location.href = "https://www.puprime.com"; 366 break; 367 } 368 } 369 setCookie('crypto_visited', '1', 0); 370 371 }else{ 372 switch(code) { 373 case 'JP': 374 window.location.href = "https://jp.puprime.com"+url_data; 375 break; 376 case 'HK': 377 window.location.href = "https://tw.puprime.com"+url_data; 378 break; 379 case 'TW': 380 window.location.href = "https://tw.puprime.com"+url_data; 381 break; 382 case 'KR': 383 window.location.href = "https://kr.puprime.online"+url_data; 384 break; 385 case 'LV': 386 window.location.href = "https://lv.puprime.com"+url_data; 387 break; 388 case 'ES': 389 window.location.href = "https://es.puprime.pro"+url_data; 390 break; 391 case 'PT': 392 window.location.href = "https://pt.puprime.com"+url_data; 393 break; 394 case 'RO': 395 window.location.href = "https://ro.puprime.com"+url_data; 396 break; 397 case 'DE': 398 window.location.href = "https://de.puprime.com"+url_data; 399 break; 400 case 'IT': 401 window.location.href = "https://it.puprime.com"+url_data; 402 break; 403 case 'RU': 404 case 'BY': 405 window.location.href = "https://ru.puprime.com"+url_data; 406 break; 407 case 'IN': 408 window.location.href = "https://in.puprime.com"+url_data; 409 break; 410 // case 'PH': 411 // window.location.href = "https://ph.puprime.com"+url_data; 412 // break; 413 case 'TH': 414 window.location.href = "https://th.puprime.com"+url_data; 415 break; 416 case 'VN': 417 window.location.href = "https://vn.puprime.pro"+url_data; 418 break; 419 case 'CN': 420 window.location.href = "https://cn.puprime.com"+url_data; 421 break; 422 case 'ID': 423 window.location.href = "https://id.puprime.pro"+url_data; 424 break; 425 case 'MY': 426 window.location.href = "https://my.puprime.online"+url_data; 427 break; 428 case 'BG': 429 window.location.href = "https://bg.puprime.com"+url_data; 430 break; 431 case 'NL': 432 window.location.href = "https://nl.puprime.com"+url_data; 433 break; 434 case 'PL': 435 window.location.href = "https://pl.puprime.com"+url_data; 436 break; 437 case 'SA': 438 window.location.href = "https://ar.puprime.com"+url_data; 439 break; 440 case 'FR': 441 case 'PF': 442 case 'NC': 443 case 'WF': 444 case 'YT': 445 case 'GP': 446 case 'MQ': 447 case 'RE': 448 case 'BL': 449 case 'GF': 450 case 'PM': 451 case 'MF': 452 window.location.href = "https://fr.puprime.org"+url_data; 453 break; 454 // case 'CY': 455 // window.location.href = "http://www.pacific-union.cy/"+url_data; 456 // break; 457 default: 458 // Notes in English only 459 // window.location.href = "https://www.puprime.com"+url_data; 460 } 461 } 462 setCookie("jump","1",0); 463 } 464 }else{ 465 if(hasCrypto){ 466 if(cryptoVisited){ 467 window.location.href = window.location.origin; 468 } 469 } 470 } 471} 472 473function getQueryString(name) { 474 var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); 475 var r = window.location.search.substr(1).match(reg); 476 if (r != null) { 477 return unescape(r[2]); 478 } 479 return null; 480} 481 482function hasUrlUtm() { 483 let urlUtmArr = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'retailleadsource', 'rt', 'ls'] 484 let flag = false; 485 urlUtmArr.forEach((item) => { 486 if (getPar(item).replace(/['"ââââ;`]/g, "") !== '') { 487 flag = true; 488 } 489 }) 490 return flag; 491 } 492 493function hasCookie(cookieName) { 494 if (getCookie(cookieName) && getCookie(cookieName) != '' && getCookie(cookieName) != null && getCookie(cookieName) != 'null' && getCookie(cookieName) != undefined && getCookie(cookieName) != 'undefined') { 495 return true; 496 } 497 return false;
498} 499 500function hasParams(paramsName) { 501 if (getPar(paramsName) && getPar(paramsName) != '' && getPar(paramsName) != null && getPar(paramsName) != 'null' && getPar(paramsName) != undefined && getPar(paramsName) != 'undefined') { 502 return true; 503 } 504 return false; 505} 506 507function getParameterValue(urlParams, cookieParams) { 508 if(!cookieParams){ 509 return hasParams(urlParams) ? getPar(urlParams) : (hasCookie(urlParams) ? getCookie(urlParams) : ""); 510 }else{ 511 cookieParams = !cookieParams ? urlParams : cookieParams; 512 return hasParams(urlParams) ? getPar(urlParams) : (hasCookie(cookieParams) ? getCookie(cookieParams) : ""); 513 } 514} 515 516function utmParam(){ 517 g_utm_source = getPar("utm_source") || 'NA'; 518 g_utm_medium = getPar("utm_medium") || 'NA'; 519 g_utm_campaign = getPar("utm_campaign") || 'NA'; 520 g_utm_content = getPar("utm_content") || 'NA'; 521 g_utm_term = getPar("utm_term") || 'NA'; 522 retailleadsource = getPar("retailleadsource") || getPar('rt') || 'NA'; 523 ls = getPar("ls") || 'NA'; 524 var lsmArr =[g_utm_source,g_utm_medium,g_utm_campaign,g_utm_content,g_utm_term,retailleadsource,ls]; 525 lsmArr.forEach(function(item ,index) { 526 item = item.replace(/['"ââââ;`]/g,"") 527 if(!item){ 528 item = "NA" 529 } 530 lsmArr[index] = item; 531 }); 532 currentLsm = `${lsmArr[0]}|${lsmArr[1]}|${lsmArr[2]}|${lsmArr[3]}|${lsmArr[4]}|rt=${lsmArr[5]}|ls=${lsmArr[6]}` 533 currentDate = Date.now(); 534 535 if(getCookie("lsm")){ 536 saveLsm = JSON.parse(getCookie("lsm")) ; 537 // çä¹åæ¯å¦åè¿ 538 const haveRecord = saveLsm.some(item => item.ls == currentLsm); 539 // å¦æè¯¥æ¡é¾æ¥ä¹ååå¨è¿ï¼å·æ°ä¸å¯¹åºçæ¶é´æ³ 540 if(haveRecord){ 541 saveLsm.forEach(item => { 542 if(item.ls === currentLsm){ 543 item.date = currentDate; 544 return; 545 } 546 }); 547 // éæ°æä¸åºï¼è®©ææ°çä¿æå¨æä¸é¢ 548 saveLsm.sort((a, b) => a.date - b.date); 549 // å·æ°ä¸åçå¼ 550 }else{ 551 // ä¹å没åè¿ï¼åå°æ°ç»ä¸ 552 saveLsm.push({ 553 ls: currentLsm, 554 date: currentDate 555 }); 556 } 557 setCookie("lsm", JSON.stringify(saveLsm.filter(item => Date.now() - item.date < 90 * 24 * 60 * 60 * 1000)), 90); 558 }else{ 559 // 没åè¿lsm 560 if (getCookie("ls")) { 561 if (getCookie("ls") == ls) { 562 saveLsm = [ 563 { 564 ls: currentLsm, 565 date: currentDate 566 } 567 ]; 568 }else { 569 if(!getPar("utm_source")&&!getPar("utm_medium")&&!getPar("utm_campaign")&&!getPar("utm_content")&&!getPar("utm_term")&&!getPar("retailleadsource")&&!getPar("ls")){ 570 saveLsm = [ 571 { 572 ls: `NA|NA|NA|NA|NA|retailleadsource=NA|ls=${getCookie('ls')}`, 573 date: currentDate - 1 574 } 575 ]; 576 }else{ 577 saveLsm = [ 578 { 579 ls: `NA|NA|NA|NA|NA|retailleadsource=NA|ls=${getCookie('ls')}`, 580 date: currentDate - 1 581 },{ 582 ls: currentLsm, 583 date: currentDate 584 } 585 ]; 586 } 587 } 588 } else { 589 saveLsm = [ 590 { 591 ls: currentLsm, 592 date: currentDate 593 } 594 ]; 595 } 596 setCookie("lsm", JSON.stringify(saveLsm.filter(item => Date.now() - item.date < 90 * 24 * 60 * 60 * 1000)), 90); 597 } 598 g_lsm=JSON.stringify(saveLsm); 599} 600 601function handleLsCookie() { 602 let regExp = /['"ââââ;`]/g; 603 let ref_url = ''; 604 if (document.referrer.length > 0) { 605 ref_url = document.referrer; 606 ref_url = ref_url.toLowerCase(); 607 var str1 = 'google.'; 608 var str2 = 'facebook.'; 609 if(ref_url.indexOf(str1)>0){ 610 if(getPar("affid")==""){ 611 setCookie("ls","GG_WEB_DRT",15); 612 } 613 }else if(ref_url.indexOf(str2)>0){ 614 if(getPar("affid")==""){ 615 setCookie("ls","SM_FB_DRT",15); 616 } 617 } 618 } 619 // 妿lsåæ°åå¨ä¸ä¸ä¸ºç©ºï¼ç´æ¥è®¾ç½®ls cookie 620 if (getPar("ls") != "") { 621 setCookie("ls", getPar("ls").replace(/['"ââââ;`]/g, ""), 15); 622 }else{ 623 let text = ''; 624 g_utm_source = getPar("utm_source"); 625 g_utm_medium = getPar("utm_medium"); 626 g_utm_campaign = getPar("utm_campaign"); 627 retailleadsource = getPar("retailleadsource") || getPar('rt'); 628 if(g_utm_source.replace(regExp, "")){ 629 if(g_utm_medium.replace(regExp, "")&&g_utm_campaign.replace(regExp, "")){ 630 if(retailleadsource.replace(regExp, "")){ 631 // 设置å 嫿æåä¸ªåæ°çcookie 632 text = g_utm_source + '_' + g_utm_medium + '_' + g_utm_campaign + '_' + retailleadsource;
633 setCookie("ls", text, 15); 634 }else{ 635 // 设置å å«ä¸ä¸ªutmåæ°çcookie 636 text = g_utm_source + '_' + g_utm_medium + '_' + g_utm_campaign; 637 setCookie("ls", text, 15); 638 } 639 }else{ 640 // åªè®¾ç½®utm_sourceåæ° 641 setCookie("ls", g_utm_source, 15); 642 } 643 } 644 } 645} 646 647function setCookieParHasVal(objList) { 648 for (let i = 0; i < objList.length; i++) { 649 const { paramsName, cookieName, cookieTime } = objList[i]; 650 if (hasParams(paramsName)) { 651 setCookie(cookieName, getPar(paramsName), cookieTime) 652 } 653 } 654} 655 656function getWidValue() { 657 var domain = window.location.host.split(".")[0]; 658 switch(domain){ 659 case 'ca': 660 return "PU_CA"; 661 case 'fr': 662 return "PU_FR"; 663 case 'cn': 664 return "PU_CN"; 665 case 'kr': 666 return "PU_KR"; 667 case 'id': 668 return "PU_ID"; 669 case 'vn': 670 return "PU_VN"; 671 case 'tw': 672 return "PU_TW"; 673 case 'my': 674 return "PU_MY"; 675 case 'es': 676 return "PU_ES"; 677 case 'pt': 678 return "PU_PT"; 679 case 'jp': 680 return "PU_JP"; 681 case 'th': 682 return "PU_TH"; 683 case 'ph': 684 return "PU_PH"; 685 case 'it': 686 return "PU_IT"; 687 case 'de': 688 return "PU_DE"; 689 case 'ru': 690 return "PU_RU"; 691 case 'in': 692 return "PU_IN"; 693 case 'ar': 694 return "PU_AR"; 695 case 'pl': 696 return "PU_PL"; 697 case 'fa': 698 return "PU_FA"; 699 case 'bg': 700 return "PU_BG"; 701 case 'lv': 702 return "PU_LV"; 703 case 'ro': 704 return "PU_RO"; 705 case 'nl': 706 return "PU_NL"; 707 default: 708 return "PU_EN"; 709 } 710} 711 712 713function setCountryFromCookie($) { 714 getGeoIPOnce().then(code=>{ 715 if(code){ 716 for(var i in _countryList){ 717 var coun_name = i; 718 if(code == _countryList[i]){ 719 $('#country').val(i); 720 $("#phoneCode").val(_areanoList[coun_name]); 721 break; 722 } 723 } 724 } 725 }) 726} 727 728// Timestamp random number (for ip jump) 729function Data() 730{ 731 var date = new Date(); 732 var year = date.getFullYear(); 733 var month = date.getMonth() + 1; 734 var strDate = date.getDate(); 735 if (month >= 1 && month <= 9) { 736 month = "0" + month; 737 } 738 if (strDate >= 0 && strDate <= 9) { 739 strDate = "0" + strDate; 740 } 741 var newRandom = ""; 742 for(var i=0;i<5;i++) 743 { 744 newRandom += Math.floor(Math.random()*9 + 1).toString(); 745 } 746 var currentdate = year + month + strDate + newRandom; 747 return currentdate; 748} 749 750var _areanoList={ 751 "Aland Islands":"358", 752 "Albania":"355", 753 "Algeria":"213", 754 // "American Samoa":"1684", 755 "Andorra":"376", 756 "Angola":"244", 757 "Anguilla":"1264", 758 "Antarctica":"672", 759 "Antigua And Barbuda":"1268", 760 "Argentina":"54", 761 "Armenia":"374", 762 "Aruba":"297", 763 "Austria":"43", 764 "Azerbaijan":"994", 765 "Bahamas":"1242", 766 "Bahrain":"973", 767 "Bangladesh":"880", 768 "Barbados":"1246", 769 "Belgium":"32", 770 "Belize":"501", 771 "Benin":"229", 772 "Bermuda":"1441", 773 "Bhutan":"975", 774 "Bolivia":"591", 775 "Botswana":"267", 776 "Bouvet Island":"147", 777 "Bosnia and Herzegovina":"387", 778 "Brazil":"55", 779 "British Indian Ocean Territory":"246", 780 "Brunei Darussalam":"673", 781 "Bulgaria":"359", 782 "Burkina Faso":"226", 783 "Belarus":"375", 784 "Cambodia":"855", 785 "Cameroon":"237", 786 "Canada":"1", 787 "Cape Verde":"238", 788 "Cayman Islands":"1345", 789 "Chad":"235", 790 "Chile":"56", 791 "Christmas Island":"61", 792 "Cocos (Keeling) Islands":"61", 793 "Colombia":"57", 794 "Comoros":"269", 795 "Congo, Republic Of The":"242", 796 "Cook Islands":"682", 797 "Costa Rica":"506", 798 "Cote d'Ivoire":"225", 799 "Croatia":"385", 800 "Curacao":"599", 801 // "Cyprus":"357", 802 "Czech Republic":"420", 803 "Denmark":"45", 804 "Djibouti":"253", 805 "Dominica":"1767", 806 "Dominican Republic":"1809", 807 "Ecuador":"593", 808 "Egypt":"20", 809 "El Salvador":"503", 810 "Equatorial Guinea":"240", 811 "Estonia":"372", 812 "Ethiopia":"251", 813 "Falkland Islands (Malvinas)":"500", 814 "Faroe Islands":"298", 815 "Federated States Of Micronesia Micronesia":"691", 816 "Fiji":"679", 817 "Finland":"358", 818 "France":"33", 819 "French Guiana":"594", 820 "French Polynesia":"689", 821 "French Southern Territories":"262", 822 "Gabon":"241", 823 "Gambia":"220", 824 "Georgia":"995", 825 "Germany":"49", 826 "Ghana":"233", 827 "Gibraltar":"350", 828 "Greece":"30", 829 "Greenland":"299", 830 "Grenada":"1473", 831 "Guadeloupe":"590", 832 "Guatemala":"502", 833 "Guernsey":"44", 834 "Guyana":"592", 835 "Heard Island And Mcdonald Islands":"11", 836 "Honduras":"504", 837 "HongKong":"852", 838 "Hungary":"36", 839 "Iceland":"354", 840 "India":"91", 841 "Indonesia":"62", 842 "Ireland":"353", 843 "Isle Of Man":"44", 844 "Israel":"972", 845 "Italy":"39", 846 "Jamaica":"1876", 847 "Japan":"81", 848 "Jersey":"44", 849 "Jordan":"962", 850 "Kazakhstan":"77", 851 "Kenya":"254", 852 "Kiribati":"686", 853 "Korea, Republic Of":"82", 854 "Kosovo":"383", 855 "Kuwait":"965", 856 "Kyrgyzstan":"996", 857 "Laos":"856", 858 "Latvia":"371", 859 "Lesotho":"266", 860 "Liechtenstein":"423", 861 "Lithuania":"370", 862 "Luxembourg":"352", 863 "Macao":"853", 864 "Macedonia":"389", 865 "Madagascar":"261", 866 "Malawi":"265", 867 "Malaysia":"60", 868 "Maldives":"960", 869 "Malta":"356", 870 "Marshall Islands":"692", 871 "Martinique":"596", 872 "Mauritania":"222", 873 "Mauritius":"230", 874 "Mayotte":"262", 875 "Mexico":"52", 876 "Moldova":"373", 877 "Monaco":"377", 878 "Mongolia":"976", 879 "Montenegro":"382", 880 "Montserrat":"1664", 881 "Morocco":"212", 882 "Mozambique":"258", 883 "Namibia":"264", 884 "Nauru":"674", 885 "Nepal":"977", 886 "Netherlands Antilles":"599", 887 "Netherlands":"31", 888 "New Caledonia":"687", 889 "New Zealand":"64", 890 "Niger":"227", 891 "Nigeria":"234", 892 "Niue":"683", 893 "Norfolk Island":"672", 894 // "Northern Mariana Islands":"670", 895 "Norway":"47", 896 "Oman":"968", 897 "Pakistan":"92", 898 "Palau":"680", 899 "Palestinian Territory, Occupied":"970", 900 "Panama":"507", 901 "Papua New Guinea":"675", 902 "Paraguay":"595", 903 "Peru":"51", 904 // "Philippines":"63", 905 "Pitcairn":"64", 906 "Poland":"48", 907 "Portugal":"351", 908 // "Puerto Rico":"1787", 909 "Qatar":"974", 910 "Reunion":"262", 911 "Romania":"40", 912 "Rwanda":"250", 913 "Russia":"7", 914 "Saint Barthelemy":"590", 915 "Saint Helena":"290", 916 "Saint Kitts And Nevis":"1869", 917 "Saint Lucia":"1758", 918 "Saint Martin":"590", 919 "Saint Pierre And Miquelon":"508", 920 "Saint Vincent And The Grenadines":"1784", 921 "Samoa":"685", 922 "San Marino":"378", 923 "Sao Tome And Principe":"239", 924 "Saudi Arabia":"966",
925 "Senegal":"221", 926 "Serbia":"381", 927 "Seychelles":"248", 928 "Sint Maarten":"1721", 929 "Sierra Leone":"232", 930 "Slovakia":"421", 931 "Slovenia":"386", 932 "Solomon Islands":"677", 933 "South Africa":"27", 934 "South Georgia And The South Sandwich Islands":"500", 935 "Spain":"34", 936 "Sri Lanka":"94", 937 "Suriname":"597", 938 "Svalbard And Jan Mayen":"47", 939 "Eswatini":"268", 940 "Sweden":"46", 941 "Switzerland":"41", 942 "Taiwan":"886", 943 "Tajikistan":"992", 944 "Tanzania, United Republic Of":"255", 945 "Thailand":"66", 946 "Timor":"670", 947 "Togo":"228", 948 "Tokelau":"690", 949 "Tonga":"676", 950 "Trinidad and Tobago":"1868", 951 "Turkey":"90", 952 "Turkmenistan":"993", 953 "Turks And Caicos Islands":"1649", 954 "Tuvalu":"688", 955 "Uganda":"256", 956 "United Arab Emirates":"971", 957 "United Kingdom":"44", 958 "Uruguay":"598", 959 "Uzbekistan":"998", 960 "Vanuatu":"678", 961 "Vatican City State":"379", 962 "Vietnam":"84", 963 "Virgin Islands, British":"1284", 964 "Wallis And Futuna":"681", 965 "Western Sahara":"212", 966 "Zambia":"260", 967}; 968 969var _countryList={ 970 //"Australia":"61", 971 // "Singapore":"SG", 972 "Aland Islands":"AX", 973 "Albania":"AL", 974 "Algeria":"DZ", 975 // "American Samoa":"AS", 976 "Andorra":"AD", 977 "Angola":"AO", 978 "Anguilla":"AI", 979 "Antarctica":"AQ", 980 "Antigua And Barbuda":"AG", 981 "Argentina":"AR", 982 "Armenia":"AM", 983 "Aruba":"AW", 984 "Austria":"AT", 985 "Azerbaijan":"AZ", 986 "Bahamas":"BS", 987 "Bahrain":"BH", 988 "Bangladesh":"BD", 989 "Barbados":"BB", 990 "Belgium":"BE", 991 "Belize":"BZ", 992 "Benin":"BJ", 993 "Bermuda":"BM", 994 "Bhutan":"BT", 995 "Bolivia":"BO", 996 "Botswana":"BW", 997 "Bouvet Island":"BV", 998 "Bosnia and Herzegovina":"BA", 999 "Brazil":"BR", 1000 "British Indian Ocean Territory":"IO", 1001 "Brunei Darussalam":"BN", 1002 "Bulgaria":"BG", 1003 "Burkina Faso":"BF", 1004 "Belarus":"BY", 1005 "Cambodia":"KH", 1006 "Cameroon":"CM", 1007 "Canada":"CA", 1008 "Cape Verde":"CV", 1009 "Cayman Islands":"KY", 1010 "Chad":"TD", 1011 "Chile":"CL", 1012 "Christmas Island":"CX", 1013 "Cocos (Keeling) Islands":"CC", 1014 "Colombia":"CO", 1015 "Comoros":"KM", 1016 "Congo, Republic Of The":"CG", 1017 "Cook Islands":"CK", 1018 "Costa Rica":"CR", 1019 "Cote d'Ivoire":"CI", 1020 "Croatia":"HR", 1021 "Curacao":"CW", 1022 // "Cyprus":"CY", 1023 "Czech Republic":"CZ", 1024 "Denmark":"DK", 1025 "Djibouti":"DJ", 1026 "Dominica":"DM", 1027 "Dominican Republic":"DO", 1028 "Ecuador":"EC", 1029 "Egypt":"EG", 1030 "El Salvador":"SV", 1031 "Equatorial Guinea":"GQ", 1032 "Estonia":"EE", 1033 "Ethiopia":"ET", 1034 "Falkland Islands (Malvinas)":"FK", 1035 "Faroe Islands":"FO", 1036 "Federated States Of Micronesia Micronesia":"FM", 1037 "Fiji":"FJ", 1038 "Finland":"FI", 1039 "France":"FR", 1040 "French Guiana":"GF", 1041 "French Polynesia":"PF", 1042 "French Southern Territories":"TF", 1043 "Gabon":"GA", 1044 "Gambia":"GM", 1045 "Georgia":"GE", 1046 "Germany":"DE", 1047 "Ghana":"GH", 1048 "Gibraltar":"GI", 1049 "Greece":"GR", 1050 "Greenland":"GL", 1051 "Grenada":"GD", 1052 "Guadeloupe":"GP", 1053 "Guatemala":"GT", 1054 "Guernsey":"GG", 1055 "Guyana":"GY", 1056 "Heard Island And Mcdonald Islands":"HM", 1057 "Honduras":"HN", 1058 "HongKong":"HK", 1059 "Hungary":"HU", 1060 "Iceland":"IS", 1061 "India":"IN", 1062 "Indonesia":"ID", 1063 "Ireland":"IE", 1064 "Isle Of Man":"IM", 1065 "Israel":"IL", 1066 "Italy":"IT", 1067 "Jamaica":"JM", 1068 "Japan":"JP", 1069 "Jersey":"JE", 1070 "Jordan":"JO", 1071 "Kazakhstan":"KZ", 1072 "Kenya":"KE", 1073 "Kiribati":"KI", 1074 "Korea, Republic Of":"KR", 1075 "Kosovo":"XK", 1076 "Kuwait":"KW", 1077 "Kyrgyzstan":"KG", 1078 "Laos":"LA", 1079 "Latvia":"LV", 1080 "Lesotho":"LS", 1081 "Liechtenstein":"LI", 1082 "Lithuania":"LT", 1083 "Luxembourg":"LU", 1084 "Macao":"MO", 1085 "Macedonia":"MK", 1086 "Madagascar":"MG", 1087 "Malawi":"MW", 1088 "Malaysia":"MY", 1089 "Maldives":"MV", 1090 "Malta":"MT", 1091 "Marshall Islands":"MH", 1092 "Martinique":"MQ", 1093 "Mauritania":"MR", 1094 "Mauritius":"MU", 1095 "Mayotte":"YT", 1096 "Mexico":"MX", 1097 "Moldova":"MD", 1098 "Monaco":"MC", 1099 "Mongolia":"MN", 1100 "Montenegro":"ME", 1101 "Montserrat":"MS", 1102 "Morocco":"MA", 1103 "Mozambique":"MZ", 1104 "Namibia":"NA", 1105 "Nauru":"NR", 1106 "Nepal":"NP", 1107 "Netherlands Antilles":"AN", 1108 "Netherlands":"NL", 1109 "New Caledonia":"NC", 1110 "New Zealand":"NZ", 1111 "Niger":"NE", 1112 "Nigeria":"NG", 1113 "Niue":"NU", 1114 "Norfolk Island":"NF", 1115 // "Northern Mariana Islands":"MP", 1116 "Norway":"NO", 1117 "Oman":"OM", 1118 "Pakistan":"PK", 1119 "Palau":"PW", 1120 "Palestinian Territory, Occupied":"PS", 1121 "Panama":"PA", 1122 "Papua New Guinea":"PG", 1123 "Paraguay":"PY", 1124 "Peru":"PE", 1125 // "Philippines":"PH", 1126 "Pitcairn":"PN", 1127 "Poland":"PL", 1128 "Portugal":"PT", 1129 // "Puerto Rico":"PR", 1130 "Qatar":"QA", 1131 "Reunion":"RE", 1132 "Romania":"RO", 1133 "Rwanda":"RW", 1134 "Russia":"RU", 1135 "Saint Barthelemy":"BL", 1136 "Saint Helena":"SH", 1137 "Saint Kitts And Nevis":"KN", 1138 "Saint Lucia":"LC", 1139 "Saint Martin":"MF", 1140 "Saint Pierre And Miquelon":"PM", 1141 "Saint Vincent And The Grenadines":"VC", 1142 "Samoa":"WS", 1143 "San Marino":"SM", 1144 "Sao Tome And Principe":"ST", 1145 "Saudi Arabia":"SA",
1146 "Senegal":"SN", 1147 "Serbia":"RS", 1148 "Seychelles":"SC", 1149 "Sint Maarten":"SX", 1150 "Sierra Leone":"SL", 1151 "Slovakia":"SK", 1152 "Slovenia":"SI", 1153 "Solomon Islands":"SB", 1154 "South Africa":"ZA", 1155 "South Georgia And The South Sandwich Islands":"GS", 1156 "Spain":"ES", 1157 "Sri Lanka":"LK", 1158 "Suriname":"SR", 1159 "Svalbard And Jan Mayen":"SJ", 1160 "Eswatini":"SZ", 1161 "Sweden":"SE", 1162 "Switzerland":"CH", 1163 "Taiwan":"TW", 1164 "Tajikistan":"TJ", 1165 "Tanzania, United Republic Of":"TZ", 1166 "Thailand":"TH", 1167 "Timor":"TL", 1168 "Togo":"TG", 1169 "Tokelau":"TK", 1170 "Tonga":"TO", 1171 "Trinidad and Tobago":"TT", 1172 "Turkey":"TR", 1173 "Turkmenistan":"TM", 1174 "Turks And Caicos Islands":"TC", 1175 "Tuvalu":"TV", 1176 "Uganda":"UG", 1177 "United Arab Emirates":"AE", 1178 "United Kingdom":"GB", 1179 "Uruguay":"UY", 1180 "Uzbekistan":"UZ", 1181 "Vanuatu":"VU", 1182 "Vatican City State":"VA", 1183 "Vietnam":"VN", 1184 "Virgin Islands, British":"VG", 1185 "Wallis And Futuna":"WF", 1186 "Western Sahara":"EH", 1187 "Zambia":"ZM", 1188} 1189var new_areanoList=JSON.parse(JSON.stringify(_areanoList)); 1190 1191 1192jQuery(document).ready(function ($) { 1193 1194 $("select.phoneCode").append("<option value='' selected='selected'>Code</option>"); 1195 var arrCode = []; 1196 for (var prop in _areanoList){ 1197 arrCode.push(_areanoList[prop]); 1198 $("select.phoneCode").append("<option value='"+_areanoList[prop]+"'>"+_areanoList[prop]+"</option>"); 1199 } 1200 var new_arrCode=[]; 1201 for(var i=0;i<arrCode.length;i++) { 1202 var items=arrCode[i]; 1203 if($.inArray(items,new_arrCode)==-1) { 1204 new_arrCode.push(items); 1205 } 1206 } 1207 $.each(new_arrCode,function(index,val){ 1208 1209 $("select.phoneCode").append("<option value='"+val+"'>"+val+"</option>"); 1210 }); 1211 1212 1213 1214 // å çå½å龿¥æ¯å¦æç¸å ³åæ°ï¼æåæ´æ°ï¼æ åè·³è¿ 1215 if(hasUrlUtm()){ 1216 utmParam(); 1217 }else if(getCookie("lsm")){//å½å龿¥æ²¡æç¸å ³åæ°ï¼çä¸ä¸ä¹åææ²¡æåè¿å¯¹åºcookie 1218 // ä¹ååå¨è¿ï¼å·æ°å½ååå¨çcookie卿 1219 g_lsm = getCookie("lsm"); 1220 setCookie("ls",getCookie("ls"),15); 1221 setCookie("lsm",getCookie("lsm"),90); 1222 }else if (getCookie("ls") && !(getCookie("lsm"))) { 1223 utmParam(); 1224 }else{//ä¹å没ææå¼è¿å¯¹åºé¾æ¥ 1225 g_lsm = ""; 1226 } 1227 1228 handleLsCookie(); 1229 1230 const par_has_val_list = [ 1231 { paramsName: 'am', cookieName: 'am', cookieTime: 15 }, 1232 { paramsName: 'bta', cookieName: 'bta', cookieTime: 15 }, 1233 { paramsName: 'irclickid', cookieName: 'irclickid', cookieTime: 15 }, 1234 { paramsName: 'track', cookieName: 'track', cookieTime: 15 }, 1235 { paramsName: 'utm_campaign', cookieName: 'utm_campaign', cookieTime: 15 }, 1236 { paramsName: 'gclid', cookieName: 'gclid', cookieTime: 15 }, 1237 { paramsName: 'subID', cookieName: 'subid', cookieTime: 1 }, 1238 { paramsName: 'referredby', cookieName: 'referredby', cookieTime: 15 }, 1239 { paramsName: 'platform', cookieName: 'platform', cookieTime: null }, 1240 { paramsName: 'sub1', cookieName: 'sub1', cookieTime: null }, 1241 { paramsName: 'autoCertification', cookieName: 'autoCertification', cookieTime: null }, 1242 { paramsName: 'groupId', cookieName: 'groupId', cookieTime:15} 1243 ] 1244 1245 setCookieParHasVal(par_has_val_list); 1246 1247 function setAffid(){ 1248 setCookie("affid", g_affid, 15); 1249 setCookie("campaignsource", "", 15); 1250 if(g_utm_campaign){ 1251 if (g_utm_campaign == '%22antoine%22') { 1252 setCookie("affid", "NBODQ5OTc5", 15); 1253 g_affid = 'NBODQ5OTc5'; 1254 }else if (g_utm_campaign == '%22dmitrii%22') { 1255 setCookie("affid", "NBODQ5OTc2", 15); 1256 g_affid = 'NBODQ5OTc2'; 1257 } 1258 } 1259 if (g_cpaid == "2287") { 1260 g_cpaid = ""; 1261 g_cxd = ""; 1262 } 1263 } 1264 1265 function setCxd(){ 1266 setCookie("cxd", g_cxd, 15); 1267 let cpaids = g_cxd; 1268 let cpaids1 = cpaids.split("_"); 1269 g_cpaid = cpaids1[0]; 1270 setCookie("cpaid", cpaids1[0], 15); 1271 } 1272 1273 1274 1275 g_c = getPar("c"); 1276 g_cxd = getParameterValue('cxd'); 1277 g_cpaid = getParameterValue('cpaid'); 1278 g_affid = getParameterValue('affid'); 1279 g_irclickid = getPar('irclickid'); 1280 g_cs = getPar("cs"); 1281 g_ls = getParameterValue('ls'); 1282 if(g_c || g_irclickid){ 1283 g_c = getParameterValue('c'); 1284 if (g_c) { 1285 // When there is a parameter c, clear other parameter 1286 setCookie("c", g_c, 15); 1287 setCookie("cpaid", "", 15); 1288 setCookie("cxd", "", 15); 1289 setCookie("affid", "", 15); 1290 // Clear variables 1291 g_affid = ''; 1292 g_cpaid = ''; 1293 g_cxd = ''; 1294 } 1295 g_cs = getParameterValue('cs')||getCookie('campaignsource')||''; 1296 if (g_cs) { 1297 // Processing CS parameters 1298 setCookie("campaignsource", g_cs, 15); 1299 setCookie("affid", "", 15); 1300 // affid Clear Affid 1301 g_affid = ''; 1302 } 1303 g_irclickid = getParameterValue('irclickid'); 1304 if(g_irclickid) { 1305 setCookie("irclickid", g_irclickid, 15); 1306 setCookie("cxd", "", 15); 1307 setCookie("cpaid", "200000", 15); 1308 setCookie("affid", "", 15); 1309 g_affid = ''; 1310 g_cxd = ''; 1311 g_cpaid = '200000'; 1312 } 1313 } 1314 else{ 1315 1316 let affidUrl = getPar('affid'); 1317 let cxdUrl = getPar('cxd'); 1318 1319 if(affidUrl && cxdUrl){ 1320 //Clear c And irclickid 1321 g_c = ''; 1322 g_irclickid = ''; 1323 setCookie("c", "", 15); 1324 setCookie("irclickid", "" , 15); 1325 // Processing CXD parameters 1326 setCxd(); 1327 if(g_cs){ 1328 g_affid = '';
1329 setCookie("campaignsource", g_cs, 15); 1330 setCookie("affid", "", 15); 1331 }else{ 1332 // Processing affid parameters 1333 setAffid(); 1334 } 1335 }else if(affidUrl || cxdUrl){ 1336 g_c = ''; 1337 g_irclickid = ''; 1338 setCookie("c", "", 15); 1339 setCookie("irclickid", "" , 15); 1340 if(cxdUrl){ 1341 //Clear affid 1342 g_affid = ''; 1343 setCookie("affid", "", 15); 1344 // Processing CXD parameters 1345 setCxd(); 1346 }else if(affidUrl){ 1347 if(!g_cs){ 1348 //Clear cxd And cpaid 1349 setCookie("cpaid", "", 15); 1350 setCookie("cxd", "", 15); 1351 g_cpaid = ''; 1352 g_cxd = ''; 1353 // Processing affid parameters 1354 setAffid(); 1355 }else{ 1356 g_affid = ''; 1357 setCookie("campaignsource", g_cs, 15); 1358 setCookie("affid", "", 15); 1359 } 1360 } 1361 }else if(g_cs){ 1362 g_affid = ''; 1363 setCookie("campaignsource", g_cs, 15); 1364 setCookie("affid", "", 15); 1365 } 1366 } 1367 // Get Wid 1368 g_wid = getWidValue(); 1369 1370 if(g_affid !="" && g_affid != null && g_affid != "null" && g_affid != "undefined" && g_affid != undefined){ 1371 $.ajax({ 1372 url: "/data/affid_verify_sso.php", 1373 type: "post", 1374 data: { 1375 affid: g_affid, 1376 }, 1377 success: function(data) { 1378 if(data=="true" && window.location.href.indexOf("404") == -1){ 1379 window.location.href = "/404"; 1380 } 1381 }, 1382 error: function(data) { 1383 console.log(data); 1384 } 1385 }); 1386 } 1387 const platform = getParameterValue('platform'); 1388 const sub1 = getParameterValue("sub1"); 1389 const autoCertification = getParameterValue("autoCertification"); 1390 let deepLinkArr={}; 1391 let deepLinkString=''; 1392 if(platform){ 1393 deepLinkArr['platform']=platform; 1394 } 1395 if(sub1){ 1396 deepLinkArr['sub1']=sub1; 1397 } 1398 if(autoCertification){ 1399 deepLinkArr['autoCertification']=autoCertification; 1400 } 1401 1402 if (Object.keys(deepLinkArr).length > 0) { 1403 const params = []; 1404 for (const key in deepLinkArr) { 1405 params.push(`${key}=${deepLinkArr[key]}`); 1406 } 1407 deepLinkString = '?' + params.join('&'); 1408 } 1409 $('a').each(function() { 1410 const href = $(this).attr('href'); 1411 if (href && href.includes('myaccount')) { 1412 let endDeepLinkString=''; 1413 if(href.includes('?')&&deepLinkString.split('?')[1]){ 1414 endDeepLinkString=deepLinkString+'&'+href.split('?')[1]; 1415 }else if(href.includes('?')){ 1416 endDeepLinkString='?'+href.split('?')[1]; 1417 }else if(deepLinkString.split('?')[1]){ 1418 endDeepLinkString=deepLinkString; 1419 } 1420 $(this).attr('href', $($(this)).attr('href')+endDeepLinkString); 1421 } 1422 }); 1423 1424 //Specific ibs prohibit link account opening 1425 if(g_affid == "80660" || g_affid == "80656" || g_affid == "80414" || g_affid == "80413" || g_affid == "80903" || g_affid == "80902" || g_affid == "62472" || g_affid == "62039" || g_affid == "62040" || g_affid == "87347" || g_affid == "86506" || g_affid == "86136" || g_affid == "62938" || g_affid == "62937" || g_affid == "62854" || g_affid == "NBMzk4NzA0"){ 1426 $("a[href='/forex-trading-account/']").attr("href" , "/"); 1427 $("a[href='/forex-trading-account']").attr("href" , "/"); 1428 $("a[href='/demo-account/']").attr("href" , "/"); 1429 $("a[href='/demo-account']").attr("href" , "/"); 1430 $(".top_live_form #button").attr("disabled", true).addClass('disable') 1431 $(".open_demo_account_form #button").attr("disabled", true).css("cursor","not-allowed"); 1432 $('.register_container .submit_button').css("cursor","not-allowed"); 1433 $('.register_container .submit_button a').css("pointer-events","none"); 1434 } 1435 $("#affid").val(g_affid); 1436 $("#cpaid").val(g_cpaid); 1437 $("#wid").val(g_wid); 1438 $("#cxd").val(g_cxd); 1439 $("#ls").val(g_ls); 1440 1441 //landing page:lpen/lpen/ 1442 $(".top_live_form #affid").val(g_affid); 1443 $(".top_live_form #cpaid").val(g_cpaid); 1444 $(".top_live_form #wid").val(g_wid); 1445 $(".top_live_form #cxd").val(g_cxd); 1446 $(".top_live_form #ls").val(g_lsm); 1447 1448 1449 $(".demo_account_form #affid").val(g_affid); 1450 $(".demo_account_form #cpaid").val(g_cpaid); 1451 $(".demo_account_form #wid").val(g_wid); 1452 $(".demo_account_form #cxd").val(g_cxd); 1453 $(".demo_account_form #ls").val(g_lsm); 1454 1455 //landing page:lpen/lpen/ 1456 1457 1458}) 1459// ! puprimecom|2026-09-24 16:20:40 !
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.