Overview
A Measurement represents a privacy-preserving computation requested by a MeasurementConsumer to analyze event data across multiple DataProviders. Measurements enable cross-media analytics while protecting individual user privacy through differential privacy and multi-party computation.Measurement Types
The API supports five core measurement types, each designed for specific analytics use cases:Reach
Measures the number of unique users (VIDs) who were exposed to impression events.- Campaign reach analysis
- Unique audience measurement
- Cross-publisher deduplication
Reach values are always non-negative. Negative values from differential privacy noise are automatically clamped to 0.
Reach and Frequency
Measures both unique reach and the distribution of how many times users were exposed.- Frequency capping analysis
- Effective frequency optimization
- Multi-touch attribution preparation
Impression
Counts the total number of impression events across all users.- Total delivery verification
- CPM calculations
- Campaign pacing
Watch Duration
Measures total watch time across all users for video content.- Total viewing time analysis
- Engagement metrics
- Content performance measurement
Population
Measures the total population size without privacy noise.- Panel size verification
- Universe estimation
- Denominator for reach calculations
Population measurements do not include differential privacy noise since they measure aggregate totals, not individual-level data.
Measurement Lifecycle
Measurements progress through a well-defined state machine:State Descriptions
AWAITING_REQUISITION_FULFILLMENT- Initial state when a Measurement is created
- Waiting for all linked Requisitions to be fulfilled by DataProviders
- DataProviders encrypt and upload their event data during this phase
- All Requisitions have been fulfilled
- Duchies are performing multi-party computation
- No individual DataProvider can see other providers’ data
- Differential privacy noise is being applied
- Computation completed successfully
- Results are encrypted and available in the
resultsfield - MeasurementConsumer can decrypt results using their private key
- Computation could not complete
- The
failurefield contains details about why it failed - Common reasons: certificate revoked, requisition refused, computation error
- MeasurementConsumer cancelled the measurement
- No results will be produced
Creating a Measurement
When creating a Measurement, you must provide:1. MeasurementSpec
The specification defines what to measure:measurement_public_key: Encryption key for resultsnonce_hashes: Security nonces from DataProviderEntriesvid_sampling_interval: VID sampling range [0.0, 1.0]measurement_type: One of the five measurement types with privacy parametersmodel_line: The VID model to use for identity resolution
2. DataProviderEntries
Specifies which DataProviders and EventGroups to measure:Each DataProviderEntry contains an encrypted RequisitionSpec that specifies which EventGroups to include and the collection time interval.
3. Certificate
Reference to the MeasurementConsumer’s certificate for signature verification:VID Sampling
VID sampling allows measuring a subset of users for efficiency:{start: 0.0, width: 1.0}- Include all users (100% sample){start: 0.0, width: 0.1}- Include 10% of users{start: 0.8, width: 0.5}- Wrapping interval: [0.8, 1.0] ∪ [0.0, 0.3]
Measurement Results
Results are encrypted and signed for security:- Retrieve the
encrypted_resultfrom the Measurement - Decrypt using the MeasurementConsumer’s private key (corresponding to
measurement_public_key) - Verify the signature using the
certificate - Deserialize to get the
Resultmessage
Multiple
ResultOutput entries may be present for different computation stages or verification purposes.Failure Handling
When a Measurement fails, examine thefailure field:
| Reason | Description | Resolution |
|---|---|---|
CERTIFICATE_REVOKED | A certificate was revoked | Check certificate status, re-create with valid certificate |
REQUISITION_REFUSED | DataProvider refused to fulfill | Check refusal justification in Requisition |
COMPUTATION_PARTICIPANT_FAILED | Duchy computation failed | Retry or contact system administrator |
Protocol Selection
The system automatically selects an appropriate computation protocol based on:- Measurement type
- DataProvider capabilities
- Available Duchies
- Privacy parameters
protocol_config (output-only field).
Supported Protocols:
- Liquid Legions V2: Reach and frequency MPC protocol
- Reach-Only Liquid Legions V2: Optimized for reach-only measurements
- Honest Majority Share Shuffle: Alternative MPC protocol
- Direct: DataProvider computes directly (single-party)
- TrusTEE: Trusted execution environment protocol
See Multi-Party Computation for details on how protocols work.
Differential Privacy
All measurements include differential privacy noise to protect individual user privacy:- Lower epsilon: More privacy, more noise, less accuracy
- Higher epsilon: Less privacy, less noise, more accuracy
- Delta: Probability of privacy breach
Best Practices
Measurement Design
- Choose appropriate measurement type based on your analytics needs
- Set realistic privacy parameters balancing privacy and utility
- Use VID sampling for large populations to reduce computation time
- Include sufficient EventGroups to get meaningful cross-media insights
Error Handling
- Poll Measurement state to detect completion or failure
- Check Requisition states if stuck in AWAITING_REQUISITION_FULFILLMENT
- Handle failures gracefully with appropriate retry logic
- Validate inputs before creating Measurements to avoid failures
Security
- Protect private keys used for decrypting results
- Verify signatures on results using certificates
- Rotate certificates according to your security policy
- Use unique nonces for each Measurement to prevent replay attacks
Related Concepts
- Resource Model - Understanding the API resource hierarchy
- Multi-Party Computation - How secure computation works
- Differential Privacy - Privacy protection mechanisms
- Event Groups - Organizing event data for measurements
