Prebid.js

Prebid.js

Prebid.js manages client-side header bidding auctions on publisher websites, collecting bids from multiple demand partners before ad serving decisions are made. Scripts coordinate auction timing, pass user identifiers to bidders, and log impression data.

Overview

Prebid.js is the most widely deployed open-source header bidding library, used by publishers to run real-time auctions among multiple demand partners before a final ad serving call is made. It loads on publisher pages through a self-hosted or CDN-delivered script bundle and coordinates bid requests to dozens of SSPs and DSPs simultaneously. Because it brokers the transfer of user identifiers and behavioral signals to external bidding endpoints, it has significant privacy implications for site visitors.

What This Script Does

Prebid.js loads as a monolithic JavaScript bundle, typically named prebid.js or pbjs.js, often hosted at the publisher's own origin or via a CDN path. Once initialized, it calls out to multiple bid adapter endpoints — such as prebid-server.rubiconproject.com, ib.adnxs.com, sync.1rx.io, and dozens of others depending on which adapters are configured.

Cookie and storage behavior depends on the adapters enabled. Prebid itself may set a cookie such as _pbjs_userid_optout to persist user opt-out state across sessions. User ID modules (e.g., ID5, SharedID, Unified ID 2.0) set their own cookies or use localStorage keys like _id5id, _pubcid, or __uid2 with expiry ranging from 30 to 365 days. These identifiers are passed as bid parameters to each demand partner.

Data collected and transmitted includes: hashed or raw email addresses (if ID modules are seeded), IP address, User-Agent, page URL, referrer, viewport dimensions, ad slot positions, and any first-party segments defined by the publisher. Each bidder adapter sends a bid request carrying these fields to its respective endpoint, which may perform additional syncs via pixel or iframe.

User syncing (cookie syncing between demand partners and publishers) is managed by Prebid's user sync module, which fires iframe or image pixel requests to bidder endpoints after auction completion. These syncs enable cross-domain identity matching and are a significant privacy vector.

Consent & Compliance

Under GDPR and the ePrivacy Directive, Prebid.js falls squarely in the marketing and analytics categories. The transmission of user identifiers to third-party bidders requires a valid legal basis — consent under Article 6(1)(a) is the standard approach. IAB TCF Purposes 1 (Store and/or access information on a device), 2 (Select basic ads), 3 (Create a personalised ads profile), 4 (Select personalised ads), and 7 (Measure ad performance) are all potentially exercised depending on adapter configuration.

Prebid.js has a built-in GDPR Enforcement Module that reads TCF consent strings and gates bid requests based on vendor consent status. Publishers are responsible for configuring this module correctly; misconfiguration results in bid requests firing without adequate consent.

Under CCPA/CPRA, Prebid supports the US Privacy string (usprivacy) to signal opt-out of sale/sharing to downstream partners, but enforcement depends on each adapter's implementation.

As a US-based ecosystem, participating vendors should maintain EU-US Data Privacy Framework commitments or SCCs for lawful EU data transfers.

Consent category: marketing. The primary purpose is enabling targeted ad placement via real-time bidding, which requires consent under ePrivacy and TCF rules.

Should You Block This Without Consent?

Yes. Prebid.js transmits user identifiers and behavioral signals to multiple third-party advertising endpoints as its core function. Without consent, these transfers violate GDPR Article 6 and the ePrivacy Directive's cookie rules. The script should be blocked until marketing consent is granted and a valid TCF string authorizing the configured demand partners is available.

Is Prebid.js GDPR compliant?

Prebid.js typically loads marketing and analytics trackers, which are not strictly necessary for your site to work. Under the GDPR and the ePrivacy Directive, non-essential cookies and trackers must stay blocked until a visitor gives clear opt-in consent. So Prebid.js can be fully GDPR compliant, but only if your site holds its scripts until consent is granted and lets visitors decline just as easily. Compliance depends on how your site loads Prebid.js, not on Prebid.js itself.

Visit website

Consent Categories

Also Known As

prebidprebid.jsprebid jsheader biddingprebid header biddingclient side biddingprebid demand partners

Industries

Computers Electronics and Technology

Tracked Domains (1)

prebid.orgMarketing

prebid.org is a marketing domain operated by Prebid.js, used to serve ads, build audiences, and measure ad conversions.

Frequently Asked Questions

Related Vendors

Clearpay
Clearpay
Clearpay embeds buy-now-pay-later payment widget scripts on product and checkout pages. Scripts render installment payment options, verify eligibility, and process transaction data to facilitate Clearpay's deferred payment service.
Kissmetrics
Kissmetrics
Behavioral analytics platform used by enterprise product teams to track user flows, cohort retention, and funnel performance. Kissmetrics ties behavioral events to individual users over time, enabling long-term lifecycle analysis. Sets a persistent cookie to maintain identity across sessions.
Kartra
Kartra
Kartra loads tracking scripts on funnels and membership sites to collect conversion attribution data and visitor behavior signals. Scripts track page views, form submissions, and purchase events to support email marketing automation and funnel analytics.
Subscribers
Subscribers
Subscribers.com is a web push notification platform that lets websites send promotional and transactional push messages to opted-in visitors. Scripts prompt visitors to subscribe to browser push notifications and assign a subscriber token for targeting. Sends are tracked for delivery rate and click-through attribution.
Brandbassador
Brandbassador
Brandbassador is a brand ambassador and influencer marketing platform. Its scripts track referral link clicks and ambassador-driven conversions on websites, setting cookies to attribute purchases to specific ambassadors and making requests to Brandbassador servers for campaign reporting.
Instapage
Instapage
Instapage loads scripts on post-click landing pages to handle A/B testing, conversion tracking, and form submissions. Scripts collect visitor interaction data to measure campaign performance and optimize landing page variations for advertising.

Manage consent for Prebid.js

ConsentStack automatically detects and manages Prebid.js trackers so your site stays compliant with global privacy regulations.