Skip to content

Commit c304e1e

Browse files
author
shengyonggen
committed
Release 1.18.9
1 parent c192b5b commit c304e1e

14 files changed

+174
-153
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.18.9 (2021-7-27)
2+
1. 优化
3+
- 优化 `profile_set_once` 的触发时机
14
## 1.18.8 (2021-7-23)
25
1. 新增
36
- 新增百度搜索关键词采集功能

core/sensorsdata.amd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/sensorsdata.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/sensorsdata.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

heatmap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sa-sdk-javascript",
3-
"version": "1.18.8",
3+
"version": "1.18.9",
44
"description": "official sensorsdata javascript sdk",
55
"main": "sensorsdata.min.js",
66
"scripts": {

product/heatmap.full.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9405,7 +9405,7 @@
94059405

94069406
window.sa_jssdk_heatmap_render = function(se, data, type, url) {
94079407
sd = se;
9408-
sd.heatmap_version = '1.18.8';
9408+
sd.heatmap_version = '1.18.9';
94099409
_ = sd._;
94109410

94119411
_.bindReady = function(fn, win) {

product/sensorsdata.amd.full.js

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,7 @@
34473447

34483448
sd.setInitVar = function() {
34493449
sd._t = sd._t || 1 * new Date();
3450-
sd.lib_version = '1.18.8';
3450+
sd.lib_version = '1.18.9';
34513451
sd.is_first_visitor = false;
34523452
sd.source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
34533453
};
@@ -3672,8 +3672,6 @@
36723672
}
36733673
para = _.isObject(para) ? para : {};
36743674

3675-
para = _.isObject(para) ? para : {};
3676-
36773675
function getUtm() {
36783676
var utms = _.info.campaignParams();
36793677
var $utms = {};
@@ -3687,29 +3685,7 @@
36873685
return $utms;
36883686
}
36893687

3690-
if (sd.is_first_visitor && !para.not_set_profile) {
3691-
var eqidObj = {};
3692-
3693-
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
3694-
eqidObj['$search_keyword_id'] = _.getBaiduKeyword.id();
3695-
eqidObj['$search_keyword_id_type'] = _.getBaiduKeyword.type();
3696-
eqidObj['$search_keyword_id_hash'] = _.hashCode(eqidObj['$search_keyword_id']);
3697-
}
3698-
3699-
sd.setOnceProfile(
3700-
_.extend({
3701-
$first_visit_time: new Date(),
3702-
$first_referrer: _.isDecodeURI(sd.para.url_is_decode, _.getReferrer()),
3703-
$first_browser_language: navigator.language || '取值异常',
3704-
$first_browser_charset: typeof document.charset === 'string' ? document.charset.toUpperCase() : '取值异常',
3705-
$first_traffic_source_type: _.getSourceFromReferrer(),
3706-
$first_search_keyword: _.getKeywordFromReferrer()
3707-
},
3708-
getUtm(), eqidObj
3709-
)
3710-
);
3711-
sd.is_first_visitor = false;
3712-
}
3688+
var is_set_profile = !para.not_set_profile;
37133689
if (para.not_set_profile) {
37143690
delete para.not_set_profile;
37153691
}
@@ -3732,26 +3708,8 @@
37323708
}
37333709
closure(para, callback);
37343710
this.autoTrackSinglePage = closure;
3735-
},
3736-
autoTrackWithoutProfile: function(para, callback) {
3737-
para = _.isObject(para) ? para : {};
3738-
this.autoTrack(_.extend(para, {
3739-
not_set_profile: true
3740-
}), callback);
3741-
},
3742-
autoTrack: function(para, callback) {
3743-
para = _.isObject(para) ? para : {};
37443711

3745-
var utms = _.info.campaignParams();
3746-
var $utms = {};
3747-
_.each(utms, function(v, i, utms) {
3748-
if ((' ' + sd.source_channel_standard + ' ').indexOf(' ' + i + ' ') !== -1) {
3749-
$utms['$' + i] = utms[i];
3750-
} else {
3751-
$utms[i] = utms[i];
3752-
}
3753-
});
3754-
if (sd.is_first_visitor && !para.not_set_profile) {
3712+
if (sd.is_first_visitor && is_set_profile) {
37553713
var eqidObj = {};
37563714

37573715
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
@@ -3769,12 +3727,34 @@
37693727
$first_traffic_source_type: _.getSourceFromReferrer(),
37703728
$first_search_keyword: _.getKeywordFromReferrer()
37713729
},
3772-
$utms, eqidObj
3730+
getUtm(), eqidObj
37733731
)
37743732
);
3733+
37753734
sd.is_first_visitor = false;
37763735
}
37773736

