Skip to content

Commit c4701d6

Browse files
author
shengyonggen
committed
Release 1.17.4
1 parent c541426 commit c4701d6

14 files changed

+132
-31
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.17.4(2022-3-11)
2+
1. 新增
3+
- 支持动态配置制定页面的 `$MPPageLeave` 采集规则
4+
5+
16
## 1.17.3(2022-1-13)
27
1. 新增
38
- 支持自定义属性配置插件

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-miniprogram",
3-
"version": "1.17.3",
3+
"version": "1.17.4",
44
"description": "sensorsdata miniprogram sdk",
55
"main": "sensorsdata.min.js",
66
"scripts": {

product/sensorsdata.custom.es6.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@ sa.para = {
717717
pageLeave: false
718718
},
719719
autotrack_exclude_page: {
720-
pageShow: []
720+
pageShow: [],
721+
pageLeave: []
721722
},
722723
is_persistent_save: {
723724
share: false,
@@ -823,13 +824,26 @@ sa.setPara = function(para) {
823824
}
824825

825826
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
827+
828+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
829+
sa.para.autotrack_exclude_page = {
830+
pageShow: [],
831+
pageLeave: []
832+
};
833+
}
834+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
835+
sa.para.autotrack_exclude_page.pageShow = [];
836+
}
837+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
838+
sa.para.autotrack_exclude_page.pageLeave = [];
839+
}
826840
};
827841

828842
sa.getServerUrl = function() {
829843
return sa.para.server_url;
830844
};
831845

832-
var LIB_VERSION = '1.17.3',
846+
var LIB_VERSION = '1.17.4',
833847
LIB_NAME = 'MiniProgram';
834848

835849
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2883,7 +2897,9 @@ _.sendPageLeave = function() {
28832897
prop.$url_path = router;
28842898
prop.$title = title;
28852899
prop.event_duration = page_stay_time;
2886-
sa.track('$MPPageLeave', prop);
2900+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
2901+
sa.track('$MPPageLeave', prop);
2902+
}
28872903
page_show_time = -1;
28882904
}
28892905
};
@@ -3061,7 +3077,7 @@ sa.autoTrackCustom = {
30613077
}
30623078
if (sa.para.onshow) {
30633079
sa.para.onshow(sa, router, this);
3064-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3080+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
30653081
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
30663082
}
30673083
},

product/sensorsdata.custom.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,8 @@ sa.para = {
720720
pageLeave: false
721721
},
722722
autotrack_exclude_page: {
723-
pageShow: []
723+
pageShow: [],
724+
pageLeave: []
724725
},
725726
is_persistent_save: {
726727
share: false,
@@ -826,13 +827,26 @@ sa.setPara = function(para) {
826827
}
827828

828829
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
830+
831+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
832+
sa.para.autotrack_exclude_page = {
833+
pageShow: [],
834+
pageLeave: []
835+
};
836+
}
837+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
838+
sa.para.autotrack_exclude_page.pageShow = [];
839+
}
840+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
841+
sa.para.autotrack_exclude_page.pageLeave = [];
842+
}
829843
};
830844

831845
sa.getServerUrl = function() {
832846
return sa.para.server_url;
833847
};
834848

835-
var LIB_VERSION = '1.17.3',
849+
var LIB_VERSION = '1.17.4',
836850
LIB_NAME = 'MiniProgram';
837851

838852
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -2886,7 +2900,9 @@ _.sendPageLeave = function() {
28862900
prop.$url_path = router;
28872901
prop.$title = title;
28882902
prop.event_duration = page_stay_time;
2889-
sa.track('$MPPageLeave', prop);
2903+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
2904+
sa.track('$MPPageLeave', prop);
2905+
}
28902906
page_show_time = -1;
28912907
}
28922908
};
@@ -3064,7 +3080,7 @@ sa.autoTrackCustom = {
30643080
}
30653081
if (sa.para.onshow) {
30663082
sa.para.onshow(sa, router, this);
3067-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3083+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
30683084
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
30693085
}
30703086
},

