Skip to content

Commit 9e8ea69

Browse files
author
shengyonggen
committed
全埋点测试代码
1 parent 303bf04 commit 9e8ea69

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

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.

src/sdk.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,32 +1622,32 @@ saEvent.send = function(p, callback) {
16221622
if(' button a input '.indexOf(' '+ tagName + ' ') !== -1 ){
16231623
if(tagName === 'input'){
16241624
if(target.getAttribute('type') === 'button' || target.getAttribute('type') === 'submit'){
1625-
props.$el_value = target.value;
1625+
props._el_value = target.value;
16261626
}else{
16271627
return false;
16281628
}
16291629
}
16301630

1631-
props.$el_tagName = tagName;
1632-
props.$el_name = target.getAttribute('name');
1633-
props.$el_id = target.getAttribute('id');
1634-
props.$el_className = typeof target.className === 'string' ? target.className : null;
1635-
props.$el_href = target.getAttribute('href');
1631+
props._el_tagname = tagName;
1632+
props._el_name = target.getAttribute('name');
1633+
props._el_id = target.getAttribute('id');
1634+
props._el_classname = typeof target.className === 'string' ? target.className : null;
1635+
props._el_href = target.getAttribute('href');
16361636

16371637
// 获取内容
16381638
if (target.textContent) {
16391639
var textContent = _.trim(target.textContent);
16401640
if (textContent) {
16411641
textContent = textContent.replace(/[\r\n]/g, ' ').replace(/[ ]+/g, ' ').substring(0, 255);
16421642
}
1643-
props.$el_text = textContent;
1643+
props._el_value = textContent;
16441644
}
16451645
props = _.strip_empty_properties(props);
16461646

16471647
props.$url = location.href;
16481648
props.$url_path = location.pathname;
16491649

1650-
sd.track('$web_event',props);
1650+
sd.track('_web_event',props);
16511651
}
16521652
}
16531653
};

src/sensorsdata.full.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ if(typeof JSON!=='object'){JSON={}}(function(){'use strict';var rx_one=/^[\],:{}
618618
, slice = ArrayProto.slice
619619
, toString = ObjProto.toString
620620
, hasOwnProperty = ObjProto.hasOwnProperty
621-
, LIB_VERSION = '1.6.17';
621+
, LIB_VERSION = '1.6.18';
622622

623623
sd.lib_version = LIB_VERSION;
624624

@@ -2230,32 +2230,32 @@ saEvent.send = function(p, callback) {
22302230
if(' button a input '.indexOf(' '+ tagName + ' ') !== -1 ){
22312231
if(tagName === 'input'){
22322232
if(target.getAttribute('type') === 'button' || target.getAttribute('type') === 'submit'){
2233-
props.$el_value = target.value;
2233+
props._el_value = target.value;
22342234
}else{
22352235
return false;
22362236
}
22372237
}
22382238

2239-
props.$el_tagName = tagName;
2240-
props.$el_name = target.getAttribute('name');
2241-
props.$el_id = target.getAttribute('id');
2242-
props.$el_className = typeof target.className === 'string' ? target.className : null;
2243-
props.$el_href = target.getAttribute('href');
2239+
props._el_tagname = tagName;
2240+
props._el_name = target.getAttribute('name');
2241+
props._el_id = target.getAttribute('id');
2242+
props._el_classname = typeof target.className === 'string' ? target.className : null;
2243+
props._el_href = target.getAttribute('href');
22442244

22452245
// 获取内容
22462246
if (target.textContent) {
22472247
var textContent = _.trim(target.textContent);
22482248
if (textContent) {
22492249
textContent = textContent.replace(/[\r\n]/g, ' ').replace(/[ ]+/g, ' ').substring(0, 255);
22502250
}
2251-
props.$el_text = textContent;
2251+
props._el_value = textContent;
22522252
}
22532253
props = _.strip_empty_properties(props);
22542254

22552255
props.$url = location.href;
22562256
props.$url_path = location.pathname;
22572257

2258-
sd.track('$web_event',props);
2258+
sd.track('_web_event',props);
22592259
}
22602260
}
22612261
};

vtrack.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.

0 commit comments

Comments
 (0)