-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathanalytics.html
executable file
·373 lines (342 loc) · 13.7 KB
/
analytics.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="Header Bidding, Framework, HeaderBidding, Pubfood">
<title>Analytics | Pubfood</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- begin header -->
<div class="top-wrapper-outer">
<div id="top-wrapper">
<div class="top-w-1">
<div id="logo"><a href="/"><img src="images/logo.png" width="162" height="142" title="Pubfood" alt="Pubfood logo"></a></div>
</div><!-- end .top-w-1 -->
<div class="top-w-2">
<div id="main-nav">
<ul>
<li><a href="/getting-started">Getting Started</a></li>
<li><a href="/why-pubfood">Why Pubfood</a></li>
<li><a class="mn-link-active" href="/analytics">Pubfood Analytics</a></li>
<li><a href="/api-reference">API Reference</a></li>
<li><a href="/testimonials">Testimonials</a></li>
<li><a href="/integration-playbook">Ad Ops Guide</a></li>
<li><a href="https://github.com/pubfood/pubfood" target="_blank">GitHub</a></li>
<li><a href="mailto:pubfood@yieldbot.com?subject=Invite%20Request:%20Pubfood.js%20Slack%20Channel">Contact</a></li>
</ul>
</div><!-- end #main-nav -->
</div><!-- end .top-w-2 -->
<div class="clear-float"></div>
<div id="mn-toggle-link"><a href="javascript:void(0)" title="show main navigation"></a></div>
</div><!-- end #top-wrapper -->
</div><!-- end .top-wrapper-outer -->
<!-- end header -->
<div id="section-ip-1" class="content">
<!-- begin section connector :: needed to complete header -->
<div class="section-connector-1"><img src="images/half-circle-1.png" width="120" height="35" alt="half circle" /></div>
</div>
<!-- end section connector :: needed to complete header -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-xs-12">
<h2>Pubfood Analytics</h2>
<p>A unique dataset that combines bid data with latency analytics to provide publishers with a holistic view of their header bidding auctions.</p>
<h2>Benefits</h2>
<ul>
<li>Publishers can optimize their header bidding stack to find the optimal balance between number of partners and latency impact</li>
<li>Publishers can onboard new partners and determine if they add value immediately</li>
</ul>
<hr>
<h2>Key Pubfood Data Terms</h2>
<dl class="dl-horizontal">
<dt>Bid Complete</dt>
<dd>When a header bidder has completed their bid and passed key-value pairs into adserver call</dd>
<dt>Auction Complete</dt>
<dd>When the DFP auction has ended (all targeting is set, including header bidders). Now GPT display calls are triggered to render ads on page.</dd>
<dt>Late Bids</dt>
<dd>Header bidders that didn’t complete their bids in time for auction complete.</dd>
<dt>Bid Value</dt>
<dd>How much are header bidders paying for your imps (some header bidders don’t send price information with bid).</dd>
</dl>
<hr>
<!-- Table -->
<h2>How to see data in Google Analytics</h2>
<table class="table">
<thead>
<tr>
<th class="">Pubfood Attribute</th><th class="">GA Target</th>
</tr>
</thead>
<tbody>
<tr>
<td class="">Latency</td>
<td class="">timingValue</td>
</tr>
<tr>
<td class="">Bidder Name</td>
<td class="">timingCategory</td>
</tr>
<tr>
<td class="">Bid Value</td>
<td class="">timingLabel</td>
</tr>
<tr>
<td class="">BidValue</td>
<td class="">timingVar</td>
</tr>
</tbody>
</table>
<h2>Example GA Reports</h2>
<!-- DROPDOWN -->
<div class="center-block">
<ul style="margin:0;" class="nav nav-pills center-block" role="tablist">
<li style="padding-left:0; margin-left:0; background:none;" role="presentation" class="dropdown">
<a style="text-decoration:none;" id="dLabel" href=# data-toggle="dropdown" role="button" aria-haspopup=true aria-expanded="false"> Select Report
<span class="caret"></span>
</a>
<ul style="margin-left:0; list-style-type: none;" id="example-ga-reports-menu" class="dropdown-menu" aria-labelledby="dLabel">
<li><a style="text-decoration:none;" href="#adunit">Reports by Ad Unit</a></li>
<li><a style="text-decoration:none;" href="#device">Reports by Device</a></li>
<li style="margin-bottom:15px;"><a style="text-decoration:none;" href="#latency">Reports by Bid Value</a></li>
</ul>
</li>
</ul>
</div>
<br />
<table id="adunit">
<thead>
<tr>
<th>Bidder By Ad Unit</th>
</tr>
<tr>
<td><mark>Behavior -> Site Speed -> User Timings -> Secondary Dimension: Timing Variable</mark></td>
</tr>
</thead>
<tbody>
<tr>
<td><br /><img src="images/Ad-Unit.png" width="731" height="348" alt="Average bidder latency by ad unit (sec)" /></td>
</tr>
</tbody>
</table>
<table id="device">
<thead>
<tr>
<th>Bidder By Device</th>
</tr>
<tr>
<td><mark>Behavior -> Site Speed -> User Timings -> Secondary Dimension: Device Category</mark></td>
</tr>
</thead>
<tbody>
<tr><td><br /><img src="images/Device.png" width="731" height="503" alt="Average latency (sec) by device" /></td></tr>
</tbody>
</table>
<table id="latency">
<thead>
<tr><th>Bidder by Bid Value</th></tr>
<tr><td><mark>Behavior -> Site Speed -> User Timings -> Secondary Dimension: Device Category</mark></td></tr>
</thead>
<tbody>
<tr><td><br /><img src="images/Bidder.png" width="735" height="479" alt="Average bidder latency per bid" /></td></tr>
</tbody>
</table>
<hr>
<h2>The Code</h2>
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div style="background-color:#f8ebdf;" class="panel-heading" role="tab" id="headingOne">
<h4 style="margin-bottom:0;" class="panel-title">
<a style="text-decoration:none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
1.Define functions to build event data and send the GA timing hit
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<!-- <div class="code-sample">
<pre id="" class="prettyprint linenums">
function buildHit(ev, timeRef) {
...
}
</pre>
</div> -->
<div class="code-sample">
<pre class="prettyprint linenums">
function sendBatchHits(data) {
if (!data || typeof data !== 'object') return;
var payloadHits = [];
for (var idx in data) {
var hit = data[idx],
hitParams = 'v=1' +
'&t=timing' +
'&tid=UA-69476533-3' +
'&cid=' + UUID() +
'&utc=' + hit.category +
'&utv=' + hit.timingVar +
'&utt=' + hit.timingValue +
'&utl=' + hit.timingLabel;
payloadHits.push(hitParams);
}
var data_payload = payloadHits.join('\n'),
settings = {
"async": true,
"crossDomain": true,
"url": "https://www.google-analytics.com/batch",
"method": "POST",
"data": data_payload
};
if (noSend) return;
console.log('Sending Google Analytics Batch');
$.ajax(settings).fail(function(jqXHR, status) {
console.log('Google Analytics POST failed: ' + status);
});
}
function sendHit(hit) {
ga('pftest.send', {
hitType: 'timing',
timingCategory: hit.category,
timingVar: hit.timingVar,
timingValue: hit.timingValue,
timingLabel: hit.timingLabel
});
} </pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div style="background-color:#f8ebdf;" class="panel-heading" role="tab" id="headingTwo">
<h4 style="margin-bottom:0;" class="panel-title">
<a style="text-decoration:none;" class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">2. Register observer for Bid events</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<div class="code-sample">
<pre class="prettyprint linenums">
pf.observe('BID_PUSH_NEXT', function(ev) {
var hit = buildHit(ev, pfTimeReference);
if (hit) {
console.log(JSON.stringify(hit));
if (doAll) {
sendHit(hit);
} else {
bidTimingHits.push(hit);
}
};
});
</pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div style="background-color:#f8ebdf;" class="panel-heading" role="tab" id="headingThree">
<h4 style="margin-bottom:0;" class="panel-title">
<a style="text-decoration:none;" class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
3. Register observer for Bid events that come after the Pubfood timeout
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
<div class="panel-body">
<div class="code-sample">
<pre class="prettyprint linenums">
pf.observe('BID_PUSH_NEXT_LATE', function(ev) {
var hit = buildHit(ev, pfTimeReference);
if (hit) {
console.log(JSON.stringify(hit));
if (doAll) {
sendHit(hit);
} else {
bidTimingHits.push(hit);
}
};
});
</pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div style="background-color:#f8ebdf;" class="panel-heading" role="tab" id="headingFour">
<h4 style="margin-bottom:0;" class="panel-title">
<a style="text-decoration:none;" class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseThree">
4. Register observer for the bid provider is finished with bids
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<div class="code-sample">
<pre class="prettyprint linenums">
pf.observe('BID_COMPLETE', function(ev) {
var hit = buildHit(ev, pfTimeReference);
if (hit) {
console.log(JSON.stringify(hit));
if (doAll){
sendHit(hit);
} else {
bidTimingHits.push(hit);
}
};
});
</pre>
</div>
</div>
</div>
</div>
</div>
</div> <!-- column 12 -->
</div><!-- end .row -->
</div> <!-- container -->
</div><!-- end .content -->
<!-- begin footer -->
<div class="footer-wrapper-outer">
<div id="footer-wrapper">
<div id="footer-logo">
<img class="f-logo-1" src="images/logo.png" width="162" height="142" alt="Pubfood logo" />
<img class="f-logo-2" src="images/logo-2.png" width="100" height="88" alt="Pubfood logo - smaller size" />
</div>
<ul>
<li><a href="https://github.com/pubfood/pubfood" target="_blank">GitHub</a></li>
<!-- <li><a href="#">Contact</a></li> -->
<li><a href="mailto:pubfood@yieldbot.com?subject=Invite%20Request%3A%20Pubfood.js%20Slack%20Channel">Join the Pubfood.js Slack</a></li>
<li><a href="https://twitter.com/yieldbot" target="_blank"><img src="images/icon-twitter.png" width="28" height="24" alt="Twitter" /></a></li>
</ul>
<p><span>©
<script type="text/javascript">
(function display_the_cr_year() {
var the_cr_date = new Date();
var the_cr_current_year = the_cr_date.getFullYear();
document.write(the_cr_current_year);
})();
</script>
Pubfood.js</span> <span>All Rights Reserved</span></p>
</div><!-- end #footer-wrapper -->
</div><!-- end .footer-wrapper-outer -->
<!-- end footer -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- begin Google Analytics code -->
<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-69476533-1', 'pubfood.org');
ga('send', 'pageview');
</script>
<!-- end Google Analytics code -->
</body>
</html>