3737+
},
3738+
autoTrackWithoutProfile: function(para, callback) {
3739+
para = _.isObject(para) ? para : {};
3740+
this.autoTrack(_.extend(para, {
3741+
not_set_profile: true
3742+
}), callback);
3743+
},
3744+
autoTrack: function(para, callback) {
3745+
para = _.isObject(para) ? para : {};
3746+
3747+
var utms = _.info.campaignParams();
3748+
var $utms = {};
3749+
_.each(utms, function(v, i, utms) {
3750+
if ((' ' + sd.source_channel_standard + ' ').indexOf(' ' + i + ' ') !== -1) {
3751+
$utms['$' + i] = utms[i];
3752+
} else {
3753+
$utms[i] = utms[i];
3754+
}
3755+
});
3756+
3757+
var is_set_profile = !para.not_set_profile;
37783758
if (para.not_set_profile) {
37793759
delete para.not_set_profile;
37803760
}
@@ -3813,6 +3793,32 @@
38133793
),
38143794
callback
38153795
);
3796+
3797+
if (sd.is_first_visitor && is_set_profile) {
3798+
var eqidObj = {};
3799+
3800+
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
3801+
eqidObj['$search_keyword_id'] = _.getBaiduKeyword.id();
3802+
eqidObj['$search_keyword_id_type'] = _.getBaiduKeyword.type();
3803+
eqidObj['$search_keyword_id_hash'] = _.hashCode(eqidObj['$search_keyword_id']);
3804+
}
3805+
3806+
sd.setOnceProfile(
3807+
_.extend({
3808+
$first_visit_time: new Date(),
3809+
$first_referrer: _.isDecodeURI(sd.para.url_is_decode, _.getReferrer()),
3810+
$first_browser_language: navigator.language || '取值异常',
3811+
$first_browser_charset: typeof document.charset === 'string' ? document.charset.toUpperCase() : '取值异常',
3812+
$first_traffic_source_type: _.getSourceFromReferrer(),
3813+
$first_search_keyword: _.getKeywordFromReferrer()
3814+
},
3815+
$utms, eqidObj
3816+
)
3817+
);
3818+
3819+
sd.is_first_visitor = false;
3820+
}
3821+
38163822
this.autoTrackIsUsed = true;
38173823
},
38183824
getAnonymousID: function() {
@@ -4369,7 +4375,7 @@
43694375
source: 'sa-web-sdk',
43704376
type: 'v-is-vtrack',
43714377
data: {
4372-
sdkversion: '1.18.8'
4378+
sdkversion: '1.18.9'
43734379
}
43744380
},
43754381
'*'

product/sensorsdata.es6.full.js

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3441,7 +3441,7 @@ sd.setPreConfig = function(sa) {
34413441

34423442
sd.setInitVar = function() {
34433443
sd._t = sd._t || 1 * new Date();
3444-
sd.lib_version = '1.18.8';
3444+
sd.lib_version = '1.18.9';
34453445
sd.is_first_visitor = false;
34463446
sd.source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
34473447
};
@@ -3666,8 +3666,6 @@ var commonWays = {
36663666
}
36673667
para = _.isObject(para) ? para : {};
36683668

3669-
para = _.isObject(para) ? para : {};
3670-
36713669
function getUtm() {
36723670
var utms = _.info.campaignParams();
36733671
var $utms = {};
@@ -3681,29 +3679,7 @@ var commonWays = {
36813679
return $utms;
36823680
}
36833681

3684-
if (sd.is_first_visitor && !para.not_set_profile) {
3685-
var eqidObj = {};
3686-
3687-
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
3688-
eqidObj['$search_keyword_id'] = _.getBaiduKeyword.id();
3689-
eqidObj['$search_keyword_id_type'] = _.getBaiduKeyword.type();
3690-
eqidObj['$search_keyword_id_hash'] = _.hashCode(eqidObj['$search_keyword_id']);
3691-
}
3692-
3693-
sd.setOnceProfile(
3694-
_.extend({
3695-
$first_visit_time: new Date(),
3696-
$first_referrer: _.isDecodeURI(sd.para.url_is_decode, _.getReferrer()),
3697-
$first_browser_language: navigator.language || '取值异常',
3698-
$first_browser_charset: typeof document.charset === 'string' ? document.charset.toUpperCase() : '取值异常',
3699-
$first_traffic_source_type: _.getSourceFromReferrer(),
3700-
$first_search_keyword: _.getKeywordFromReferrer()
3701-
},
3702-
getUtm(), eqidObj
3703-
)
3704-
);
3705-
sd.is_first_visitor = false;
3706-
}
3682+
var is_set_profile = !para.not_set_profile;
37073683
if (para.not_set_profile) {
37083684
delete para.not_set_profile;
37093685
}
@@ -3726,26 +3702,8 @@ var commonWays = {
37263702
}
37273703
closure(para, callback);
37283704
this.autoTrackSinglePage = closure;
3729-
},
3730-
autoTrackWithoutProfile: function(para, callback) {
3731-
para = _.isObject(para) ? para : {};
3732-
this.autoTrack(_.extend(para, {
3733-
not_set_profile: true
3734-
}), callback);
3735-
},
3736-
autoTrack: function(para, callback) {
3737-
para = _.isObject(para) ? para : {};
37383705

3739-
var utms = _.info.campaignParams();
3740-
var $utms = {};
3741-
_.each(utms, function(v, i, utms) {
3742-
if ((' ' + sd.source_channel_standard + ' ').indexOf(' ' + i + ' ') !== -1) {
3743-
$utms['$' + i] = utms[i];
3744-
} else {
3745-
$utms[i] = utms[i];
3746-
}
3747-
});
3748-
if (sd.is_first_visitor && !para.not_set_profile) {
3706+
if (sd.is_first_visitor && is_set_profile) {
37493707
var eqidObj = {};
37503708

37513709
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
@@ -3763,12 +3721,34 @@ var commonWays = {
37633721
$first_traffic_source_type: _.getSourceFromReferrer(),
37643722
$first_search_keyword: _.getKeywordFromReferrer()
37653723
},
3766-
$utms, eqidObj
3724+
getUtm(), eqidObj
37673725
)
37683726
);
3727+
37693728
sd.is_first_visitor = false;
37703729
}
37713730

