Resource
EventGroup
A grouping of events defined by aDataProvider. For example, a single campaign or creative defined in a publisher’s ad system.
Resource name patterns:
dataProviders/{data_provider}/eventGroups/{event_group}(canonical)measurementConsumers/{measurement_consumer}/eventGroups/{event_group}
Resource name identifier.
Resource name of the
MeasurementConsumer associated with this EventGroup. Required, immutable.ID referencing the
EventGroup in an external system, provided by the DataProvider. This value should be used to help the DataProvider synchronize their metadata with the EventGroupsService.The MediaTypes of the events entailed by this
EventGroup. These are used to derive the EventTemplates that the events associated with this EventGroup conform to.Metadata that describes the events entailed by the EventGroup.
The
EventTemplates that events associated with this EventGroup conform to.In a future release, this field will be deprecated in favor of setting media_types, but should continue to be set alongside media_types until it is formally marked deprecated. It will be deprecated no sooner than the Halo CMM 0.6 release.Metadata encrypted using the measurement_consumer_public_key as the recipient public key.The version of the Metadata message type must match the API version used to last update this resource.In a future release this field will be deprecated and replaced by event_group_metadata but until this field is marked deprecated it should continue to be written alongside event_group_metadata. It will be deprecated no sooner than the Halo CMM 0.6 release.Pre-shared packed
EncryptionPublicKey. Must be set if encrypted_metadata is set.The version of the EncryptionPublicKey message must match the API version used to last update this resource.This field will be deprecated in a future release. See encrypted_metadata for additional information.Event Group state. Output only.Possible values:
STATE_UNSPECIFIED- The default value if state is omitted. Should not be used.ACTIVE- The Event Group has been createdDELETED- The Event Group has been deleted. An Event Group in a DELETED state will have all mutable optional fields cleared. This state is terminal.
Interval for which this
EventGroup has events.When this field is specified, start_time is required. If end_time is not specified, the interval is considered unbounded.If this EventGroup represents an ad campaign, this is typically the start and end times of the campaign.A summary of EventGroupActivity resources for this EventGroup.Only set when the view is
WITH_ACTIVITY_SUMMARY. Output only.EventTemplate
Template for an event message.The type of the Event Template. A fully-qualified protobuf message type.
AggregatedActivity
Aggregated EventGroupActivity for a contiguous date interval.Aggregated interval.
View Enum
View of anEventGroup.
VIEW_UNSPECIFIED- The default/unset value. The API will default to theBASICview unless otherwise specified by the method.BASIC- Basic viewWITH_ACTIVITY_SUMMARY- View with activity summary
Methods
GetEventGroup
Returns theEventGroup with the specified resource key.
Request
Resource name of the EventGroup.Format:
dataProviders/{data_provider}/eventGroups/{event_group}The view of EventGroup to return. Defaults to
BASIC.EventGroup resource.
Example
CreateEventGroup
Creates (registers) aEventGroup defined in the specified DataProvider’s system.
Request
Resource name of the parent
DataProvider.Format: dataProviders/{data_provider}The
EventGroup to create.The name field will be ignored, and the system will assign an ID.Required fields:measurement_consumer: Resource name of the associated MeasurementConsumermedia_types: MediaTypes of the eventsevent_group_metadata: Metadata describing the eventsdata_availability_interval: Interval for which events are available
Unique identifier for this request. If specified, the request will be idempotent. See https://google.aip.dev/155.
EventGroup resource.
Example
BatchCreateEventGroups
Batch createsEventGroups. Results in an error if any of the specified EventGroups fail to be created.
Request
Resource name of the parent
DataProvider.Format: dataProviders/{data_provider}The requests specifying the
EventGroups to create. Either all requests must have the same parent and the parent must match the top-level parent, or all requests must leave the parent unset.A maximum of 50 EventGroups can be created in a single batch.The
EventGroup resources.UpdateEventGroup
Updates an existingEventGroup. Results in a PERMISSION_DENIED error if the authenticated user does not have access to the EventGroup. Results in a NOT_FOUND error if the specified EventGroup does not exist.
Request
The
EventGroup to update. The name field is used to identify the resource to update.Note: This is a full replacement update, not a partial update.EventGroup resource.
Example
- This performs a full replacement update.
- Partial updates are not supported.
- The
namefield identifies which EventGroup to update. - Immutable fields cannot be changed.
BatchUpdateEventGroups
Batch updatesEventGroups. Results in an error if any of the specified EventGroups fail to be updated.
Request
Resource name of the parent
DataProvider.Format: dataProviders/{data_provider}The requests specifying the
EventGroups to update. Either all requests must have the same parent and the parent must match the top-level parent, or all requests must leave the parent unset.A maximum of 50 EventGroups can be updated in a single batch.The
EventGroup resources.DeleteEventGroup
Deletes an existingEventGroup. EventGroup will transition to a DELETED state and will have all of its mutable optional fields cleared. This action is irreversible. Results in a PERMISSION_DENIED error if the authenticated user does not have access to the EventGroup. Results in a NOT_FOUND error if the specified EventGroup does not exist.
Request
Resource name of the EventGroup to delete.Format:
dataProviders/{data_provider}/eventGroups/{event_group}EventGroup resource with state set to DELETED and mutable optional fields cleared.
Example
- Deletion is irreversible.
- The EventGroup transitions to
DELETEDstate (terminal). - All mutable optional fields are cleared.
- The resource remains visible but cannot be used in new measurements.
ListEventGroups
ListsEventGroups. Results in a PERMISSION_DENIED error if attempting to list EventGroups that the authenticated user does not have access to.
Request
Resource name of the parent.Format:
dataProviders/{data_provider}The maximum number of resources to return. The service may return fewer than this value.If unspecified, at most 10 resources will be returned. The maximum value is 500; values above this will be coerced to the maximum.
A token from a previous call, specified to retrieve the next page. See https://aip.dev/158.
Filter criteria for this request.
Whether to include EventGroups in the DELETED state. Defaults to false.
How results should be ordered.
The view of EventGroup to return. Defaults to
BASIC.The
EventGroup resources.A token that can be specified in a subsequent call to retrieve the next page. See https://aip.dev/158.
Workflow
Creating Event Groups
- Identify Event Source: Determine which campaign or data source the EventGroup represents.
- Prepare Metadata: Collect metadata about the events (campaign info, creative details, etc.).
- Set Media Types: Specify which MediaTypes the events conform to.
- Define Availability: Set the
data_availability_intervalfor when events are available. - Associate Consumer: Specify which MeasurementConsumer this EventGroup is shared with.
- Create Resource: Call
CreateEventGrouporBatchCreateEventGroups.
Updating Event Groups
- Retrieve Current State: Use
GetEventGroupto get the current EventGroup. - Modify Fields: Update the fields you want to change.
- Submit Update: Call
UpdateEventGroupwith the complete updated resource. - Verify Changes: Optionally call
GetEventGroupagain to confirm the update.
Deleting Event Groups
- Identify EventGroup: Determine which EventGroup to delete.
- Call Delete: Use
DeleteEventGroup. - Confirm Deletion: The EventGroup will be in
DELETEDstate. - Note: Deletion is permanent and cannot be reversed.
Listing and Filtering
- Basic Listing: Call
ListEventGroupswith just a parent to get all EventGroups. - Filter by Consumer: Use
filter.measurement_consumer_into find EventGroups for specific consumers. - Filter by Date: Use data availability filters to find EventGroups for specific time periods.
- Search Metadata: Use
filter.metadata_search_queryto search within metadata. - Include Deleted: Set
show_deleted = trueto include deleted EventGroups. - Order Results: Use
order_byto sort by data availability start time.
Best Practices
Data Availability Intervals
- Start Time: Always required. Set to when the first event occurred.
- End Time: Optional. Omit for ongoing campaigns (unbounded interval).
- Accuracy: Only specify intervals where you actually have event data.
- Updates: Update the interval as campaigns progress or end.
Metadata Management
- Completeness: Provide comprehensive metadata to enable accurate filtering and search.
- Consistency: Use consistent naming and formatting across EventGroups.
- Updates: Keep metadata current as campaign details change.
- Privacy: Ensure metadata doesn’t contain sensitive information.
Batch Operations
- Efficiency: Use batch operations when creating or updating multiple EventGroups.
- Limits: Respect the 50 EventGroup limit per batch.
- Error Handling: If any operation fails, the entire batch fails.
- Atomicity: All operations in a batch succeed or all fail together.
State Management
- Active State: Normal operational state for EventGroups.
- Deletion: Only delete EventGroups when they should never be used again.
- Immutability: Some fields like
measurement_consumercannot be changed after creation. - Views: Use appropriate views (BASIC vs WITH_ACTIVITY_SUMMARY) based on your needs.