product/sensorsdata.es6.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,8 @@ sa.para = {
929929
pageLeave: false
930930
},
931931
autotrack_exclude_page: {
932-
pageShow: []
932+
pageShow: [],
933+
pageLeave: []
933934
},
934935
is_persistent_save: {
935936
share: false,
@@ -1035,13 +1036,26 @@ sa.setPara = function(para) {
10351036
}
10361037

10371038
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
1039+
1040+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
1041+
sa.para.autotrack_exclude_page = {
1042+
pageShow: [],
1043+
pageLeave: []
1044+
};
1045+
}
1046+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
1047+
sa.para.autotrack_exclude_page.pageShow = [];
1048+
}
1049+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
1050+
sa.para.autotrack_exclude_page.pageLeave = [];
1051+
}
10381052
};
10391053

10401054
sa.getServerUrl = function() {
10411055
return sa.para.server_url;
10421056
};
10431057

1044-
var LIB_VERSION = '1.17.3',
1058+
var LIB_VERSION = '1.17.4',
10451059
LIB_NAME = 'MiniProgram';
10461060

10471061
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -3095,7 +3109,9 @@ _.sendPageLeave = function() {
30953109
prop.$url_path = router;
30963110
prop.$title = title;
30973111
prop.event_duration = page_stay_time;
3098-
sa.track('$MPPageLeave', prop);
3112+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
3113+
sa.track('$MPPageLeave', prop);
3114+
}
30993115
page_show_time = -1;
31003116
}
31013117
};
@@ -3273,7 +3289,7 @@ sa.autoTrackCustom = {
32733289
}
32743290
if (sa.para.onshow) {
32753291
sa.para.onshow(sa, router, this);
3276-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3292+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
32773293
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
32783294
}
32793295
},

product/sensorsdata.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,8 @@ sa.para = {
932932
pageLeave: false
933933
},
934934
autotrack_exclude_page: {
935-
pageShow: []
935+
pageShow: [],
936+
pageLeave: []
936937
},
937938
is_persistent_save: {
938939
share: false,
@@ -1038,13 +1039,26 @@ sa.setPara = function(para) {
10381039
}
10391040

10401041
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
1042+
1043+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
1044+
sa.para.autotrack_exclude_page = {
1045+
pageShow: [],
1046+
pageLeave: []
1047+
};
1048+
}
1049+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
1050+
sa.para.autotrack_exclude_page.pageShow = [];
1051+
}
1052+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
1053+
sa.para.autotrack_exclude_page.pageLeave = [];
1054+
}
10411055
};
10421056

10431057
sa.getServerUrl = function() {
10441058
return sa.para.server_url;
10451059
};
10461060

1047-
var LIB_VERSION = '1.17.3',
1061+
var LIB_VERSION = '1.17.4',
10481062
LIB_NAME = 'MiniProgram';
10491063

10501064
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -3098,7 +3112,9 @@ _.sendPageLeave = function() {
30983112
prop.$url_path = router;
30993113
prop.$title = title;
31003114
prop.event_duration = page_stay_time;
3101-
sa.track('$MPPageLeave', prop);
3115+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
3116+
sa.track('$MPPageLeave', prop);
3117+
}
31023118
page_show_time = -1;
31033119
}
31043120
};
@@ -3276,7 +3292,7 @@ sa.autoTrackCustom = {
32763292
}
32773293
if (sa.para.onshow) {
32783294
sa.para.onshow(sa, router, this);
3279-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3295+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
32803296
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
32813297
}
32823298
},

product/sensorsdata.plugin.es6.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,8 @@ sa.para = {
926926
pageLeave: false
927927
},
928928
autotrack_exclude_page: {
929-
pageShow: []
929+
pageShow: [],
930+
pageLeave: []
930931
},
931932
is_persistent_save: {
932933
share: false,
@@ -1032,13 +1033,26 @@ sa.setPara = function(para) {
10321033
}
10331034

10341035
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
1036+
1037+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
1038+
sa.para.autotrack_exclude_page = {
1039+
pageShow: [],
1040+
pageLeave: []
1041+
};
1042+
}
1043+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
1044+
sa.para.autotrack_exclude_page.pageShow = [];
1045+
}
1046+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
1047+
sa.para.autotrack_exclude_page.pageLeave = [];
1048+
}
10351049
};
10361050

