Documentation
ΒΆ
Overview ΒΆ
Package scope3 implements a Prebid Server module for Scope3 RTD
Index ΒΆ
- Constants
- func Builder(config json.RawMessage, deps moduledeps.ModuleDeps) (interface{}, error)
- type AsyncRequest
- type Config
- type DeviceMaskingConfig
- type GeoMaskingConfig
- type MaskingConfig
- type Module
- func (m *Module) HandleAuctionResponseHook(ctx context.Context, miCtx hookstage.ModuleInvocationContext, ...) (hookstage.HookResult[hookstage.AuctionResponsePayload], error)
- func (m *Module) HandleEntrypointHook(ctx context.Context, miCtx hookstage.ModuleInvocationContext, ...) (hookstage.HookResult[hookstage.EntrypointPayload], error)
- func (m *Module) HandleRawAuctionHook(ctx context.Context, miCtx hookstage.ModuleInvocationContext, ...) (hookstage.HookResult[hookstage.RawAuctionRequestPayload], error)
- func (m *Module) NewAsyncRequest(req *http.Request) *AsyncRequest
- type Scope3Data
- type Scope3Ext
- type Scope3ExtData
- type Scope3ImpData
- type Scope3Response
- type Scope3Segment
- type UserMaskingConfig
Constants ΒΆ
const DefaultScope3RTDURL = "https://rtdp.scope3.com/prebid/prebid"
Variables ΒΆ
This section is empty.
Functions ΒΆ
func Builder ΒΆ
func Builder(config json.RawMessage, deps moduledeps.ModuleDeps) (interface{}, error)
Builder is the entry point for the module This is called by Prebid Server to initialize the module
Types ΒΆ
type AsyncRequest ΒΆ
type AsyncRequest struct {
*Module
// For managing the lifecycle of the request
// Context is used to pass to the request. This should be the context of the original request
Context context.Context
// Cancel can be called to cancel the request
Cancel context.CancelFunc
// DoneChannel will be closed when the request is done. When nil, no request was made
Done chan struct{}
// Response
Segments []string
Err error
}
type Config ΒΆ
type Config struct {
Endpoint string `json:"endpoint"`
AuthKey string `json:"auth_key"`
Timeout int `json:"timeout_ms"`
CacheTTL int `json:"cache_ttl_seconds"` // Cache segments for this many seconds
CacheSize int `json:"cache_size"` // Maximum size of segment cache in bytes
AddToTargeting bool `json:"add_to_targeting"` // Add segments as individual targeting keys
Masking MaskingConfig `json:"masking"` // Privacy masking configuration
}
Config holds module configuration
type DeviceMaskingConfig ΒΆ
type DeviceMaskingConfig struct {
PreserveMobileIds bool `json:"preserve_mobile_ids"` // Keep mobile advertising IDs (default: false)
}
DeviceMaskingConfig controls device data masking
type GeoMaskingConfig ΒΆ
type GeoMaskingConfig struct {
PreserveMetro bool `json:"preserve_metro"` // DMA code (default: true)
PreserveZip bool `json:"preserve_zip"` // Postal code (default: true)
PreserveCity bool `json:"preserve_city"` // City name (default: false)
LatLongPrecision int `json:"lat_long_precision"` // Decimal places for lat/long (0-4, default: 2)
}
GeoMaskingConfig controls geographic data masking
type MaskingConfig ΒΆ
type MaskingConfig struct {
Enabled bool `json:"enabled"`
Geo GeoMaskingConfig `json:"geo"`
User UserMaskingConfig `json:"user"`
Device DeviceMaskingConfig `json:"device"`
}
MaskingConfig controls what user data is masked before sending to Scope3
type Module ΒΆ
type Module struct {
// contains filtered or unexported fields
}
Module implements the Scope3 RTD module
func (*Module) HandleAuctionResponseHook ΒΆ
func (m *Module) HandleAuctionResponseHook( ctx context.Context, miCtx hookstage.ModuleInvocationContext, payload hookstage.AuctionResponsePayload, ) (hookstage.HookResult[hookstage.AuctionResponsePayload], error)
HandleAuctionResponseHook adds targeting data to the auction response
func (*Module) HandleEntrypointHook ΒΆ
func (m *Module) HandleEntrypointHook( ctx context.Context, miCtx hookstage.ModuleInvocationContext, payload hookstage.EntrypointPayload, ) (hookstage.HookResult[hookstage.EntrypointPayload], error)
HandleEntrypointHook initializes the module context with a sync.Map for storing segments
func (*Module) HandleRawAuctionHook ΒΆ
func (m *Module) HandleRawAuctionHook( ctx context.Context, miCtx hookstage.ModuleInvocationContext, payload hookstage.RawAuctionRequestPayload, ) (hookstage.HookResult[hookstage.RawAuctionRequestPayload], error)
HandleRawAuctionHook is called early in the auction to fetch Scope3 data
func (*Module) NewAsyncRequest ΒΆ
func (m *Module) NewAsyncRequest(req *http.Request) *AsyncRequest
NewAsyncRequest creates a new AsyncRequest object The request's context is used to create a cancellable context for the async request and, which spans multiple hooks
type Scope3Data ΒΆ
type Scope3Data struct {
Destination string `json:"destination"`
Imp []Scope3ImpData `json:"imp"`
}
type Scope3Ext ΒΆ
type Scope3Ext struct {
Scope3 *Scope3ExtData `json:"scope3"`
}
type Scope3ExtData ΒΆ
type Scope3ExtData struct {
Segments []Scope3Segment `json:"segments"`
Macro string `json:"macro"`
}
type Scope3ImpData ΒΆ
type Scope3Response ΒΆ
type Scope3Response struct {
Data []Scope3Data `json:"data"`
}
Response types for Scope3 API
type Scope3Segment ΒΆ
type Scope3Segment struct {
ID string `json:"id"`
}
type UserMaskingConfig ΒΆ
type UserMaskingConfig struct {
PreserveEids []string `json:"preserve_eids"` // List of EID sources to preserve
}
UserMaskingConfig controls user data masking