Overview
An EventGroup is a logical grouping of events defined by a DataProvider. EventGroups represent collections of user interaction data such as ad impressions, video views, or app interactions. They serve as the fundamental unit of data organization for measurements.What is an EventGroup?
EventGroups organize events based on business logic:- Advertising Campaign: All impressions for a specific campaign
- Creative: All views of a particular creative asset
- App Install Campaign: All app install events from a promotion
- Content Episode: All watch events for a TV episode
- Publisher Inventory: All ad events on a specific website
EventGroups provide the abstraction that allows measurements to query specific subsets of a DataProvider’s event data without requiring access to raw event logs.
Resource Definition
- Canonical:
dataProviders/{data_provider}/eventGroups/{event_group} - Alternative:
measurementConsumers/{measurement_consumer}/eventGroups/{event_group}
Core Fields
MeasurementConsumer Association
- Required at creation and cannot be changed
- Links events to the entity that can measure them
- Enables access control and data governance
- Supports multi-tenant data sharing
A DataProvider can create EventGroups for multiple different MeasurementConsumers, keeping data logically separated.
Event Group Reference ID
- External identifier from DataProvider’s system
- Helps DataProviders synchronize metadata
- Not used for API operations (use resource name instead)
- Useful for debugging and reconciliation
Media Types
- Determines compatible EventTemplates
- Enables media-specific filtering
- Supports cross-media attribution
Event Templates
- Defines the schema of events in this EventGroup
- Specifies which protobuf message types represent events
- Enables type-safe event processing
Event templates are being replaced by media_types in future versions, but should be set alongside media_types during the transition period.
Data Availability Interval
start_time: When events began (campaign start date)end_time: When events ended (campaign end date, or omitted if ongoing)- Events outside this interval are not available for measurement
- Ad Campaign: Start and end dates of campaign flight
- TV Series: Premiere date to finale date
- Ongoing Service: Start date with no end date
Event Group Metadata
Encrypted Metadata
- DataProvider creates Metadata message
- Serializes metadata using descriptor
- Encrypts using MeasurementConsumer’s public key
- Sets encrypted_metadata field
- Campaign details (name, advertiser, budget)
- Creative attributes (format, dimensions)
- Targeting criteria (demographics, interests)
- Custom business metadata
Metadata is encrypted so only the MeasurementConsumer can read it. The CMMS system and other DataProviders cannot access this information.
Public Metadata (EventGroupMetadata)
- Publicly shareable attributes
- System-level metadata
- Searchable/filterable properties
Metadata Descriptors
EventGroupMetadataDescriptors define metadata schemas: Resource Pattern:dataProviders/{data_provider}/eventGroupMetadataDescriptors/{descriptor}
Purpose:
- Define custom metadata structures
- Enable type-safe metadata handling
- Support evolution of metadata schemas
State Lifecycle
ACTIVE
- EventGroup is available for measurements
- Can be referenced in RequisitionSpecs
- Metadata can be updated
DELETED
- EventGroup has been deleted
- All mutable optional fields are cleared
- Cannot be used in new measurements
- Terminal state - cannot be reactivated
Deleting an EventGroup does not affect existing measurements that already reference it. Only new measurements are prevented from using deleted EventGroups.
Creating an EventGroup
When creating an EventGroup, you must provide:Required Fields
- measurement_consumer: Resource name of associated MeasurementConsumer
- media_types: At least one media type
- event_group_metadata: Public metadata
- data_availability_interval.start_time: When events begin
Optional Fields
- event_group_reference_id: Your external identifier
- event_templates: Event schema definitions
- encrypted_metadata: Private metadata for MeasurementConsumer
- measurement_consumer_public_key: For encrypting metadata
- data_availability_interval.end_time: When events end (if bounded)
Using EventGroups in Measurements
EventGroups are referenced in RequisitionSpecs when creating Measurements:Collection Interval
Specifies the time range of events to include from the EventGroup:- Collection interval should fall within data_availability_interval
- Can be narrower than availability (query subset of time)
- If outside availability, DataProvider may refuse requisition
- EventGroup availability: 2024-01-01 to 2024-12-31 (full year)
- Measurement collection: 2024-01-01 to 2024-01-31 (January only)
Event Filters
Optional filters to select specific events within the EventGroup:- Filter by creative ID
- Filter by geographic region
- Filter by device type
- Custom attribute filtering
Filtering capabilities depend on what fields are available in the event data and supported by the DataProvider.
Aggregated Activity
EventGroups can include activity summaries:- Provide summary statistics about event activity
- Help MeasurementConsumers understand data availability
- Enable trend analysis
view = WITH_ACTIVITY_SUMMARY
EventGroup Views
- Standard fields only
- No aggregated_activities
- Faster, less data transfer
- Includes aggregated_activities field
- Provides activity summaries
- More data transfer
Best Practices
EventGroup Design
- Logical Grouping: Group events by meaningful business units (campaigns, creatives, etc.)
- Granularity: Not too broad (all events) or too narrow (one event per group)
- Stability: Avoid frequent creation/deletion; update existing EventGroups when possible
- Naming: Use descriptive event_group_reference_id for easy identification
Metadata Management
- Encrypt Sensitive Data: Use encrypted_metadata for proprietary information
- Public Metadata: Use event_group_metadata for non-sensitive, searchable attributes
- Schema Evolution: Use EventGroupMetadataDescriptors to manage schema changes
- Key Management: Securely manage encryption keys for metadata
Data Availability
- Accurate Intervals: Set data_availability_interval to match actual data retention
- Update Intervals: Update end_time when campaigns conclude
- Buffer Time: Consider data pipeline delays when setting availability
- Unbounded Groups: Use open-ended intervals for ongoing data collection
Performance
- Batch Creation: Create multiple EventGroups in parallel when possible
- Listing Optimization: Use filters and field masks to reduce response size
- View Selection: Only request WITH_ACTIVITY_SUMMARY when needed
- Caching: Cache EventGroup metadata locally to reduce API calls
Common Patterns
Campaign-Based EventGroups
Publisher Inventory EventGroups
Content-Based EventGroups
Troubleshooting
EventGroup Not Usable in Measurement
Possible Causes:- EventGroup state is DELETED
- measurement_consumer doesn’t match Measurement owner
- collection_interval outside data_availability_interval
- Incompatible media_types or event_templates
Metadata Decryption Fails
Possible Causes:- Wrong encryption key used
- MeasurementConsumer public key rotated
- Corrupted encrypted_metadata
- Version mismatch in encryption format
Requisition Refused
Possible Causes:- collection_interval significantly outside data_availability_interval
- Event data not yet available (pipeline delay)
- EventGroup deleted after Measurement creation
- Invalid event filters
Related Concepts
- Measurements - How EventGroups are used in measurements
- Resource Model - EventGroup’s place in the resource hierarchy
- Differential Privacy - Privacy protection for event data
