-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdemo.html
90 lines (86 loc) · 3.22 KB
/
demo.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>jQuery Google Analytics Event Tracking Plugin</title>
<meta name="description" content="" />
<meta name="generator" content="Studio 3 http://aptana.com/" />
<meta name="author" content="Joakim Westerlund" />
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script src="jquery.analyticseventtracking.js"></script>
<script type="text/javascript">//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]>
</script>
<style>
body{
margin:40px;
font:13px/1.5 Arial,'Liberation Sans',FreeSans,sans-serif;
}
#container{
width:100%;
margin:0 auto;
}
#tracked{
padding:10px;
background:#f1f1f1;
}
</style>
<script>
$(document).ready(function(){
$("a").analyticsEventTracking();
$("#tracked").analyticsEventTracking({
category : "DemoCategory",
label: "my-defined-label"
});
$("#my-defined-data-attributes").analyticsEventTracking({
category: function(){
return $(this).data("cat");
},
action: function(){
return $(this).data("act");
}
});
});
function externalFunction(elm){
return "my-defined-label-external-function";
}
</script>
</head>
<body>
<div id="container">
<header>
<h1>Demo of Google Event Tracking jQuery Plugin</h1>
</header>
<nav>
<p><a href="http://joakim-westerlund.se/" data-jaet-report-category="Home" data-jaet-report-action="label-home">Home</a></p>
<p><a href="http://devcorner.mynewsdesk.com/" data-jaet-report-category="Mynewsdesk" data-jaet-report-label="label-blog">Blog</a></p>
</nav>
<div id="my-defined-data-attributes" data-cat="category" data-act="action with space and åäö">
This is with custom data attributes
</div>
<div id="tracked">
<p>
This is a special click <strong>div#tracked</strong> with specified values...
</p>
</div>
<footer>
<p>2011 by <a href="http://joakim-westerlund.se" data-jaet-report-category="Home" data-jaet-report-label="label-author">Joakim Westerlund</a> | works at <a href="http://mynewsdesk.com" data-jaet-report-category="Mynewsdesk">Mynewsdesk</a></p>
</footer>
</div>
</body>
</html>