Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

[pull] master from prebid:master#63

Merged
pull[bot] merged 7 commits intoadhese:masterfrom
prebid:master
Sep 23, 2025
Merged

[pull] master from prebid:master#63
pull[bot] merged 7 commits intoadhese:masterfrom
prebid:master

Conversation

@pull
Copy link

@pull pull bot commented Sep 23, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

carlosfelix and others added 7 commits September 23, 2025 10:11
Co-authored-by: And-Rud <andrii@xe.works>
Co-authored-by: rbstdev <devgit204@xe.works>
Co-authored-by: Godefroi Roussel <groussel@adagio.io>
Co-authored-by: wenyuanzhang <wenyuanzhang@freewheel.tv>
* Add Scope3 Real-Time Data (RTD) module

This module integrates Scope3's Real-Time Data API to provide audience
segments for targeting in Prebid Server auctions.

Features:
- Fetches real-time audience segments from Scope3 API
- Adds targeting data to bid requests via hooks system
- Thread-safe segment storage during auction lifecycle
- Configurable timeout and endpoint settings
- Graceful error handling that doesn't fail auctions

The module implements three hook stages:
- Entrypoint: Initialize module context
- Raw Auction Request: Fetch segments from Scope3 API
- Processed Auction Request: Add segments to targeting data

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add LiveRamp ATS integration and execution order documentation

- Document proper execution order when using with LiveRamp ATS
- Add user identifier detection for RampID integration
- Include configuration examples for sequential module execution
- Enhance API requests with available user identifiers
- Add comprehensive documentation for Yahoo deployment scenario

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add LiveRamp ATS envelope support for publishers without sidecar

- Support forwarding encrypted ATS envelopes directly to Scope3 API
- Check multiple envelope locations: user.ext.liveramp_idl, user.ext.ats_envelope, ext.liveramp_idl
- Prioritize sidecar RampID over envelope when both available
- Document both sidecar and envelope integration patterns
- Add note about Scope3 needing LiveRamp partner authorization

This enables publishers without LiveRamp sidecar to still benefit from
LiveRamp ATS user signals via encrypted envelope forwarding.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Clean up debug code and finalize production-ready Scope3 RTD module

- Remove all debug logging statements
- Streamline segment storage and retrieval between hooks
- Finalize request-level targeting for GAM integration
- Production-ready code with proper error handling
- Complete documentation with configuration examples

The module is now ready for production deployment with:
- Successful Scope3 API integration
- LiveRamp ATS compatibility (sidecar and envelope)
- GAM targeting data output
- Thread-safe segment management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Simplify targeting output to single GAM-compatible format

- Remove duplicate data.scope3_segments array format
- Keep only targeting.hb_scope3_segments as comma-separated string
- Follows standard header bidding targeting key conventions
- Optimized for GAM key-value targeting integration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add unit tests for Scope3 RTD module

- Add basic unit tests for module builder and hook functions
- Test invalid config handling and error cases
- Test entrypoint hook initialization
- Test processed auction hook with no segments
- Satisfy CI requirements for test coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix Go formatting issues

- Remove trailing whitespace in module.go
- Add missing newline at end of module_test.go
- Satisfy gofmt validation requirements

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Address PR feedback: Add caching, improve LiveRamp integration, enhance configurability

Key improvements based on reviewer feedback:
- Add intelligent caching with configurable TTL to handle repeated requests
- Set 60-second default cache TTL for frequency cap compatibility
- Improve LiveRamp identifier detection across multiple locations
- Remove unsubstantiated partnership claims and improve documentation
- Add cache_ttl_seconds and bid_meta_data configuration options
- Implement MD5-based cache keys from user IDs and site context
- Add comprehensive test coverage for new caching functionality
- Update documentation to explain targeting vs bid.meta approach
- Change default timeout to 1000ms for better API compatibility

Addresses concerns about:
- Performance with hundreds of identical requests per user session
- Flexibility in targeting data output (bid.meta future enhancement noted)
- Accurate LiveRamp integration documentation
- Proper hook implementation code naming

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Complete PR feedback implementation: Response-level segments with GAM targeting

Major changes to address all PR reviewer feedback:

**Response Format Changes:**
- Move from request targeting to auction response data per reviewer feedback
- Change hook stage from processed_auction_request to auction_response
- Add segments to response.ext.scope3.segments for publisher control
- Add individual GAM targeting keys when add_to_targeting=true (e.g., gmp_eligible=true)

**Configuration Updates:**
- Rename bid_meta_data to add_to_targeting for clarity
- Add comprehensive GAM integration with individual segment keys
- Remove incorrect LiveRamp RTD adapter references from README
- Update hook configuration examples to use auction_response stage

**API Integration Fixes:**
- Correct segment parsing to exclude destination field (triplelift.com)
- Extract only actual segments from imp[].ext.scope3.segments[]
- Maintain working authentication and caching functionality

**Enhanced Testing:**
- Add comprehensive mock API integration tests
- Test both response formats (scope3 + targeting sections)
- Test error handling with mock server responses
- Apply gofmt formatting to all code

**Publisher Benefits:**
- Full control over segment usage via response.ext.scope3.segments
- Optional automated GAM integration via individual targeting keys
- Flexible configuration for different use cases
- Maintains caching for high-frequency scenarios

Addresses all PR reviewer concerns while providing maximum publisher flexibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Address PR feedback: Add optimized HTTP Transport for high-frequency API calls

  Per reviewer feedback (@gravelg): 'if we're going to be make a lot of calls,
  we should use a Transport with better defaults'

  - MaxIdleConns: 100 (increased connection pool)
  - MaxIdleConnsPerHost: 10 (multiple connections per host)
  - IdleConnTimeout: 90s (longer connection reuse)
  - ForceAttemptHTTP2: true (HTTP/2 for better performance)
  - DisableCompression: false (bandwidth optimization)

  🤖 Generated with [Claude Code](https://claude.ai/code)
  Co-Authored-By: Claude <noreply@anthropic.com>

* run gofmt

* update default endpoint

* fix test

* address comments

* more review comments

* address more comments

* remove unused enhanceRequestWithUserIDs method

* jsonutil, add more tests

* Add privacy field masking for Scope3 RTD module

Implement comprehensive privacy protection by masking sensitive user data
before sending bid requests to the Scope3 API while preserving essential
targeting capabilities.

Features:
- Configurable field masking with privacy-first defaults
- Geographic data truncation with configurable precision (default: 2 decimals ~1.1km)
- Identity provider filtering with allowlist for preserved EIDs
- Always removes: IP addresses, user IDs, demographics, first-party data
- Always preserves: device characteristics, country/region, site/app context
- Comprehensive test coverage (92.3%) with edge case handling
- All linting checks pass with zero issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix cache key generation for proper per-user caching

- Use SHA-256 hashed user.id as fallback when privacy-safe identifiers are unavailable
- Maintains per-user cache segmentation for performance while protecting privacy
- Privacy-safe identifiers (RampID, LiverampIDL) take priority over hashed user.id
- Prevents accidental data leakage by returning nil on masking failures
- Add configuration validation for geo precision (max 4 decimal places)
- Add comprehensive tests for cache key behavior and configuration validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix gofmt formatting in module_test.go

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* review fixes

* more review comments

* make it async

* address more comments

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Gabriel Gravel <ggravel@scope3.com>
@pull pull bot locked and limited conversation to collaborators Sep 23, 2025
@pull pull bot added the ⤵️ pull label Sep 23, 2025
@pull pull bot merged commit 8137d93 into adhese:master Sep 23, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Comments