1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
var ABRecord = (function () {
var headers = window.location.host == 'www.acadsoc.com' ? 'https://record.acadsoc.com' : ''
var tmpData = {
puid: 0, //Visit.ID
pvid: 0 //VisitDetail.ID
};
var agent = navigator.userAgent.toLowerCase();
//判断系统是32位还是64位,仅在windows下有效
var getOSBit = function () {
if (agent.indexOf("win32") >= 0 || agent.indexOf("wow32") >= 0) {
return 32;
}
if (agent.indexOf("win64") >= 0 || agent.indexOf("wow64") >= 0) {
return 64;
}
return 0;
};
var getQS = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return "";
};
//获取广告和来源
var getAdAndSource = function () {
var _st = getQS("_s");
var _ad = getQS("search");
return {
ad: _ad,
sourceType: _st
}
};
//浏览记录上传
var record = function () {
var data = {
referrer: document.referrer, //来源页
url: document.URL,
page: window._LoadingPageUrl, //中转页中转地址
hash: location.hash,
ieVersion: document.documentMode,
ieCompatible: agent.indexOf("compatible") >= 0,
osbit: getOSBit(),
sourceType: window._ABST, //来源类型,对应 IpRecord的 SourceType
adid: window._ABADID //广告ID,对应IpRecord的 SearchType
};
var adAndSource = getAdAndSource();
if (adAndSource.ad) {
data.adid = adAndSource.ad;
}
if (adAndSource.sourceType) {
data.sourceType = adAndSource.sourceType;
}
var options = {
url: headers + "/Ajax/Web.UI.Fun.ABRecord.aspx?__=ABVisit",
data: data,
type: "post",
xhrFields: { "withCredentials": true },
dataType: "json",
success: function (json) {
var jsonData = json.value;
if (jsonData.result) {
if (jsonData.data) {
tmpData.puid = jsonData.data.puid;
tmpData.pvid = jsonData.data.pvid;
}
}
}
};
jQuery.ajax(options);
};
//客户端注册成功后通知后台注册数加1
var abrecord = {
registUID: 0, //本页面注册的用户UID
registNotice: function (fn) { //fn表示回调函数
var result = null;
if (window.__a2b__ !== true) { //如果页面不是A页面跳转到B页面,则记录流量,否则不记录
var data = {
referrer: document.referrer, //来源页
url: document.URL,
page: window._LoadingPageUrl, //中转页中转地址
hash: location.hash,
ieVersion: document.documentMode,
ieCompatible: agent.indexOf("compatible") >= 0,
osbit: getOSBit(),
sourceType: window._ABST, //来源类型,对应 IpRecord的 SourceType
adid: window._ABADID, //广告ID,对应IpRecord的 SearchType
puid: tmpData.puid,
pvid: tmpData.pvid,
registUID: abrecord.registUID //在本页面注册的UID
};
var adAndSource = getAdAndSource();
if (adAndSource.ad) {
data.adid = adAndSource.ad;
}
if (adAndSource.sourceType) {
data.sourceType = adAndSource.sourceType;
}
$.ajax({
url: headers + "/Ajax/Web.UI.Fun.ABRecord.aspx?__=RegistNotice",
data: data,
async: !!fn,
type: "post",
xhrFields: { "withCredentials": true },
dataType: "json",
success: function (json) {
var jsonData = json.value;
if (jsonData.result) {
abrecord.registUID = 0;
}
if (fn) {
fn(jsonData.data);
} else {
result = jsonData;
}
},
error: function () {
}
});
if (!fn) { //同步时返回结果
return result;
}
}
}
};
if (window.__a2b__ !== true) { //如果页面不是A页面跳转到B页面,则记录流量,否则不记录
if (window.__wait__) {
setTimeout(record, 500); //如果有这个变量,则延迟500毫秒再执行流量统计
} else {
record();
}
}
return abrecord;
}());
(function () { var _actTopTipsBar = document.createElement("script"); _actTopTipsBar.src = "https://img.acadsoc.com.cn/web/img/activity/dsp/js/topbar.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(_actTopTipsBar, s); })();