This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
/
howto-1b-page#1.html
77 lines (70 loc) · 3.22 KB
/
howto-1b-page#1.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
<!DOCTYPE HTML>
<html>
<head>
<title>Boomerang 使用方法 #1b: ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../boomerang-docs.css">
</head>
<body>
<span style="float:right;"><a href="../">All Docs</a> | <a href="index.html">Index</a></span>
<h1>Boomerang 使用方法 #1b:<br>ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる</h1>
<p>
この要件の説明は <a href="../use-cases.html#uc-1">ユースケース #1</a> をご覧ください。
</p>
<p>
このユースケースのために2つのページを使います。あなたのサイト上の2つのページに同じコードを埋め込みます。今回のケースでは 1a とは違い、onload イベントが発生したときにビーコンを送信させません。代わりに決めたページが準備完了となる時点で <code>page_ready</code> イベントを発生させます。また、自動的に実行された boomerang を停止するために <code>autorun</code> パラメーターを false にできます。
</p>
<ol>
<li>あなたのドキュメントルートに boomerang.js と images/ ディレクトリーをコピーします</li>
<li>次のコードをあなたの全てのページに追加します。ページの読み込みがまだ完了する前の任意の場所に追加します。</li>
</ol>
<pre>
<script src="boomerang.js" type="text/javascript"></script>
<script type="text/javascript">
BOOMR.init({
user_ip: "<user's ip address>",
beacon_url: "http://yoursite.com/path/to/beacon.php",
autorun: false
});
</script>
</pre>
<p>
残りのページはそのまま読み込まれます。ユーザーがページを表示しページが有効となったときに、次のように <code>page_ready</code> イベントを発生させる必要があります。
</p>
<pre>
BOOMR.page_ready(); // Tell boomerang that the page is now usable
</pre>
<p>
使用方法 1a のときのようにバックエンドの言語を使って <code>user_ip</code> を追加する必要があります。
</p>
<p>
ページの読み込みテストの結果を見るには <a href="howto-1b-page%232.html">ページ #2</a> へ移動してください。
</p>
<p class="perma-link">
最新のソースコードとドキュメントは <a href="http://github.com/lognormal/boomerang/">github.com/lognormal/boomerang</a> に公開されています。
</p>
<p id="results">
</p>
<script src="../../../boomerang.js" type="text/javascript"></script>
<script src="../../howtos/howtos.js" type="text/javascript"></script>
<script type="text/javascript">
BOOMR.init({
user_ip: '10.0.0.1',
autorun: false,
BW: {
base_url: '../../images/',
cookie: 'HOWTO-BA'
},
RT: {
cookie: 'HOWTO-RT'
}
});
// Fire the page_ready event after 750ms
setTimeout(function() { BOOMR.page_ready(); }, 750);
</script>
</body>
</html>
<!--
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
-->