Skip to content

Commit 3dacbc4

Browse files
New Adapter: Magnite Bid Adapter (#6436)
* magnite adapter * add migration details * lint
1 parent af9de18 commit 3dacbc4

1 file changed

Lines changed: 264 additions & 0 deletions

File tree

dev-docs/bidders/magnite.md

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
---
2+
layout: bidder
3+
title: Magnite
4+
description: Prebid Magnite Bidder Adapter
5+
biddercode: magnite
6+
tcfeu_supported: true
7+
dsa_supported: true
8+
gpp_sids: tcfeu, usnat, usstate_all, usp
9+
usp_supported: true
10+
coppa_supported: true
11+
schain_supported: true
12+
floors_supported: true
13+
media_types: banner, video, native
14+
userIds: all
15+
prebid_member: true
16+
safeframes_ok: true
17+
deals_supported: true
18+
pbjs: true
19+
pbs: false
20+
fpd_supported: true
21+
ortb_blocking_supported: true
22+
gvl_id: 52
23+
multiformat_supported: will-bid-on-any
24+
sidebarType: 1
25+
---
26+
27+
### Registration
28+
29+
The Magnite adapter requires setup and approval from the Magnite team, even for existing accounts. Please reach out to your account manager or <header-bidding@magnite.com> for more information.
30+
31+
### Bid Params
32+
33+
{: .table .table-bordered .table-striped }
34+
| Name | Scope | Description | Example | Type |
35+
|------|-------|-------------|---------|------|
36+
| `accountId` | required | The publisher account ID | `14062` | `integer` |
37+
| `siteId` | required | A unique ID for your site | `70608` | `integer` |
38+
| `zoneId` | required | A unique ID for your site's ad placements | `498816` | `integer` |
39+
40+
#### First Party Data
41+
42+
Publishers should use the `ortb2` method of setting First Party Data. The following fields are supported:
43+
44+
- ortb2.site.ext.data.*
45+
- ortb2.site.keywords
46+
- ortb2.site.content.data[]
47+
- ortb2.user.ext.data.*
48+
- ortb2.user.data[]
49+
50+
The Magnite exchange supports IAB standard taxonomies for contextual and audience segments.
51+
52+
Example first party data available to all bidders and all ad units:
53+
54+
```javascript
55+
pbjs.setConfig({
56+
ortb2: {
57+
site: {
58+
keywords: "kw1,kw2",
59+
ext: {
60+
data: {
61+
prodtype: ["tech","mobile"]
62+
}
63+
}
64+
},
65+
user: {
66+
ext: {
67+
data: {
68+
ucat: ["new"]
69+
}
70+
}
71+
}
72+
}
73+
});
74+
```
75+
76+
Example of first party data available only to the Magnite bidder across all ad units:
77+
78+
```javascript
79+
pbjs.setBidderConfig({
80+
bidders: ["magnite"],
81+
config: {
82+
ortb2: {
83+
site: {
84+
keywords: "kw1,kw2",
85+
ext: {
86+
data: {
87+
prodtype: ["tech","mobile"]
88+
}
89+
}
90+
},
91+
user: {
92+
ext: {
93+
data: {
94+
ucat: ["new"]
95+
}
96+
}
97+
}
98+
}
99+
}
100+
});
101+
```
102+
103+
### Media Types
104+
105+
#### Banner
106+
107+
Banner ads are supported with standard IAB sizes.
108+
109+
```javascript
110+
var bannerAdUnit = {
111+
code: 'test-div',
112+
mediaTypes: {
113+
banner: {
114+
sizes: [[300, 250], [728, 90]]
115+
}
116+
},
117+
bids: [{
118+
bidder: 'magnite',
119+
params: {
120+
accountId: 14062,
121+
siteId: 70608,
122+
zoneId: 498816
123+
}
124+
}]
125+
};
126+
```
127+
128+
#### Video
129+
130+
The Magnite adapter supports standard OpenRTB video parameters for both instream and outstream contexts.
131+
132+
```javascript
133+
var videoAdUnit = {
134+
code: 'myVideoAdUnit',
135+
mediaTypes: {
136+
video: {
137+
context: 'instream',
138+
playerSize: [640, 480],
139+
mimes: ['video/mp4', 'video/x-ms-wmv'],
140+
protocols: [2, 5],
141+
maxduration: 30,
142+
linearity: 1,
143+
api: [2]
144+
}
145+
},
146+
bids: [{
147+
bidder: 'magnite',
148+
params: {
149+
accountId: 14062,
150+
siteId: 70608,
151+
zoneId: 498816
152+
}
153+
}]
154+
};
155+
```
156+
157+
Outstream video is also supported. We recommend discussing video demand with your Magnite account representative.
158+
159+
#### Native
160+
161+
The Magnite adapter supports native ads using the ORTB Native spec. We recommend version 1.2, but versions 1.0 and 1.1 are also supported.
162+
163+
{: .table .table-bordered .table-striped }
164+
| Native Version | Required Fields |
165+
|---|---|
166+
| 1.0 and 1.1 | layout, adunit, assets |
167+
| 1.2 | context, plcmttype, assets, eventtrackers. privacy is a recommended field. |
168+
169+
Here's an example using ORTB Native 1.2:
170+
171+
```javascript
172+
var nativeAdUnit = {
173+
code: 'myNativeAdUnit',
174+
mediaTypes: {
175+
native: {
176+
ortb: {
177+
ver: "1.2",
178+
context: 2,
179+
plcmttype: 11,
180+
privacy: 1,
181+
assets: [{
182+
id: 1,
183+
required: 1,
184+
img: {
185+
type: 3,
186+
w: 150,
187+
h: 50
188+
}
189+
}],
190+
eventtrackers: [{
191+
event: 1,
192+
methods: [1, 2]
193+
}]
194+
}
195+
}
196+
},
197+
bids: [{
198+
bidder: 'magnite',
199+
params: {
200+
accountId: 14062,
201+
siteId: 70608,
202+
zoneId: 498816
203+
}
204+
}]
205+
};
206+
```
207+
208+
### Configuration
209+
210+
#### User Sync
211+
212+
Add the following code to enable user syncing. By default, Prebid.js turns off user syncing through iframes. Magnite recommends enabling iframe-based user syncing to improve match rates and bid performance.
213+
214+
```javascript
215+
pbjs.setConfig({
216+
userSync: {
217+
iframeEnabled: true
218+
}
219+
});
220+
```
221+
222+
### Migration from Rubicon
223+
224+
The Magnite adapter (`bidder: "magnite"`) is designed as the next-generation replacement for the Rubicon adapter (`bidder: "rubicon"`). It uses a modern OpenRTB integration that is simpler and easier to maintain.
225+
226+
Key points for migrating:
227+
228+
- The bid params (`accountId`, `siteId`, `zoneId`) remain the same.
229+
- The adapter accepts configuration from both `magnite` and `rubicon` config namespaces during the transition.
230+
- Update `bidder: "rubicon"` to `bidder: "magnite"` in your ad unit configurations.
231+
232+
#### Preserving Existing GAM Line Items
233+
234+
If you are migrating from the Rubicon adapter and your Google Ad Manager (GAM) line items rely on bidder-specific key-value targeting (e.g., `hb_bidder=rubicon` or `hb_pb_rubicon`), you can avoid updating your ad server setup by aliasing the Magnite adapter as `rubicon`. This causes bids from the Magnite adapter to be reported under the `rubicon` bidder code, preserving compatibility with your existing line items.
235+
236+
```javascript
237+
pbjs.aliasBidder('magnite', 'rubicon');
238+
```
239+
240+
Then use the alias in your ad unit configuration:
241+
242+
```javascript
243+
var adUnit = {
244+
code: 'test-div',
245+
mediaTypes: {
246+
banner: {
247+
sizes: [[300, 250]]
248+
}
249+
},
250+
bids: [{
251+
bidder: 'rubicon',
252+
params: {
253+
accountId: 14062,
254+
siteId: 70608,
255+
zoneId: 498816
256+
}
257+
}]
258+
};
259+
```
260+
261+
With this approach, Prebid.js will use the Magnite adapter under the hood but send targeting keys as `hb_bidder=rubicon`, `hb_pb_rubicon`, etc., so your existing GAM line items continue to work without changes.
262+
263+
{: .alert.alert-info :}
264+
The `rubicon` alias is **not** included as a default alias of the Magnite adapter by design. This allows publishers to include both the Magnite and Rubicon adapters in the same Prebid.js build for A/B testing during migration. However, for production use after migration, the recommended approach is to build Prebid.js with only the Magnite adapter (without the Rubicon adapter) and use `pbjs.aliasBidder('magnite', 'rubicon')` as shown above. This avoids potential conflicts between the two adapters.

0 commit comments

Comments
 (0)