(function(){
try {
setTimeout(function(){
var tm0 = new taskManager(25);
var tm0_sleep = [];
var $body = '';
var _site = '';
var name = '';
var currency = '';
var b2b_ip_country = '';
var ref_f = '';
var vid = '';
var b2b_buyerid = '';
var _currency = '';
var spmB = '';
tm0_sleep.push(function () {
$body = $('body');
_site = window.location.host.match(/^(?:m\.)?(\w{2})(?:\.local)?\.dhgate\.com$/i);
name = 'en';
currency = $.cookie('intl_currency');
b2b_ip_country = $.cookie('b2b_ip_country')||'';
ref_f = (window.__DH_TC__ && window.__DH_TC__.f) || '';
vid = $.cookie('vid')||'';
b2b_buyerid = $.cookie('b2b_buyerid')||'';
spmB = $body.attr('spm-b')||'other';
if ($.__formatPrice) {
_currency = $.__formatPrice({}).currency;
}
try {
ref_f = decodeURIComponent(ref_f);
} catch(e) {
ref_f = '';
}
});
tm0_sleep.push(function () {
if (_site && _site.length > 0) {
name = _site[1].toLocaleLowerCase();
}
if (_currency) {
currency = _currency;
}
window.__FB_ENTITY_EVENT_ID__ = window.__FB_ENTITY_EVENT_ID__ || "facebook" + "-" + new Date().getTime() + "-" + Math.random().toString(16).substr(2);
setTimeout(function(){
window.dataLayer = window.dataLayer||[];
dataLayer.push({
event: "dle_pageLoad",
dlv_ipCountry: b2b_ip_country,
dlv_platform: 'wap',
dlv_pageGroup: spmB,
dlv_pLocation: '',
dlv_pagePath: '',
dlv_fCode:ref_f,
dlv_vid: vid,
dlv_uid: b2b_buyerid,
dlv_email: '',
dlv_sha256_email: '',
dlv_currency: currency||'',
dlv_language: name,
dlv_fbeventid: window.__FB_ENTITY_EVENT_ID__,
});
}, 1);
});
tm0.add(tm0_sleep).start(50);
}, 10);
} catch (e) {
console.error(e);
}
}());
(function(){
window.__DH_COMMON_GTM__ = '1';
try {
if (window.navigator && window.navigator.connection) {
var __wwwUrl = location.hostname.match(/(es|pt|ru|fr|de|it|tr|hk|mx|cl|pe|co|kr|ar|nl|pl|jp|se|ie)\..+/i) || 'en';
var countryCur = $.isArray(__wwwUrl) ? __wwwUrl[1].replace(/mx|cl|pe|co/, 'es') : __wwwUrl;
var $div = $('
');
var $img = $('
![]()
');
var $body = $('body');
var info = [];
var url = 'https://app.dhgate.com/mobileApiWeb/biz-FeedBack-log.do';
var connectionObj = window.navigator.connection;
if (connectionObj.saveData === true
|| /2g|3g/i.test(connectionObj.effectiveType)
|| connectionObj.rtt > 100
) {
window.__DH_COMMON_GTM__ = '0';
info.push('connection:gtm');
info.push('effectiveType:'+connectionObj.effectiveType);
info.push('rtt:'+connectionObj.rtt);
info.push('saveData:'+connectionObj.saveData);
//确保HTML不会在页面上展示
$div.css({
display: 'none'
});
//设置日志图片属性
$img.css({
width: 1,
height: 1,
borderStyle: 'none'
}).attr({
src: url+'?client=wap&language='+countryCur+'&v='+JSON.stringify(info.join(';'))
});
//发送日志数据
$body.append($div.append($img));
} else if ((connectionObj.saveData === false
&& /4g/i.test(connectionObj.effectiveType)
&& connectionObj.rtt === 0
&& window.navigator.hardwareConcurrency > 12)
|| (window.DHDETAIL&&window.DHDETAIL.data&&window.DHDETAIL.data._lighthouse==='pagespeed')
) {
window.__DH_COMMON_GTM__ = '0';
info.push('connection:gtm_lh');
info.push('effectiveType:'+connectionObj.effectiveType);
info.push('rtt:'+connectionObj.rtt);
info.push('saveData:'+connectionObj.saveData);
//确保HTML不会在页面上展示
$div.css({
display: 'none'
});
//设置日志图片属性
$img.css({
width: 1,
height: 1,
borderStyle: 'none'
}).attr({
src: url+'?client=wap&language='+countryCur+'&v='+JSON.stringify(info.join(';'))
});
//发送日志数据
$body.append($div.append($img));
}
if (connectionObj.saveData === false
&& /4g/i.test(connectionObj.effectiveType)
&& connectionObj.rtt === 0
) {
info.push('connection:guess');
info.push('effectiveType:'+connectionObj.effectiveType);
info.push('rtt:'+connectionObj.rtt);
info.push('saveData:'+connectionObj.saveData);
info.push('hardwareConcurrency:'+window.navigator.hardwareConcurrency);
//确保HTML不会在页面上展示
$div.css({
display: 'none'
});
//设置日志图片属性
$img.css({
width: 1,
height: 1,
borderStyle: 'none'
}).attr({
src: url+'?client=wap&language='+countryCur+'&v='+JSON.stringify(info.join(';'))
});
//发送日志数据
$body.append($div.append($img));
}
}
} catch (e) {
console.error(e);
}
}());