uclick.js
4.03 KB
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
$(function(){
function query(ele){
if( document.querySelector === undefined && window.jQuery){
return jQuery(ele);
}else{
return document.querySelector(ele);
}
}
if(query(".u-sc")){
query(".u-sc").onclick = function(){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.title;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
if(query(".m-p-header li[val='0']")){
query(".m-p-header li[val='0']").onclick = function (){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.innerHTML;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
if(query(".m-p-header li[val='1']")){
query(".m-p-header li[val='1']").onclick = function (){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.innerHTML;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
if(query(".m-p-header li[val='2']")){
query(".m-p-header li[val='2']").onclick = function (){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.innerHTML;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
if(query(".doact .btn-big-r")){
query(".doact .btn-big-r").onclick = function (){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.innerHTML;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
if(query(".doact .btn-big-y")){
query(".doact .btn-big-y").onclick = function (){
var aa = document.getElementById("uname");
if (aa == null) {
_paq.push(['setCustomVariable',1,"UserName","","visit"]);
}else{
_paq.push(['setCustomVariable',1,"UserName",aa.innerHTML,"visit"]);
}
var clickname = this.innerHTML;
var pid = query("#pid").value || query("#pid").val();
var result = clickname + ":" + pid;
_paq.push(['trackEvent','UserClick',clickname,result,1]);
}
}
});