-
Notifications
You must be signed in to change notification settings - Fork 54
Google Analytics 4 Measurement Protocol
Sends Events or sets User Properties into a GA4 Stream (App or Web) through Measurement Protocol.
GA_4_MEASUREMENT_PROTOCOL
- Google Analytics 4 account id configured in the "Intro" tab.
Column name | Type | Description | Requirement |
---|---|---|---|
uuid | STRING | Unique event identifier defined by the user, used by Megalista to deduplicate events before sending | required |
app_instance_id | STRING | A unique identifier for a Firebase app instance. | required |
name | STRING | The name of the event. | required |
user_id | STRING | A unique identifier for a user. See User-ID for cross-platform analysis for more information on this identifier. | optional |
timestamp_micros | NUMBER | A Unix timestamp (in microseconds) for the time to associate with the event. This should only be set to record events that happened in the past. This value can be overridden via user_property or event timestamps. Events can be backdated up to 3 calendar days based on the property's timezone. | optional |
parameter_1, parameter_2, ..., parameter_n | STRING | Any other column will be sent as an event parameter. | optional |
Column name | Type | Description | Requirement |
---|---|---|---|
uuid | STRING | Unique event identifier defined by the user, used by Megalista to deduplicate events before sending | required |
client_id | STRING | A unique identifier for a client. | required |
name | STRING | The name of the event. | required |
user_id | STRING | A unique identifier for a user. See User-ID for cross-platform analysis for more information on this identifier. | optional |
timestamp_micros | NUMBER | A Unix timestamp (in microseconds) for the time to associate with the event. This should only be set to record events that happened in the past. This value can be overridden via user_property or event timestamps. Events can be backdated up to 3 calendar days based on the property's timezone. | optional |
parameter_1, parameter_2, ..., parameter_n | STRING | Any other column will be sent as an event parameter. | optional |
Note: The user property will be sent along a dummy event named user_property_addition_event
Column name | Type | Description | Requirement |
---|---|---|---|
uuid | STRING | Unique event identifier defined by the user, used by Megalista to deduplicate events before sending | required |
app_instance_id | STRING | A unique identifier for a Firebase app instance. | required |
user_id | STRING | A unique identifier for a user. See User-ID for cross-platform analysis for more information on this identifier. | optional |
timestamp_micros | NUMBER | A Unix timestamp (in microseconds) for the time to associate with the event. This should only be set to record events that happened in the past. This value can be overridden via user_property or event timestamps. Events can be backdated up to 3 calendar days based on the property's timezone. | optional |
user_property_1, user_property_2, ..., user_property_n | STRING | Any other column will represent an user property to be set. The name of the column will be used as the name of the user property and the value of the row will be used as the value of the user property. | required |
Note: The user property will be sent along a dummy event named user_property_addition_event
Column name | Type | Description | Requirement |
---|---|---|---|
uuid | STRING | Unique event identifier defined by the user, used by Megalista to deduplicate events before sending | required |
client_id | STRING | A unique identifier for a client. | required |
user_id | STRING | A unique identifier for a user. See User-ID for cross-platform analysis for more information on this identifier. | optional |
timestamp_micros | NUMBER | A Unix timestamp (in microseconds) for the time to associate with the event. This should only be set to record events that happened in the past. This value can be overridden via user_property or event timestamps. Events can be backdated up to 3 calendar days based on the property's timezone. | optional |
user_property_1, user_property_2, ..., user_property_n | STRING | Any other column will represent an user property to be set. The name of the column will be used as the name of the user property and the value of the row will be used as the value of the user property. | required |
-
Metadata 1:
API Secret
- Required. AnAPI SECRET
generated in the Google Analytics UI. To create a new secret, navigate to:Admin > Data Streams > choose your stream > Measurement Protocol > Create
. -
Metadata 2:
Is Event
- Required. A boolean indicating if this destination will be used to send an event. Accepted values areTRUE
orFALSE
. Must be the opposite ofMetadata 3
, triggers an error otherwise. -
Metadata 3:
Is User Property
- Required. A boolean indicating if this destination will be used to set a user property. Accepted values areTRUE
orFALSE
. Must be the opposite ofMetadata 2
, triggers an error otherwise. -
Metadata 4:
Non Personalized Ads
- Required. A boolean indicating if GA4 should use this event/user property for measurement purposes only. Accepted values areTRUE
(measurement only) orFalse
(measurement and personalized ads). More information can be found on the Help Center. -
Metadata 5:
Firebase App ID
- Required for App Stream. The Firebase App ID. The identifier for a Firebase app. Found in the Firebase console under:Project Settings > General > Your Apps > App ID.
-
Metadata 6:
Measurement ID
- Required for Web Stream. The measurement ID associated with a stream. Found in the Google Analytics UI under:Admin > Data Streams > choose your stream > Measurement ID
At every request successfully sent, Megalista stores its uuid on a temporary table for 15 days. At every new execution, it consults stored uuids and, in case request has already being sent, it prevents it to be sent again. As a result, source table should not maintain events for more than 15 days.
Note: The UUID value should not change for a given line/conversion. If the UUID for a line/conversion changes, this line/conversion would be resent by Megalista, duplicating the data in GA.
The UUID doesn't have to be a Universally Unique Identifier, but any value that uniquely identifies a line/conversion. For instance, a "order id" may be a good candidate for the UUID field if the "order id" is unique.
For web events that have an array of items, the expected schema of the field in BigQuery must be the type of: JSON. check the Recommended web events for GA4 for details: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag
- Home
- Runtime Parameters
- Update instructions
- Configuration Methods
- Schemas
- Appsflyer S2S API
- Google Ads Audiences
- Google Ads Conversions
- Google Analytics
- Google Analytics 4
- Campaign Manager
- Display & Video
- Manual Deployment
- Appendix