Overview
The Cross-Media Measurement API enables privacy-preserving measurement across multiple data providers using multi-party computation. This page explains the core concepts, architecture, and terminology you need to understand to work effectively with the API.Architecture
The Cross-Media Measurement system consists of four primary components that work together to enable privacy-preserving measurements:Kingdom
The Kingdom is the central coordination service that:- Manages all API resources (MeasurementConsumers, DataProviders, Measurements, etc.)
- Orchestrates the measurement workflow
- Creates Requisitions when Measurements are requested
- Distributes computation work to Duchies
- Returns encrypted results to MeasurementConsumers
The Kingdom never sees raw user-level data. It only coordinates the measurement process and manages metadata.
Duchies
Duchies are independent computation nodes that perform multi-party computation:- Multiple Duchies work together to compute measurement results
- Each Duchy only sees encrypted shares of the data
- No single Duchy can reconstruct the original data
- Duchies are operated by independent entities to maintain trust
Data Providers (EDPs)
Data Providers are entities that contribute event data for measurements:- Publishers - Media companies with impression/view data
- Panel Providers - Research companies with panel data
- Each Data Provider fulfills Requisitions by encrypting and uploading data
- Data is encrypted such that only Duchies can process it
Measurement Consumers
Measurement Consumers request and consume measurement results:- Advertisers - Brands measuring campaign effectiveness
- Agencies - Media agencies measuring for clients
- Researchers - Academic or market researchers
Resource Model
The API follows a resource-oriented design. Understanding the relationships between resources is key to using the API effectively.Core Resources
MeasurementConsumer
A consumer of measurement results (advertiser, agency, etc.).measurementConsumers/{measurement_consumer}
Key fields:
certificate_der- X.509 certificate used to verify signaturespublic_key- Encryption public key for receiving encrypted resultsowners- Account resources that have permission to manage this MeasurementConsumer
DataProvider
A provider of event data (publisher, panel provider, etc.).dataProviders/{data_provider}
Key fields:
required_duchies- Specific Duchies that must participate when this DataProvider is involvedcapabilities- Indicates which MPC protocols this DataProvider supportsdata_availability_intervals- Time ranges when data is available by ModelLine
Measurement
A measurement request computing reach, frequency, impressions, or other metrics.measurementConsumers/{measurement_consumer}/measurements/{measurement}
Measurement states:
AWAITING_REQUISITION_FULFILLMENT- Waiting for DataProviders to fulfill RequisitionsCOMPUTING- Duchies are performing computationSUCCEEDED- Complete, results availableFAILED- Failed with error details infailurefieldCANCELLED- Cancelled by MeasurementConsumer
Requisition
A request for data from a specific DataProvider for a Measurement.dataProviders/{data_provider}/requisitions/{requisition}
Requisition states:
UNFULFILLED- Not yet fulfilled by DataProviderFULFILLED- DataProvider has provided dataREFUSED- DataProvider declined to fulfill (with justification)WITHDRAWN- Cancelled by system
Requisitions are created automatically by the Kingdom when a Measurement is created. DataProviders cannot create Requisitions directly.
EventGroup
A grouping of events defined by a DataProvider (e.g., a campaign or creative).dataProviders/{data_provider}/eventGroups/{event_group}
Key concepts:
- EventGroups organize events by campaign, creative, or other logical grouping
measurement_consumerlinks the EventGroup to a specific advertiser/agencydata_availability_intervalspecifies when events are availableevent_group_metadatacontains campaign identifiers and metadata
Supporting Resources
Certificate
An X.509 certificate used for digital signatures and verification.- Created for MeasurementConsumers, DataProviders, and Duchies
- Revoked if compromised
- Placed on HOLD temporarily
ApiKey
An authentication key for service-to-service API access.measurementConsumers/{measurement_consumer}/apiKeys/{api_key}
Measurement Workflow
Understanding the end-to-end workflow helps you understand how the components interact:MeasurementConsumer creates a Measurement
The MeasurementConsumer calls
CreateMeasurement with:- Signed
MeasurementSpecdefining the metric (reach, frequency, etc.) - List of DataProviders to include
- Differential privacy parameters
- VID sampling interval
Kingdom creates Requisitions
The Kingdom automatically creates one Requisition per DataProvider, each containing:
- Encrypted
RequisitionSpecwith EventGroup details - Collection interval (time range)
- Filter criteria
DataProviders fulfill Requisitions
Each DataProvider:
- Receives notification of new Requisition
- Decrypts the RequisitionSpec
- Queries their event data matching the criteria
- Encrypts the data for each Duchy
- Uploads encrypted data to Duchies
- Marks Requisition as FULFILLED
Duchies perform computation
Once all Requisitions are fulfilled:
- Duchies coordinate to perform multi-party computation
- No Duchy sees raw data - only encrypted shares
- Differential privacy noise is added during computation
- Result is encrypted with MeasurementConsumer’s public key
Key Terminology
Privacy & Security Terms
Multi-Party Computation (MPC) : A cryptographic protocol that allows multiple parties to jointly compute a function while keeping their inputs private. In this API, Duchies use MPC to compute measurements without seeing raw user data. Differential Privacy : A mathematical framework for privacy that adds calibrated noise to results. This prevents inference attacks even when multiple measurements are combined. Epsilon (ε) : The privacy budget parameter in differential privacy. Lower values provide stronger privacy but less accuracy. Typical values: 0.001 to 1.0. Delta (δ) : The failure probability in differential privacy. Represents the probability that privacy is not preserved. Typically set to 1e-12 or smaller. Virtual ID (VID) : A pseudonymous identifier used to represent users across systems. VIDs enable cross-provider measurement while preserving privacy.Measurement Terms
Reach : The number of unique users (VIDs) who had at least one impression event. This is the count of distinct individuals reached. Frequency : A distribution showing how many times each user was exposed. For example, “30% of users saw the ad exactly 3 times.” Impression : A single event representing an ad view, video view, or other exposure. Watch Duration : Total time spent watching video content, aggregated across all users. Population : The size of a user population, used as a denominator for computing rates.Protocol Terms
Liquid Legions v2 : An MPC protocol for computing reach and frequency using homomorphic encryption and secure sketches. Reach-Only Liquid Legions v2 : An optimized variant of Liquid Legions v2 for computing only reach (not frequency). Honest Majority Share Shuffle (HMSS) : An MPC protocol that assumes an honest majority of participants and uses secret sharing for efficiency. Deterministic Count/Sum : Direct computation methods where a single DataProvider computes the result without MPC.Resource Terms
ModelLine : A specific VID model configuration used for a measurement. Different ModelLines may use different matching algorithms. RequisitionSpec : A specification defining which events should be included in a Requisition (time range, EventGroups, filters). MeasurementSpec : A specification defining the measurement type, privacy parameters, and VID sampling. Nonce : A random number used once to prevent replay attacks and ensure uniqueness. SignedMessage : A message with a digital signature that can be verified using an X.509 certificate. EncryptedMessage : A message encrypted using public key encryption, which can only be decrypted by the holder of the corresponding private key.Advanced Concepts
VID Sampling
To reduce computation costs, you can sample a subset of VIDs:start=0.0, width=0.1 samples 10% of VIDs.
When using VID sampling, scale up the reach result by
1 / width to estimate total reach.Noise Mechanisms
Different protocols use different noise mechanisms:- GAUSSIAN - Adds Gaussian (normal) noise
- DISCRETE_GAUSSIAN - Adds discrete Gaussian noise (integer values)
- LAPLACE - Adds Laplace noise (rare in this API)
noise_mechanism field in results indicates which was used.
Data Availability
DataProviders specify when data is available using intervals:Certificate Preference
When multiple certificates exist, preference is determined by:- Not revoked (highest priority)
- Within validity period
- Later expiration date
- Later start date (lowest priority)
Best Practices
Privacy Budget Management
Best practices:- Use higher epsilon (e.g., 0.1) for exploratory analysis
- Use lower epsilon (e.g., 0.001) for final reporting
- Limit the number of measurements on the same time period and population
Error Handling
Measurements can fail for various reasons:failure field when state = FAILED.
Resource Naming
Resource names follow consistent patterns:measurementConsumers/{mc_id}/measurements/{measurement_id}dataProviders/{dp_id}/eventGroups/{event_group_id}dataProviders/{dp_id}/requisitions/{requisition_id}
Next Steps
Now that you understand the core concepts, explore:Resource Model
Detailed resource relationships and hierarchies
Measurements
Deep dive into measurement types and specifications
Multi-Party Computation
How MPC protocols work in detail
Creating Measurements
Practical guide to creating measurements
