-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
56 lines (44 loc) · 1.75 KB
/
index.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
<html>
<head>
<title>Sammy.js Google Analytics Plugin Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="sammy.js"></script>
<script type="text/javascript" src="lib/plugins/sammy.googleanalytics.js"></script>
<script type="text/javascript">
$(function() {
var app = $.sammy(function() {
this.use(Sammy.GoogleAnalytics);
this.get('#/home', function() {
this.noTrack();
});
this.get('#/foo', function() {
});
this.get('#/bar', function() {
});
this.get('#/yay/awesome/howdy', function() {
});
});
app.run('#/home');
});
</script>
</head>
<body>
<h1>Sammy.js Google Analytics Plugin Example</h1>
<p>Click the links below to fire various routes. Watch your firebug net panel or equivalent to see the Google Analytics tracking.</p>
<ul>
<li><a href="#/home">Home</a> « Notice this link does not track as the route is calling 'noTrack()'</li>
<li><a href="#/foo">Foo</a></li>
<li><a href="#/bar">Bar</a></li>
<li><a href="#/yay/awesome/howdy">Yay Awesome Howdy</a></li>
</ul>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4489553-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>