This folder contains a sample integration combining Prebid.js with Google Secure Signals and UID2/EUID, enabling both header bidding and encrypted identity signals to Google Ad Manager.
This integration combines two powerful frameworks:
- Prebid.js — Manages UID2/EUID token generation (CSTG), refresh, and sends encrypted signals to Google Ad Manager
- Google Ad Manager — Receives encrypted signals directly from Prebid via the Prebid User ID Module
Important: Unlike standalone Secure Signals integrations, this approach does NOT use the separate UID2/EUID Secure Signals SDK. Prebid handles the entire integration natively through its encryptedSignalSources configuration.
The integration requires adding the encryptedSignalSources configuration to Prebid:
pbjs.setConfig({
userSync: {
userIds: [{
name: 'uid2', // or 'euid'
params: {
email: userEmail,
subscriptionId: 'your-sub-id',
serverPublicKey: 'your-public-key'
}
}]
},
// Enable Google Secure Signals integration
encryptedSignalSources: {
sources: [{
source: ['uidapi.com'], // or 'euid.eu' for EUID
encrypt: false
}]
}
});EUID Note: If using EUID, you must configure consent management for GDPR compliance. See the example's
index.htmlfor an implementation usingconsentManagementObj. For more details, see the EUID Permissions documentation.
In your Google Ad Manager account, you must:
- Enable Secure Signals for third-party bidders
- Choose "Prebid User ID Module" as the deployment option
- Enable "Use your Prebid configuration to automatically configure your Secure signals settings"
For details, see:
| Folder | Description | Port |
|---|---|---|
client-side/ |
Prebid.js with Secure Signals using client-side token generation | 3061 |
- UID2: Prebid Guide | Secure Signals Guide
- EUID: Prebid Guide | Secure Signals Guide
The prebid.js file in this folder is a custom Prebid.js build (v10.15.0) that includes:
This integration requires variables for both Prebid.js and Secure Signals. See the individual README for the complete list.
| Variable | Description |
|---|---|
IDENTITY_NAME |
Display name for the UI (UID2 or EUID) |
UID_STORAGE_KEY |
localStorage key for Prebid token storage |
DOCS_BASE_URL |
Used for UI links to public documentation (https://unifiedid.com/docs or https://euid.eu/docs) |
| Variable | Description |
|---|---|
UID_SECURE_SIGNALS_SDK_URL |
URL to the Secure Signals SDK |
UID_SECURE_SIGNALS_STORAGE_KEY |
localStorage key for Secure Signals |
| Variable | Description |
|---|---|
UID_CLIENT_BASE_URL |
API base URL for client-side calls |
UID_CSTG_SUBSCRIPTION_ID |
Your subscription ID for CSTG |
UID_CSTG_SERVER_PUBLIC_KEY |
Your server public key for CSTG |
// Check Prebid token
pbjs.getUserIds()
// Check Secure Signals storage
localStorage.getItem('_GESPSK-uidapi.com') // UID2
localStorage.getItem('_GESPSK-euid.eu') // EUIDdocker compose logs prebid-secure-signals-client-sidedocker compose up -d --build prebid-secure-signals-client-side| Issue | Possible Cause | Solution |
|---|---|---|
| Prebid token present but Secure Signals empty | Secure Signals SDK not loaded | Verify UID_SECURE_SIGNALS_SDK_URL |
| Neither token present | CSTG credentials incorrect | Check subscription ID and public key |
| Video ads not showing | Ad blocker | Disable ad blocker for testing |
Run pbjs.getUserIds() in console. If empty or missing uid2/euid:
- Check console for Prebid errors
- Verify Prebid.js loaded correctly (check Network tab)
- Ensure
pbjs.setConfig()is being called after token generation - Check the browser console for "Configuring Prebid.js with..." message to confirm configuration
- Check that
IDENTITY_NAMEmatches the expected identity type (UID2 or EUID)