Skip to content

Commit c25d91c

Browse files
author
Rafael J. Staib
committed
Add advanced tracking and more meta data information
1 parent 72c16fc commit c25d91c

File tree

7 files changed

+390
-61
lines changed

7 files changed

+390
-61
lines changed

add-remove.html

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
<html>
33
<head>
44
<title>jQuery Steps - Dynamic Manipulation Demo</title>
5-
<meta charset='utf-8'>
5+
6+
<meta charset="utf-8">
67
<meta http-equiv="X-UA-Compatible" content="chrome=1">
8+
<meta name="author" content="Rafael J. Staib">
79
<meta name="description" content="A powerful jQuery wizard plugin that supports accessibility and HTML5.">
10+
<meta name="keywords" content="jQuery, plugin, UI, component, wizard, tabs, steps, HTML5, javascript, accessibility, form, validation">
811
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
912

10-
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel="stylesheet" type="text/css">
13+
<!-- Required for Open Graph -->
14+
<meta property="og:title" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
15+
<meta property="og:site_name" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
16+
<meta property="og:type" content="website">
17+
<meta property="og:url" content="http://rstaib.github.io/jquery-steps">
18+
19+
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Architects+Daughter">
1120
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
1221
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
1322
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
14-
<link rel="stylesheet" href="stylesheets/jquery.steps.css">
23+
<link rel="stylesheet" type="text/css" href="stylesheets/jquery.steps.css">
1524

1625
<script src="javascripts/jquery-1.9.1.min.js"></script>
1726
<script src="javascripts/jquery.steps.min.js"></script>
@@ -107,15 +116,65 @@ <h3>License</h3>
107116
</div>
108117
</div>
109118

110-
<script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');</script>
111119
<script>
120+
// GitHub Star Button
121+
!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');
122+
123+
// Google Analytics
112124
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
113125
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
114126
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
115127
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
116128

117129
ga('create', 'UA-40997516-1', 'rstaib.github.io');
118130
ga('send', 'pageview');
131+
132+
// Anchor Event Tracking
133+
$(function()
134+
{
135+
var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|js|md)$/i,
136+
baseHref = "";
137+
if ($("base").attr("href") != undefined)
138+
{
139+
baseHref = $("base").attr("href");
140+
}
141+
142+
$("a").each(function()
143+
{
144+
var href = $(this).attr("href");
145+
if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain)))
146+
{
147+
$(this).click(function()
148+
{
149+
ga("send", "event", "External", "Click", href.replace(/^https?\:\/\//i, ""));
150+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
151+
{
152+
setTimeout(function() { location.href = href; }, 200);
153+
return false;
154+
}
155+
});
156+
}
157+
else if (href && href.match(/^mailto\:/i))
158+
{
159+
$(this).click(function()
160+
{
161+
ga("send", "event", "Email", "Click", href.replace(/^mailto\:/i, ""));
162+
});
163+
}
164+
else if (href && href.match(filetypes))
165+
{
166+
$(this).click(function()
167+
{
168+
ga("send", "event", "Download", "Click", href);
169+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
170+
{
171+
setTimeout(function() { location.href = baseHref + href; }, 200);
172+
return false;
173+
}
174+
});
175+
}
176+
});
177+
});
119178
</script>
120179
</body>
121180
</html>

async.html

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
<html>
33
<head>
44
<title>jQuery Steps - Async Demo</title>
5-
<meta charset='utf-8'>
5+
6+
<meta charset="utf-8">
67
<meta http-equiv="X-UA-Compatible" content="chrome=1">
8+
<meta name="author" content="Rafael J. Staib">
79
<meta name="description" content="A powerful jQuery wizard plugin that supports accessibility and HTML5.">
10+
<meta name="keywords" content="jQuery, plugin, UI, component, wizard, tabs, steps, HTML5, javascript, accessibility, form, validation">
811
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
912

10-
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel="stylesheet" type="text/css">
13+
<!-- Required for Open Graph -->
14+
<meta property="og:title" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
15+
<meta property="og:site_name" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
16+
<meta property="og:type" content="website">
17+
<meta property="og:url" content="http://rstaib.github.io/jquery-steps">
18+
19+
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Architects+Daughter">
1120
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
1221
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
1322
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
14-
<link rel="stylesheet" href="stylesheets/jquery.steps.css">
23+
<link rel="stylesheet" type="text/css" href="stylesheets/jquery.steps.css">
1524

1625
<script src="javascripts/jquery-1.9.1.min.js"></script>
1726
<script src="javascripts/jquery.steps.min.js"></script>
@@ -99,15 +108,65 @@ <h3>License</h3>
99108
</div>
100109
</div>
101110

102-
<script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');</script>
103111
<script>
112+
// GitHub Star Button
113+
!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');
114+
115+
// Google Analytics
104116
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
105117
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
106118
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
107119
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
108120

