Skip to content

Commit 5e3e583

Browse files
aenreljorgeluisrocha
authored andcommitted
Relevad RTD Module : initial release (prebid#9454)
* Added implementation of the Relevad Real-Time Data Provider * removed bidder from the testing HTML file * Addressed reviewer's request w.r.t. removing bidder-specific handling' * set page url * Addressed code review comments: fixed email address, added description of ORTB attributes we pass to the bidders * Addressed code review comments --------- Co-authored-by: Relevad <>
1 parent a00dffe commit 5e3e583

File tree

4 files changed

+1023
-0
lines changed

4 files changed

+1023
-0
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<meta name=viewport content="width=device-width, initial-scale=1">
6+
</head>
7+
<body>
8+
9+
<script async src="https://pagead2.googlesyndication.com/tag/js/gpt.js"></script>
10+
<script src="../../build/dev/prebid.js" async></script>
11+
12+
<script>
13+
var pbjs = pbjs || {};
14+
pbjs.que = pbjs.que || [];
15+
16+
17+
pbjs.que.push(function() {
18+
pbjs.setConfig({
19+
//debug: true, // set me to true to print traces to the console
20+
realTimeData: {
21+
auctionDelay: 1000,
22+
dataProviders: [
23+
{
24+
name: "RelevadRTDModule",
25+
waitForIt: true,
26+
params: {
27+
partnerid: 12345,
28+
setgpt: true,
29+
}
30+
}
31+
]
32+
}
33+
});
34+
});
35+
</script>
36+
37+
<script>
38+
var div_1_sizes = [
39+
[728, 90]
40+
];
41+
42+
var div_2_sizes = [
43+
[728, 90]
44+
];
45+
46+
var PREBID_TIMEOUT = 10000;
47+
var FAILSAFE_TIMEOUT = 20000;
48+
49+
var adUnits = [
50+
{
51+
code: '/19968336/header-bid-tag-0',
52+
mediaTypes: {
53+
banner: {
54+
sizes: div_1_sizes
55+
}
56+
},
57+
bids: [
58+
{ bidder: 'appnexus', params: { placementId: '13144370' } },
59+
]
60+
},
61+
{
62+
code: '/19968336/header-bid-tag-2',
63+
mediaTypes: {
64+
banner: {
65+
sizes: div_2_sizes
66+
}
67+
},
68+
bids: [
69+
{ bidder: 'appnexus', params: { placementId: '13144370' } }
70+
]
71+
},
72+
];
73+
74+
var googletag = googletag || {};
75+
googletag.cmd = googletag.cmd || [];
76+
googletag.cmd.push(function() {
77+
googletag.pubads().disableInitialLoad();
78+
});
79+
80+
var pbjs = pbjs || {};
81+
pbjs.que = pbjs.que || [];
82+
83+
pbjs.que.push(function() {
84+
pbjs.addAdUnits(adUnits);
85+
pbjs.requestBids({
86+
bidsBackHandler: initAdserver,
87+
timeout: PREBID_TIMEOUT
88+
});
89+
});
90+
91+
function initAdserver() {
92+
if (pbjs.initAdserverSet) return;
93+
pbjs.initAdserverSet = true;
94+
googletag.cmd.push(function() {
95+
pbjs.que.push(function() {
96+
pbjs.setTargetingForGPTAsync();
97+
googletag.pubads().refresh();
98+
});
99+
});
100+
}
101+
102+
103+
// in case PBJS doesn't load
104+
setTimeout(function() {
105+
initAdserver();
106+
}, FAILSAFE_TIMEOUT);
107+
108+
googletag.cmd.push(function() {
109+
googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads());
110+
googletag.defineSlot('/19968336/header-bid-tag-2', div_2_sizes, 'div-2').addService(googletag.pubads());
111+
googletag.pubads().enableSingleRequest();
112+
googletag.enableServices();
113+
});
114+
115+
</script>
116+
117+
<h2>Basic Prebid.js Example</h2>
118+
<h5>Div-1</h5>
119+
<div id='div-1'>
120+
<script type='text/javascript'>
121+
googletag.cmd.push(function() {
122+
googletag.display('div-1');
123+
});
124+
125+
</script>
126+
</div>
127+
128+
<h5>Div-2</h5>
129+
<div id='div-2'>
130+
<script type='text/javascript'>
131+
googletag.cmd.push(function() {
132+
googletag.display('div-2');
133+
});
134+
135+
</script>
136+
</div>
137+
</body>
138+
</html>

0 commit comments

Comments
 (0)