Authored by 郝肖肖

潮流优选埋点APP

... ... @@ -197,8 +197,7 @@ function reMarginFooter(fixedElement) {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas');
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js', '_yas'));
(function() {
var uid = getUid();
... ... @@ -327,7 +326,8 @@ function givePoint(parameter) {
window._yas.sendCustomInfo({
op: 'YB_CHOOSE_FOR_YOU_Y',
uid: getUid(),
apf: (queryString().app_version || queryString().appVersion) ? true : false,
ts: new Date().getTime(),
param: JSON.stringify(parameter)
}, true);
}
... ...
... ... @@ -12,7 +12,13 @@ var windowHeight = $(window).height();
var scrollFn,
scrollTop,
RECPOSE,
CID;
CID,
isApp,
speckParamApp = {
udid: '',
apt: '',
sid: ''
};
require('../common');
... ... @@ -59,18 +65,22 @@ plusstar = {
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo({
op: 'YB_FASHION_TAB_C',
param: JSON.stringify({
apf: isApp,
ts: new Date().getTime(),
param: JSON.stringify($.extend(speckParamApp, {
C_ID: CID,
TAB_ID: $liDom.index() + 1
})
}))
}, true);
window._yas.sendCustomInfo({
op: 'YB_FASHION_HOME_L',
param: JSON.stringify({
apf: isApp,
ts: new Date().getTime(),
param: JSON.stringify($.extend(speckParamApp, {
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1
})
}))
}, true);
}
});
... ... @@ -107,21 +117,23 @@ plusstar = {
// 商品单击埋点
$dom = $(event.target).closest('.good-info');
index = $dom.index() + 1;
window.givePoint({
window.givePoint($.extend(speckParamApp, {
REC_POSE: RECPOSE,
PRD_ID: $dom.data('good-id'),
ORDER_CODE: '',
PRD_NUM: index % that.common.pagesize === 0 ? that.common.pagesize : index % that.common.pagesize,
ACTION_ID: 1,
page_num: Math.ceil(index / that.common.pagesize)
});
}));
} else if ($(event.target).closest('.banner-top').length > 0) {
// 头部banner楼层埋点
$dom = $(event.target).closest('li');
index = $dom.index() + 1;
window._yas.sendCustomInfo({
op: 'YB_FASHION_FLR_C',
param: JSON.stringify({
apf: isApp,
ts: new Date().getTime(),
param: JSON.stringify($.extend(speckParamApp, {
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1,
F_ID: $dom.closest('ul').data('id'),
... ... @@ -129,7 +141,7 @@ plusstar = {
F_URL: $dom.find('a').attr('href'),
F_INDEX: 1,
I_INDEX: index
})
}))
}, true);
} else if ($(event.target).closest('.speck-title-image a').length > 0) {
// 各楼层埋点
... ... @@ -138,7 +150,9 @@ plusstar = {
window._yas.sendCustomInfo({
op: 'YB_FASHION_FLR_C',
param: JSON.stringify({
apf: isApp,
ts: new Date().getTime(),
param: JSON.stringify($.extend(speckParamApp, {
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1,
F_ID: $dom.data('fid'),
... ... @@ -146,7 +160,7 @@ plusstar = {
F_URL: $domA.attr('href'),
F_INDEX: $dom.index() + 1,
I_INDEX: $domA.hasClass('more') ? 0 : ($domA.index() + 1)
})
}))
}, true);
}
});
... ... @@ -154,10 +168,12 @@ plusstar = {
// 潮流优选首页加载时
window._yas.sendCustomInfo({
op: 'YB_FASHION_HOME_L',
param: JSON.stringify({
apf: isApp,
ts: new Date().getTime(),
param: JSON.stringify($.extend(speckParamApp, {
C_ID: CID,
TAB_ID: that.ParentLiDom.index() + 1
})
}))
}, true);
},
tabNav: function(code) {
... ... @@ -171,7 +187,7 @@ plusstar = {
url: '/guang/plusstar/resources-template',
data: {
code: code,
app_version: window.queryString.app_version || window.queryString.appVersion
app_version: isApp
},
dataType: 'html',
success: function(data) {
... ... @@ -244,7 +260,7 @@ plusstar = {
timeout: 5000,
data: {
productSkn: that.common.productSkns.join(','),
app_version: window.queryString.app_version || window.queryString.appVersion,
app_version: isApp,
limit: that.common.pagesize,
page: that.common.page,
yh_channel: that.ParentLiDom.index() + 1
... ... @@ -266,14 +282,14 @@ plusstar = {
skn.push($(this).data('good-id'));
});
window.givePoint({
window.givePoint($.extend(speckParamApp, {
REC_POSE: RECPOSE,
PRD_ID: skn.join(','),
ORDER_CODE: '',
PRD_NUM: that.common.pagesize,
ACTION_ID: 0,
page_num: that.common.page++
});
}));
$('.plusstar-resources .goods').append(data);
... ... @@ -304,6 +320,16 @@ scrollFn = debounce(function() {
}, 200);
$(function() {
isApp = (window.queryString.app_version || window.queryString.appVersion) ? true : false;
if (isApp) {
speckParamApp = {
udid: window.queryString.udid || '',
apt: window.queryString.client_type || '',
sid: window.queryString.sid || '',
};
}
// 男:1,女:2,潮童:3,创意生活:4
CID = window._ChannelVary[window.cookie('_Channel')] || 1;
... ...