-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbehavior.html
More file actions
69 lines (69 loc) · 2.74 KB
/
behavior.html
File metadata and controls
69 lines (69 loc) · 2.74 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mixpanel Single Page Website</title>
<link rel="stylesheet" href="behavior.css">
<!-- Mixpanel Snippet -->
<script type="text/javascript">
(function(e,a){
if(!a.__SV){
var b=window;
try{
var c,l,i,j=b.location,g=j.hash;
c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};
g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),
"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),
history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))
}catch(m){}
var k,h;
window.mixpanel=a;
a._i=[];
a.init=function(b,c,f){
function e(b,a){
var c=a.split(".");
2==c.length&&(b=b[c[0]],a=c[1]);
b[a]=function(){
b.push([a].concat(Array.prototype.slice.call(arguments,0)))
}
}
var d=a;
"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";
d.people=d.people||[];
d.toString=function(b){
var a="mixpanel";
"mixpanel"!==f&&(a+="."+f);
b||(a+=" (stub)");
return a;
};
d.people.toString=function(){
return d.toString(1)+".people (stub)";
};
k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);
a._i.push([b,c,f]);
};
a.__SV=1.2;
var n=e.createElement("script");
n.type="text/javascript";
n.async=!0;
n.src="https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";
var p=e.getElementsByTagName("script")[0];
p.parentNode.insertBefore(n,p);
}
})(document,window.mixpanel||[]);
mixpanel.init("YOUR_MIXPANEL_TOKEN"); // Replace with your Mixpanel token
</script>
</head>
<body>
<h1>Behavior Monitoring</h1>
<p>Interact with this page and watch the events being tracked via Mixpanel.</p>
<button class="btn" id="actionBtn">Click Me!</button>
<form id="sampleForm">
<input type="text" id="nameInput" placeholder="Enter your name">
<button class="btn" type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>