新增接入神策、博睿sdk
This commit is contained in:
@@ -18,6 +18,92 @@
|
|||||||
|
|
||||||
<script src="~/statics/bundles/jquery.js?v=@(HtmlUtil.JsVersion)"></script>
|
<script src="~/statics/bundles/jquery.js?v=@(HtmlUtil.JsVersion)"></script>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import { BonreeStart } from '/BonreeSDK_JS_2.5.1_min.esm';
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
const isProd = window.location.hostname.indexOf("mszq.com") > -1 && window.location.hostname.indexOf("test") === -1;
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
// 管理端 appId(生产:9efad93bf1a640079c8e5a724a6b5cdf)
|
||||||
|
// 如有测试 appId,请替换下方非生产值。
|
||||||
|
appId: isProd ? "9efad93bf1a640079c8e5a724a6b5cdf" : "9efad93bf1a640079c8e5a724a6b5cdf",
|
||||||
|
uploadAddrHttp: isProd ? "http://apm.glms.com.cn/upload/RUM/upload" : "http://test-apmweb.mszq.com:58896/RUM/upload",
|
||||||
|
uploadAddrHttps: isProd ? "https://apm.glms.com.cn/upload/RUM/upload" : "https://test-apmweb.mszq.com:58896/RUM/upload",
|
||||||
|
useXHR: true,
|
||||||
|
cycleTime: 60,
|
||||||
|
maxSize: 60,
|
||||||
|
enableWebsocket: true
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
BonreeStart(config);
|
||||||
|
window.bonreeApplyUser = function (userId, userName) {
|
||||||
|
if (!userId || !window.bonreeJsBridge) return;
|
||||||
|
window.bonreeJsBridge.setUserID(userId);
|
||||||
|
if (userName) {
|
||||||
|
window.bonreeJsBridge.setUserExtraInfo({ name: userName });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
console && console.warn && console.warn('Bonree init failed', e);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/sa-sdk-javascript@1.26.13/sensorsdata.min.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function () {
|
||||||
|
if (!window.sensors) { return; }
|
||||||
|
|
||||||
|
var isProd = window.location.hostname.indexOf("mszq.com") > -1 && window.location.hostname.indexOf("test") === -1;
|
||||||
|
var serverUrl = isProd ? "https://scdata.mszq.com/sa?project=default" : "https://scdata-test.mszq.com/sa?project=default";
|
||||||
|
|
||||||
|
sensors.init({
|
||||||
|
server_url: serverUrl,
|
||||||
|
is_track_single_page: true,
|
||||||
|
use_client_time: true,
|
||||||
|
send_type: 'beacon',
|
||||||
|
heatmap: {
|
||||||
|
clickmap: 'not_collect',
|
||||||
|
scroll_notice_map: 'not_collect'
|
||||||
|
},
|
||||||
|
batch_send: {
|
||||||
|
datasend_timeout: 6000,
|
||||||
|
send_interval: 6000,
|
||||||
|
one_send_max_length: 30
|
||||||
|
},
|
||||||
|
show_log: true
|
||||||
|
});
|
||||||
|
|
||||||
|
sensors.quick('autoTrack');
|
||||||
|
|
||||||
|
sensors.registerPage({
|
||||||
|
product_type: 'onederiv',
|
||||||
|
systemVersion: '',
|
||||||
|
techStack: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
if ('@CurUser?.UserId' && sensors.login) {
|
||||||
|
sensors.login('@CurUser.UserId');
|
||||||
|
sensors.setOnceProfile({ userId: '@CurUser.UserId', name: '@CurUser.UserName' });
|
||||||
|
if (window.bonreeApplyUser) {
|
||||||
|
window.bonreeApplyUser('@CurUser.UserId', '@CurUser.UserName');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.saTrack = function (eventName, props) {
|
||||||
|
try {
|
||||||
|
if (!window.sensors || !sensors.track) { return; }
|
||||||
|
sensors.track(eventName, props || {});
|
||||||
|
} catch (e) {
|
||||||
|
console && console.warn && console.warn('sa track error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var rootpath = '@Url.Content("~/")';
|
var rootpath = '@Url.Content("~/")';
|
||||||
var main = main || { version: "1.1" };
|
var main = main || { version: "1.1" };
|
||||||
@@ -194,6 +280,9 @@
|
|||||||
if (window.frames.length > 0) {
|
if (window.frames.length > 0) {
|
||||||
window.frames[0].postMessage('logout', apiBaseUrl)
|
window.frames[0].postMessage('logout', apiBaseUrl)
|
||||||
}
|
}
|
||||||
|
if (window.sensors && sensors.logout) {
|
||||||
|
sensors.logout();
|
||||||
|
}
|
||||||
window.location = "/Account/logout";
|
window.location = "/Account/logout";
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user