This module integrates Scope3's Real-Time Data API to provide audience segments for targeting.
- Email: [email protected]
- Company: Scope3
hooks:
enabled: true
modules:
scope3:
rtd:
enabled: true
auth_key: ${SCOPE3_API_KEY} # Set SCOPE3_API_KEY environment variable
endpoint: https://rtdp.scope3.com/prebid/prebid
timeout_ms: 1000
cache_ttl_seconds: 60 # Cache segments for 60 seconds (default)
add_to_targeting: false # Set to true to add segments as individual targeting keys for GAM
add_scope3_targeting_section: false # Also set targeting in dedicated scope3 section
single_segment_key: "" # When set, adds all segments as a comma separated value under a single targeting key
masking: # Optional privacy masking configuration
enabled: true # Enable field masking before sending to Scope3
geo:
preserve_metro: true # Preserve DMA code (default: true)
preserve_zip: true # Preserve postal code (default: true)
preserve_city: false # Preserve city name (default: false)
lat_long_precision: 2 # Lat/long decimal places: 0-4 (default: 2)
user:
preserve_eids: # EID sources to preserve (default list below)
- "liveramp.com" # RampID
- "uidapi.com" # UID2
- "id5-sync.com" # ID5
device:
preserve_mobile_ids: false # Keep mobile advertising IDs (default: false)
host_execution_plan:
endpoints:
/openrtb2/auction:
stages:
entrypoint:
groups:
- timeout: 5
hook_sequence:
- module_code: "scope3.rtd"
hook_impl_code: "HandleEntrypointHook"
auction_processed:
groups:
- timeout: 2000
hook_sequence:
- module_code: "scope3.rtd"
hook_impl_code: "HandleAuctionProcessedHook"
auction_response:
groups:
- timeout: 5
hook_sequence:
- module_code: "scope3.rtd"
hook_impl_code: "HandleAuctionResponseHook"{
"hooks": {
"modules": {
"scope3": {
"rtd": {
"enabled": true,
"endpoint": "https://rtdp.scope3.com/prebid/prebid",
"auth_key": "your-scope3-auth-key",
"timeout_ms": 1000,
"cache_ttl_seconds": 60,
"add_to_targeting": false,
"add_scope3_targeting_section": false,
"masking": {
"enabled": true,
"geo": {
"preserve_metro": true,
"preserve_zip": true,
"preserve_city": false,
"lat_long_precision": 2
},
"user": {
"preserve_eids": ["liveramp.com", "uidapi.com", "id5-sync.com"]
},
"device": {
"preserve_mobile_ids": false
}
}
}
}
}
}
}SCOPE3_API_KEY: Your Scope3 API key for authentication
This module includes comprehensive privacy masking to protect user data while preserving targeting capabilities. When masking is enabled, sensitive user information is removed or anonymized before being sent to the Scope3 API.
These fields are always passed through without modification as they are not considered sensitive:
Device Information
device.devicetype- Device type (mobile, desktop, CTV, etc.)device.os- Operating systemdevice.osv- OS versiondevice.make- Device manufacturerdevice.model- Device modeldevice.ua- User agent stringdevice.language- Language preferencedevice.connectiontype- Connection type (wifi, cellular, etc.)device.js- JavaScript supportdevice.h/w- Screen dimensionsdevice.ppi- Screen PPIdevice.pxratio- Pixel ratio
Geographic Information (Coarse)
geo.country- Country code (e.g., "US")geo.region- State/region code (e.g., "CA")
Context Information
site.*- All site fields (domain, page, ref, etc.)app.*- All app fieldsimp.*- All impression data (ad sizes, positions, etc.)
These fields are always removed for privacy protection:
Personal Identifiers
device.ip- IPv4 addressdevice.ipv6- IPv6 addressuser.id- Publisher's first-party user IDuser.buyeruid- Exchange-specific user IDuser.yob- Year of birthuser.gender- Genderuser.data- First-party data segmentsuser.keywords- User interest keywords
High-Precision Location
geo.accuracy- GPS accuracy radius
These fields can be configured to be preserved or masked:
Geographic Information (Fine-Grained)
| Field | Default | Options | Privacy Impact |
|---|---|---|---|
geo.metro |
Preserved | preserve/remove | DMA code for regional targeting |
geo.zip |
Preserved | preserve/remove | Postal code for local targeting |
geo.city |
Removed | preserve/remove | City name |
geo.lat/lon |
Truncated to 2 decimals | 0-4 decimals or remove | See precision guide below |
User Identifiers
| Field | Default | Options | Notes |
|---|---|---|---|
user.eids |
Filter to allowlist | List of EID sources | Default: ["liveramp.com", "uidapi.com", "id5-sync.com"] |
Device Identifiers
| Field | Default | Options | Notes |
|---|---|---|---|
device.ifa |
Removed | preserve/remove | Mobile advertising ID |
device.dpidmd5 |
Removed | preserve/remove | Hashed device ID |
device.dpidsha1 |
Removed | preserve/remove | Hashed device ID |
| Other device IDs | Removed | preserve/remove | Various hashed identifiers |
When preserving latitude/longitude coordinates, the precision level has significant privacy implications:
| Decimals | Accuracy | Privacy Level | Use Case |
|---|---|---|---|
| 0 | Removed | Maximum | No location data |
| 1 | ~11 km | Country/State | Regional campaigns |
| 2 | ~1.1 km | Neighborhood (Default) | Store radius matching |
| 3 | ~111 m | City block | Dense urban targeting |
| 4 | ~11 m | Building | Maximum allowed |
masking:
enabled: true
geo:
preserve_metro: false
preserve_zip: false
preserve_city: false
lat_long_precision: 0
user:
preserve_eids: []
device:
preserve_mobile_ids: falsemasking:
enabled: true
geo:
preserve_metro: true
preserve_zip: true
preserve_city: false
lat_long_precision: 2
user:
preserve_eids: ["liveramp.com", "uidapi.com", "id5-sync.com"]
device:
preserve_mobile_ids: falsemasking:
enabled: true
geo:
preserve_metro: true
preserve_zip: true
preserve_city: true
lat_long_precision: 3 # Higher precision for store matching
user:
preserve_eids: ["liveramp.com", "retail-partner.com"]
device:
preserve_mobile_ids: true # For in-store attributionGDPR Compliance
- Removes direct identifiers by default
- Configurable to meet legitimate interest requirements
- Supports privacy-by-design principles
CCPA Compliance
- Removes sale-related identifiers
- Supports consumer privacy rights
- Configurable per jurisdiction requirements
Industry Standards
- Follows IAB OpenRTB privacy guidelines
- Compatible with TCF 2.0 consent frameworks
- Supports Privacy Sandbox initiatives
- Privacy-First Design: Comprehensive field masking to protect user data while preserving targeting
- Flexible Masking: Configurable privacy controls for different use cases and compliance requirements
- Real-Time Segments: Fetches audience segments from Scope3 API with intelligent caching
- Thread-Safe Caching: Handles high-frequency requests with concurrent access protection
- Identity Integration: Supports multiple identity providers (LiveRamp, UID2, ID5, etc.)
- Geographic Privacy: Truncates location data to configurable precision levels
- Graceful Degradation: Continues auction processing even when API errors occur
- Performance Optimized: HTTP/2, connection pooling, and compression for high-traffic scenarios
This module implements intelligent caching and HTTP optimizations to handle high-frequency API requests:
- Cache Key: Generated from user identifiers, site domain, and page URL
- Cache Duration: Configurable via
cache_ttl_seconds(default: 60 seconds) - Thread Safety: Uses read-write mutexes for concurrent access
- Memory Efficiency: Stores only segment arrays, not full API responses
- Frequency Cap Compatibility: Short 60-second default ensures frequency-capped segments are refreshed quickly
- HTTP Optimization: Custom transport with connection pooling, HTTP/2, and compression for better performance
This module automatically detects and forwards available user identifiers from the bid request including:
- LiveRamp identifiers (when available from publisher implementations or identity providers)
- Publisher first-party user IDs
- Device identifiers
- Encrypted identity envelopes
-
LiveRamp Identifiers (when available):
user.ext.eids[]array withsource: "liveramp.com"user.ext.rampidfield (alternative location)
-
Encrypted Identity Envelopes:
user.ext.liveramp_idl- ATS envelope locationuser.ext.ats_envelope- Alternative envelope locationuser.ext.rampId_envelope- Additional envelope locationext.liveramp_idl- Request-level envelope
-
Standard Identifiers:
user.id- Publisher user IDdevice.ifa- Device identifier- Other standard OpenRTB identifiers
The module forwards any fields that are not masked from the bid request to the Scope3 API (please see the Privacy Protection section for more details). Scope3's system can then utilize whatever identifiers are available for audience segmentation, whether they are resolved identifiers or encrypted envelopes that Scope3 may be able to process.
Note: The effectiveness of different identifier types depends on Scope3's integration capabilities and partnerships.
The module adds audience segments to the auction response, giving publishers full control over how to use them:
- Publisher Flexibility: Segments are returned in
ext.scope3.segmentswhen configured for the publisher to decide where to send - Google Ad Manager (GAM): Individual targeting keys are added when
add_to_targeting: true(e.g.,gmp_eligible=true) - Other Ad Servers: Publisher can forward segments to any ad server or system
- Analytics: Segment data is available for reporting and analysis
The module provides segments in two formats:
When add_scope3_targeting_section: true:
{
"ext": {
"scope3": {
"segments": ["gmp_eligible", "gmp_plus_eligible"]
}
}
}When add_to_targeting: true:
{
"ext": {
"prebid": {
"targeting": {
"gmp_eligible": "true",
"gmp_plus_eligible": "true"
}
},
"scope3": {
"segments": ["gmp_eligible", "gmp_plus_eligible"]
}
}
}This approach gives publishers maximum flexibility to:
- Send segments to GAM via targeting keys
- Forward to other ad servers or systems
- Use for analytics and reporting
- Control which segments go where based on their business logic