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.

Visit website

Consent Categories

Marketing
Analytics

Also Known As

prebidprebid.jsprebid jsheader biddingprebid header biddingclient side biddingprebid demand partners

Industries

Computers Electronics and Technology

Tracked Domains (1)

prebid.orgMarketing

Frequently Asked Questions

Does Prebid.js require cookie consent from visitors?

Yes, Prebid.js requires consent. It orchestrates header bidding auctions that send user identifiers and behavioral signals to dozens of SSPs and DSPs. This cross-domain data sharing for advertising purposes is subject to GDPR, ePrivacy, and other consent regulations governing marketing cookies and ad tracking.

What user data does Prebid.js share during bid auctions?

Prebid.js fires parallel bid requests to multiple advertising demand partners, transmitting page context, user identifiers, and behavioral signals. It coordinates cookie syncing between demand partners for cross-site user matching and manages auction timing, bid responses, and winning creative data passed to the ad server.

How does ConsentStack handle Prebid.js header bidding?

ConsentStack identifies Prebid.js as a marketing and analytics script given its role brokering user data to ad demand partners. When consent is denied, ConsentStack blocks the Prebid.js bundle from loading, preventing bid requests and cookie syncing. Upon consent, the header bidding auction proceeds with configured demand partners.

Related Vendors

Google Ads
Google Ads
Google Ads is Google's advertising platform for search, display, and remarketing campaigns. Conversion tracking scripts fire on advertiser landing pages to measure actions taken after ad clicks. The remarketing tag builds audience lists for retargeting users across Google's ad network.
Google
Google
Google is the dominant provider of web analytics, advertising, and infrastructure tools. Scripts like Google Analytics, Tag Manager, Ads, and reCAPTCHA collect behavioral data, manage tag firing, serve targeted ads, and detect bots. Sets persistent cookies to track users and correlate activity across sites.
Microsoft Dynamics 365
Microsoft Dynamics 365
Microsoft Dynamics 365 is a suite of CRM and ERP applications that integrates with websites through tracking scripts and embedded forms. Web tracking code captures visitor behavior, page views, and form submissions to build customer profiles and score leads. Sets cookies to identify returning visitors and attribute marketing touchpoints across sessions.
Microsoft
Microsoft
Runs Clarity (session recording and heatmaps), the Microsoft Advertising UET tag (conversion tracking), and Bing's remarketing pixel. Clarity injects a recording script that captures mouse movements, clicks, and rage clicks. The UET tag fires conversion events to tie ad clicks to on-site actions across Microsoft's ad network.
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag
Microsoft Advertising UET Tag is the Universal Event Tracking pixel for Microsoft's ad platform, formerly Bing Ads. The JavaScript tag fires on advertiser websites to track page views, conversions, and custom events for campaign optimization. Sets cookies to identify visitors across sessions and attribute conversions to Microsoft Search and Audience Network ad clicks.
LinkedIn Ads
LinkedIn Ads
LinkedIn Ads is LinkedIn's advertising platform for B2B marketing and professional audience targeting. Conversion tracking scripts and pixels fire on advertiser websites to measure sign-ups, downloads, and purchases driven by LinkedIn ad campaigns. Sets cookies for audience matching, retargeting list building, and cross-device attribution reporting.

Manage consent for Prebid.js

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