Prebid.js Ad Unit Config Generator
Build a Prebid.js ad unit config with banner, video, and native media types plus bidder params, then copy a ready pbjs.addAdUnits() snippet — all in your browser.
The Prebid Ad Unit Generator runs entirely in your browser. Your ad unit code, bidder names, and placement params are used only to build the config locally and are never uploaded to ArrayKit.
Open the OpenRTB Bid Request Generator
About Prebid Ad Unit Generator
The Prebid Ad Unit Generator turns a simple form into a valid Prebid.js ad unit config and a copy-paste pbjs.addAdUnits() snippet. Set the ad unit code, toggle banner, video, or native media types, add banner sizes like 300x250 and 728x90, choose an instream or outstream video context with a player size, and attach one or more bidders with their params — appnexus placementId, rubicon accountId/siteId/zoneId, and so on. It is built for ad-ops engineers and header-bidding developers wiring up new placements who want a clean starting object without hand-editing JSON. Everything is generated on your device: no ad tags, bidder ids, or placement params are ever uploaded, so you can prototype real production units without leaking your setup.
Features
- Builds a Prebid.js ad unit with mediaTypes.banner, video, and native
- Parses banner sizes like 300x250, 728x90 into the [[w,h]] shape Prebid expects
- Instream / outstream video context with a player size and default mimes
- Add unlimited bidders, each with any number of key/value params
- Auto-coerces numeric params (placementId, siteId) to numbers, keeps ids with leading zeros as strings
- Copy either the full pbjs.addAdUnits() snippet or the raw adUnit object
- Inline warnings flag empty codes, missing sizes, or bidders with no params
- Runs entirely in your browser — no bidder params leave your device
How to use the Prebid Ad Unit Generator
- Enter the ad unit code (your GPT div id or slot name)
- Toggle banner, video, or native and fill in sizes or context
- Add each bidder and its params (e.g. appnexus placementId)
- Copy the pbjs.addAdUnits() snippet or the raw adUnit object into your wrapper
Example
Input
code: div-gpt-ad-1
banner: 300x250, 728x90
bidder: appnexus placementId: 13144370
Output
pbjs.addAdUnits([{ code: 'div-gpt-ad-1', mediaTypes: { banner: { sizes: [[300,250],[728,90]] } }, bids: [{ bidder: 'appnexus', params: { placementId: 13144370 } }] }]);
A banner ad unit with one AppNexus bid, ready for your Prebid.js wrapper.
Common errors & troubleshooting
- Prebid ignores the ad unit or logs 'No bids' for it. — Check that the ad unit code exactly matches the GPT slot / div id you pass to pbjs, and that each bidder name is the real Prebid adapter code (e.g. appnexus, not AppNexus).
- Banner sizes render at the wrong dimensions. — Sizes must be WxH pairs like 300x250, 728x90. The generator parses them into [[300,250],[728,90]] — remove any stray text so every size is a valid pair.
- A numeric param like placementId is sent as a string and the bid fails. — The generator coerces plain integers to numbers automatically. If your id has a leading zero it is kept as a string on purpose — confirm the adapter actually expects a string there.
- Video ad unit does not request. — Video needs a context (instream or outstream) and a player size such as 640x480. Instream units also usually require an ad server video config outside this tool.
Frequently asked questions
- What does the Prebid Ad Unit Generator output?
- It outputs two things: a copy-paste pbjs.addAdUnits() snippet wrapped in a pbjs.que.push, and the raw adUnit object. Both contain your ad unit code, the enabled mediaTypes (banner/video/native), and a bids array with each bidder and its params.
- How do I add multiple bidders to one ad unit?
- Click Add bidder for each demand partner, type the adapter code (appnexus, rubicon, etc.), then add its params as key/value rows. Each bidder becomes an entry in the ad unit's bids array.
- Does it handle video and native media types?
- Yes. Toggle Video to set an instream or outstream context plus a player size, and toggle Native to add a starter native template with title, image, and sponsoredBy assets you can refine in the output.
- Why is my placementId shown as a number instead of a string?
- Most Prebid adapters expect numeric ids, so plain integers are coerced to numbers. Values with a leading zero or non-digit characters are kept as strings so ids like '007' or ad-server paths are not mangled.
- Are my bidder ids and placement params uploaded anywhere?
- No. The generator runs entirely in your browser. The ad unit code, bidder names, and params you type are never sent to a server, so you can build real production units privately.
Related tools
All ArrayKit tools