109121
ga('create', 'UA-40997516-1', 'rstaib.github.io');
110122
ga('send', 'pageview');
123+
124+
// Anchor Event Tracking
125+
$(function()
126+
{
127+
var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|js|md)$/i,
128+
baseHref = "";
129+
if ($("base").attr("href") != undefined)
130+
{
131+
baseHref = $("base").attr("href");
132+
}
133+
134+
$("a").each(function()
135+
{
136+
var href = $(this).attr("href");
137+
if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain)))
138+
{
139+
$(this).click(function()
140+
{
141+
ga("send", "event", "External", "Click", href.replace(/^https?\:\/\//i, ""));
142+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
143+
{
144+
setTimeout(function() { location.href = href; }, 200);
145+
return false;
146+
}
147+
});
148+
}
149+
else if (href && href.match(/^mailto\:/i))
150+
{
151+
$(this).click(function()
152+
{
153+
ga("send", "event", "Email", "Click", href.replace(/^mailto\:/i, ""));
154+
});
155+
}
156+
else if (href && href.match(filetypes))
157+
{
158+
$(this).click(function()
159+
{
160+
ga("send", "event", "Download", "Click", href);
161+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
162+
{
163+
setTimeout(function() { location.href = baseHref + href; }, 200);
164+
return false;
165+
}
166+
});
167+
}
168+
});
169+
});
111170
</script>
112171
</body>
113172
</html>

basic-form.html

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@
22
<html>
33
<head>
44
<title>jQuery Steps - Basic Form Demo</title>
5-
<meta charset='utf-8'>
5+
6+
<meta charset="utf-8">
67
<meta http-equiv="X-UA-Compatible" content="chrome=1">
8+
<meta name="author" content="Rafael J. Staib">
79
<meta name="description" content="A powerful jQuery wizard plugin that supports accessibility and HTML5.">
10+
<meta name="keywords" content="jQuery, plugin, UI, component, wizard, tabs, steps, HTML5, javascript, accessibility, form, validation">
811
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
912

10-
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel="stylesheet" type="text/css">
13+
<!-- Required for Open Graph -->
14+
<meta property="og:title" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
15+
<meta property="og:site_name" content="jQuery Steps, a powerful jQuery wizard plugin that supports accessibility and HTML5.">
16+
<meta property="og:type" content="website">
17+
<meta property="og:url" content="http://rstaib.github.io/jquery-steps">
18+
19+
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Architects+Daughter">
1120
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
1221
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
1322
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
14-
<link rel="stylesheet" href="stylesheets/jquery.steps.css">
23+
<link rel="stylesheet" type="text/css" href="stylesheets/jquery.steps.css">
1524

1625
<script src="javascripts/jquery-1.9.1.min.js"></script>
1726
<script src="javascripts/jquery.steps.min.js"></script>
@@ -133,15 +142,65 @@ <h3>License</h3>
133142
</div>
134143
</div>
135144

136-
<script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');</script>
137145
<script>
146+
// GitHub Star Button
147+
!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs');
148+
149+
// Google Analytics
138150
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
139151
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
140152
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
141153
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
142154

143155
ga('create', 'UA-40997516-1', 'rstaib.github.io');
144156
ga('send', 'pageview');
157+
158+
// Anchor Event Tracking
159+
$(function()
160+
{
161+
var filetypes = /\.(zip|exe|pdf|doc*|xls*|ppt*|mp3|js|md)$/i,
162+
baseHref = "";
163+
if ($("base").attr("href") != undefined)
164+
{
165+
baseHref = $("base").attr("href");
166+
}
167+
168+
$("a").each(function()
169+
{
170+
var href = $(this).attr("href");
171+
if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain)))
172+
{
173+
$(this).click(function()
174+
{
175+
ga("send", "event", "External", "Click", href.replace(/^https?\:\/\//i, ""));
176+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
177+
{
178+
setTimeout(function() { location.href = href; }, 200);
179+
return false;
180+
}
181+
});
182+
}
183+
else if (href && href.match(/^mailto\:/i))
184+
{
185+
$(this).click(function()
186+
{
187+
ga("send", "event", "Email", "Click", href.replace(/^mailto\:/i, ""));
188+
});
189+
}
190+
else if (href && href.match(filetypes))
191+
{
192+
$(this).click(function()
193+
{
194+
ga("send", "event", "Download", "Click", href);
195+
if ($(this).attr("target") != null && $(this).attr("target").toLowerCase() !== "_blank")
196+
{
197+
setTimeout(function() { location.href = baseHref + href; }, 200);
198+
return false;
199+
}
200+
});
201+
}
202+
});
203+
});
145204
</script>
146205
</body>
147206
</html>

0 commit comments

Comments
 (0)