-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (72 loc) · 2.43 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style>
h1, h3 {
font-family: Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1>Test</h1>
<script>
var hashParams = (function(hash) {
var keyAndValues = hash.replace(/^#/, '').split('&');
var params = {};
for (var i = 0, l = keyAndValues.length; i < l; i++) {
var keyAndValue = keyAndValues[i].split('=');
params[keyAndValue[0]] = keyAndValue[1];
}
return params;
})(location.hash);
</script>
<script>
var classAttr = '';
if (hashParams.selectorInElem) {
classAttr = ' class="outbound"';
}
document.writeln('<h3>Outbound Text Link</h3>');
document.writeln('<p><a href="http://www.google.co.jp/"' + classAttr + '>Google Japan</a></p>');
document.writeln('<h3>Outbound Image Link</h3>');
document.writeln('<p></p><a href="http://www.yahoo.co.jp/"' + classAttr + '>'
+ '<img src="http://k.yimg.jp/images/top/sp2/cmn/logo-ns-131205.png" alt="Yahoo Japan" />'
+ '</a></p>');
document.writeln('<h3>Inbound Text Link</h3>');
document.writeln('<p><a href="/"' + classAttr + '>Root</a></p>');
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-47251661-1', 'rotsuya.github.io');
ga('send', 'pageview');
</script>
<script>
if (hashParams.jQueryVersion) {
document.writeln('<script src="http://code.jquery.com/jquery-' + hashParams.jQueryVersion + '.js"></scr' + 'ipt>');
} else {
document.writeln('<script src="jquery-1.10.2.min.js"></scr' + 'ipt>');
}
</script>
<script src="jquery-ga-outbound.js"></script>
<script>
var options = {
debug: true
};
if (hashParams.timeout - 0 > 0) {
options.timeout = hashParams.timeout - 0;
}
if (hashParams.permitSameOrigin === 'true') {
options.permitSameOrigin = true;
}
var selector = 'a';
if (hashParams.selectorInJQ) {
selector = selector + '.outbound';
}
console.log('attached event to ' + $(selector).gaOutbound(options).length + ' elements.');
</script>
<output></output>
</body>
</html>