10371051
sa.getServerUrl = function() {
10381052
return sa.para.server_url;
10391053
};
10401054

1041-
var LIB_VERSION = '1.17.3',
1055+
var LIB_VERSION = '1.17.4',
10421056
LIB_NAME = 'MiniProgram';
10431057

10441058
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -3092,7 +3106,9 @@ _.sendPageLeave = function() {
30923106
prop.$url_path = router;
30933107
prop.$title = title;
30943108
prop.event_duration = page_stay_time;
3095-
sa.track('$MPPageLeave', prop);
3109+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
3110+
sa.track('$MPPageLeave', prop);
3111+
}
30963112
page_show_time = -1;
30973113
}
30983114
};
@@ -3270,7 +3286,7 @@ sa.autoTrackCustom = {
32703286
}
32713287
if (sa.para.onshow) {
32723288
sa.para.onshow(sa, router, this);
3273-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3289+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
32743290
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
32753291
}
32763292
},

product/sensorsdata.plugin.full.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,8 @@ sa.para = {
929929
pageLeave: false
930930
},
931931
autotrack_exclude_page: {
932-
pageShow: []
932+
pageShow: [],
933+
pageLeave: []
933934
},
934935
is_persistent_save: {
935936
share: false,
@@ -1035,13 +1036,26 @@ sa.setPara = function(para) {
10351036
}
10361037

10371038
sa.para.preset_properties = _.isObject(sa.para.preset_properties) ? sa.para.preset_properties : {};
1039+
1040+
if (!_.isObject(sa.para.autotrack_exclude_page)) {
1041+
sa.para.autotrack_exclude_page = {
1042+
pageShow: [],
1043+
pageLeave: []
1044+
};
1045+
}
1046+
if (!_.isArray(sa.para.autotrack_exclude_page.pageShow)) {
1047+
sa.para.autotrack_exclude_page.pageShow = [];
1048+
}
1049+
if (!_.isArray(sa.para.autotrack_exclude_page.pageLeave)) {
1050+
sa.para.autotrack_exclude_page.pageLeave = [];
1051+
}
10381052
};
10391053

10401054
sa.getServerUrl = function() {
10411055
return sa.para.server_url;
10421056
};
10431057

1044-
var LIB_VERSION = '1.17.3',
1058+
var LIB_VERSION = '1.17.4',
10451059
LIB_NAME = 'MiniProgram';
10461060

10471061
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
@@ -3095,7 +3109,9 @@ _.sendPageLeave = function() {
30953109
prop.$url_path = router;
30963110
prop.$title = title;
30973111
prop.event_duration = page_stay_time;
3098-
sa.track('$MPPageLeave', prop);
3112+
if (sa.para.autotrack_exclude_page.pageLeave.indexOf(router) === -1) {
3113+
sa.track('$MPPageLeave', prop);
3114+
}
30993115
page_show_time = -1;
31003116
}
31013117
};
@@ -3273,7 +3289,7 @@ sa.autoTrackCustom = {
32733289
}
32743290
if (sa.para.onshow) {
32753291
sa.para.onshow(sa, router, this);
3276-
} else if (!(_.isObject(sa.para.autotrack_exclude_page) && _.isArray(sa.para.autotrack_exclude_page.pageShow) && sa.para.autotrack_exclude_page.pageShow.indexOf(router) !== -1)) {
3292+
} else if (sa.para.autotrack_exclude_page.pageShow.indexOf(router) === -1) {
32773293
sa.autoTrackCustom.trackCustom('pageShow', prop, '$MPViewScreen');
32783294
}
32793295
},

sensorsdata.custom.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.

sensorsdata.custom.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.

0 commit comments

Comments
 (0)