3731+
},
3732+
autoTrackWithoutProfile: function(para, callback) {
3733+
para = _.isObject(para) ? para : {};
3734+
this.autoTrack(_.extend(para, {
3735+
not_set_profile: true
3736+
}), callback);
3737+
},
3738+
autoTrack: function(para, callback) {
3739+
para = _.isObject(para) ? para : {};
3740+
3741+
var utms = _.info.campaignParams();
3742+
var $utms = {};
3743+
_.each(utms, function(v, i, utms) {
3744+
if ((' ' + sd.source_channel_standard + ' ').indexOf(' ' + i + ' ') !== -1) {
3745+
$utms['$' + i] = utms[i];
3746+
} else {
3747+
$utms[i] = utms[i];
3748+
}
3749+
});
3750+
3751+
var is_set_profile = !para.not_set_profile;
37723752
if (para.not_set_profile) {
37733753
delete para.not_set_profile;
37743754
}
@@ -3807,6 +3787,32 @@ var commonWays = {
38073787
),
38083788
callback
38093789
);
3790+
3791+
if (sd.is_first_visitor && is_set_profile) {
3792+
var eqidObj = {};
3793+
3794+
if (sd.para.preset_properties.search_keyword_baidu && _.isReferralTraffic(document.referrer) && _.isBaiduTraffic()) {
3795+
eqidObj['$search_keyword_id'] = _.getBaiduKeyword.id();
3796+
eqidObj['$search_keyword_id_type'] = _.getBaiduKeyword.type();
3797+
eqidObj['$search_keyword_id_hash'] = _.hashCode(eqidObj['$search_keyword_id']);
3798+
}
3799+
3800+
sd.setOnceProfile(
3801+
_.extend({
3802+
$first_visit_time: new Date(),
3803+
$first_referrer: _.isDecodeURI(sd.para.url_is_decode, _.getReferrer()),
3804+
$first_browser_language: navigator.language || '取值异常',
3805+
$first_browser_charset: typeof document.charset === 'string' ? document.charset.toUpperCase() : '取值异常',
3806+
$first_traffic_source_type: _.getSourceFromReferrer(),
3807+
$first_search_keyword: _.getKeywordFromReferrer()
3808+
},
3809+
$utms, eqidObj
3810+
)
3811+
);
3812+
3813+
sd.is_first_visitor = false;
3814+
}
3815+
38103816
this.autoTrackIsUsed = true;
38113817
},
38123818
getAnonymousID: function() {
@@ -4363,7 +4369,7 @@ sd.detectMode = function() {
43634369
source: 'sa-web-sdk',
43644370
type: 'v-is-vtrack',
43654371
data: {
4366-
sdkversion: '1.18.8'
4372+
sdkversion: '1.18.9'
43674373
}
43684374
},
43694375
'*'

0 commit comments

Comments
 (0)