Google Analytics 4 Measurement Protocol Connector Setup Guide
This article describes how to set up the Google Analytics 4 Measurement Protocol connector.
Connector Actions
Action Name | AudienceStream | EventStream |
---|---|---|
Send PageView Event (gtag.js) | ✓ | ✓ |
Send Event (gtag.js) | ✓ | ✓ |
Send Firebase Event | ✓ | ✓ |
The Google Analytics 4 Measurement Protocol supplies the following endpoint for validating events: https://google-analytics.com/debug/mp/collect?
. The Tealium Google Analytics 4 Measurement Protocol connector uses this endpoint during Trace, giving you insights into the validation of the event data. You can view Google Analytics 4 Measurement Protocol validation messages in the HTTP Response Content of the API call within Trace.
Configure Settings
Navigate to the Connector Marketplace and add a new connector. For general instructions on how to add a connector, see About Connectors.
After adding the connector, configure the following settings:
- API Secret (Required)
An API Secret generated in the Google Analytics UI. To create a new secret, navigate to: Admin > Data Streams > choose your stream > Measurement Protocol > Create. - Measurement ID (Optional)
The measurement ID associated with a stream. Found in the Google Analytics UI under: Admin > Data Streams > choose your stream > Measurement ID. - Firebase App ID (Optional)
The Firebase App ID. The identifier for a Firebase app. Found in the Firebase console under: Project Settings > General > Your Apps > App ID.
Action Settings - parameters and options
Enter a name for the action and select the action type from the drop-down menu.
The following section describes how to set up parameters and options for each action.
Mapping client ID
Client ID is a required parameter for web-based events that uniquely identifies a user instance of a web client.
Google Analytics stores the client ID in a cookie named _ga
. The format of this cookie is GA1.2.12349876.1500644855
where the client ID is 12349876.150064485
. You should get the clientId
value directly from the Google Analytics tracker.
For more information, see:
- Google tag API reference: get.
- Google Analytics Measurement Protocol > Parameter Reference > Client ID.
Consent
The connector will not send any consent signals by default. If you don’t specify consent, then Google Analytics will use the consent settings from corresponding online interactions for the client instance. Consent states are either granted or denied when setting consent for ad_user_data
and ad_personalization
.
Action - Send PageView Event (gtag.js)
Parameters
Parameter | Description |
---|---|
Client ID | Required. A unique identifier for a client. |
Measurement ID Override | Required. The identifier for a Data Stream. This setting overrides Measurement ID used in the Configuration section. |
API Secret Override | The Measurement Protocol API Secret for the data stream. This setting overrides the API Secret used in the Configuration section. |
User ID | A unique identifier for a user. |
Timestamp Micros | A Unix timestamp (in microseconds) for the time to associate with the event. |
Non Personalized Ads | Set to true to indicate these events should not be used for personalized ads. |
Event Parameters
Parameter | Description |
---|---|
Page Title | The title of the page. |
Page Location | Required. The full URL to the page. |
User-Provided Data
Parameter | Description |
---|---|
Email Address (already SHA256 hashed) | Provide an email address that has been already whitespace trimmed, lowercased and SHA256 hashed. Remove all periods (. ) that precede the domain name in gmail.com and googlemail.com email addresses before hashing. |
Email Address (apply SHA256 hash) | Provide a plaintext email address and the connector will remove all periods (. ) that precede the domain name in gmail.com and googlemail.com email addresses, and whitespace trim, lowercase, and hash this value using SHA256 hash. |
Phone Number (already SHA256 hashed) | Provide a phone number according to the E164 standard that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Phone Number (apply SHA256 hash) | Provide a plaintext phone number and the connector will remove all non-digit symbols, prefix the number with a plus sign (+), whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: First Name (already SHA256 hashed) | Provide first name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: First Name (apply SHA256 hash) | Provide a plaintext first name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Last Name (already SHA256 hashed) | Provide last name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Last Name (apply SHA256 hash) | Provide a plaintext last name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Street Address (already SHA256 hashed) | Provide street address that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Street Address (apply SHA256 hash) | Provide a plaintext street address and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: City | City of the user’s address. |
Address Info: State | State code of the user’s address. |
Address Info: Postal Code | Postal code of the user’s address. |
Address Info: Country | Two-letter country code in ISO-3166-1 alpha-2 format of the user’s address. |
User Properties
Parameter | Description |
---|---|
User Properties | User properties describe segments of user base, such as language preference or geographic location. |
Items Data
Parameter | Description |
---|---|
Item ID | The ID of the item. |
Item Name | The name of the item. |
Affiliation | A product affiliation to designate a supplying company or brick and mortar store location. |
Coupon | The coupon name/code associated with the item. |
Currency | The currency, in 3-letter ISO 4217 format. |
Discount | The monetary discount value associated with the item. |
Index | The index/position of the item in a list. |
Item Brand | The brand of the item. |
Item Category | The category of the item. If used as part of a category hierarchy or taxonomy then this will be the first category. |
Item Category 2 | The second category hierarchy or additional taxonomy for the item. |
Item Category 3 | The third category hierarchy or additional taxonomy for the item. |
Item Category 4 | The fourth category hierarchy or additional taxonomy for the item. |
Item Category 5 | The fifth category hierarchy or additional taxonomy for the item. |
Item List ID | The ID of the list in which the item was presented to the user. |
Item List Name | The name of the list in which the item was presented to the user. |
Item Variant | The item variant or unique code or description for additional item details/options. |
Location ID | The location associated with the item. It’s recommended to use the Google Place ID that corresponds to the associated item. A custom location ID can also be used. |
Price | The monetary price of the item, in units of the specified currency parameter. |
Quantity | Item quantity. |
Additional Parameters
Parameter | Description |
---|---|
Debug | This connector uses the GA4 debug endpoint by default when using Trace. Map a boolean value to override this behavior. |
Consent
Consent states are either granted
or denied
. If you don’t specify consent, then Google Analytics will use the consent settings from corresponding online interactions for the client instance.
Parameter | Description |
---|---|
Ad User Data | Sets consent for sending user data to Google for advertising purposes. |
Ad Personalization | Sets consent for personalized advertising. |
Action - Send Event (gtag.js)
Parameters
Parameter | Description |
---|---|
Client ID | Required. A unique identifier for a client. |
Measurement ID Override | Required. The identifier for a Data Stream. This setting overrides Measurement ID used in the Configuration section. |
API Secret Override | The Measurement Protocol API Secret for the data stream. This setting overrides the API Secret used in the Configuration section. |
User ID | A unique identifier for a user. |
Timestamp Micros | A Unix timestamp (in microseconds) for the time to associate with the event. |
Non Personalized Ads | Set to true to indicate these events should not be used for personalized ads. |
Event Type | Select Event Type. For more information and a list of available events, see Events. |
Event Parameters
Parameter | Description |
---|---|
Achievement ID | The ID of the achievement that was unlocked. |
Affiliation | A product affiliation to designate a supplying company or brick and mortar store location. |
Campaign ID | The campaign ID. |
Campaign | The name used to identify a specific promotion or strategic campaign. |
Character | The character that achieved the score. |
Content | The campaign content used for A/B testing and content-targeted ads to differentiate ads or links that point to the same URL. |
Content Type | The type of selected content. |
Coupon | The coupon name/code associated with the event. |
Creative Name | The name of the promotional creative. |
Creative Slot | The name of the promotional creative slot associated with the event. |
Currency | Currency of the items associated with the event, in 3-letter ISO 4217 format. |
Custom Event Type | The custom event type. |
Group ID | The ID of the group. |
Item ID | The identifier for the item that was selected or shared. |
Item List ID | The ID of the list in which the item was presented to the user. |
Item List Name | The name of the list in which the item was presented to the user. |
Item Name | The name of the item the virtual currency is being used for. |
Level (number) | The level of the character. |
Location ID | The ID of the location. |
Medium | The campaign medium. |
Method | The method used to login/sign up/share. |
Payment Type | The chosen method of payment. |
Promotion ID | The ID of the promotion associated with the event. |
Promotion Name | The name of the promotion associated with the event. |
Score (number) | The score to post. |
Search Term | The term that was searched for. |
Shipping (number) | Shipping cost associated with a transaction. |
Shipping Tier | The shipping tier (for example, Ground, Air, Next-day) selected for delivery of the purchased item. |
Source | The campaign traffic source. |
Tax (number) | Tax cost associated with a transaction. |
Term | The campaign term used with paid search to supply the keywords for ads. |
Transaction ID | The unique identifier of a transaction. |
Value (number) | The monetary value of the event. |
Virtual Currency Name | The name of the virtual currency. |
User-Provided Data
Parameter | Description |
---|---|
Email Address (already SHA256 hashed) | Provide an email address that has been already whitespace trimmed, lowercased, and SHA256 hashed. Remove all periods (.) that precede the domain name in gmail.com and googlemail.com email addresses before hashing. |
Email Address (apply SHA256 hash) | Provide a plaintext email address and the connector will remove all periods (. ) that precede the domain name in gmail.com and googlemail.com email addresses, and whitespace trim, lowercase, and hash this value using SHA256 hash. |
Phone Number (already SHA256 hashed) | Provide a phone number according to the E164 standard that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Phone Number (apply SHA256 hash) | Provide a plaintext phone number and the connector will remove all non-digit symbols, prefix the number with a plus sign (+ ), whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: First Name (already SHA256 hashed) | Provide first name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: First Name (apply SHA256 hash) | Provide a plaintext first name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Last Name (already SHA256 hashed) | Provide last name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Last Name (apply SHA256 hash) | Provide a plaintext last name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Street Address (already SHA256 hashed) | Provide street address that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Street Address (apply SHA256 hash) | Provide a plaintext street address and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: City | City of the user’s address. |
Address Info: State | State code of the user’s address. |
Address Info: Postal Code | Postal code of the user’s address. |
Address Info: Country | Two-letter country code in ISO-3166-1 alpha-2 format of the user’s address. |
User Properties
Parameter | Description |
---|---|
User Properties | User properties describe segments of user base, such as language preference or geographic location. |
Items Data
Parameter | Description |
---|---|
Item ID | The ID of the item. |
Item Name | The name of the item. |
Affiliation | A product affiliation to designate a supplying company or brick and mortar store location. |
Coupon | The coupon name/code associated with the item. |
Currency | The currency, in 3-letter ISO 4217 format. |
Discount | The monetary discount value associated with the item. |
Index | The index/position of the item in a list. |
Item Brand | The brand of the item. |
Item Category | The category of the item. If used as part of a category hierarchy or taxonomy then this will be the first category. |
Item Category 2 | The second category hierarchy or additional taxonomy for the item. |
Item Category 3 | The third category hierarchy or additional taxonomy for the item. |
Item Category 4 | The fourth category hierarchy or additional taxonomy for the item. |
Item Category 5 | The fifth category hierarchy or additional taxonomy for the item. |
Item List ID | The ID of the list in which the item was presented to the user. |
Item List Name | The name of the list in which the item was presented to the user. |
Item Variant | The item variant or unique code or description for additional item details/options. |
Location ID | The location associated with the item. We recommend using the Google Place ID that corresponds to the associated item. A custom location ID can also be used. |
Price | The monetary price of the item, in units of the specified currency parameter. |
Quantity | Item quantity. |
Additional Parameters
Parameter | Description |
---|---|
Debug | This connector uses the GA4 debug endpoint by default when using Trace. Map a boolean value to override this behavior. |
Consent
Parameter | Description |
---|---|
Ad User Data | Sets consent for sending user data to Google for advertising purposes. |
Ad Personalization | Sets consent for personalized advertising. |
Action - Send Firebase Event
Parameters
Parameter | Description |
---|---|
App Instance ID | Required. |
Firebase App ID Override | Required. The identifier for a Firebase app. This setting overrides Firebase App ID used in the Configuration section. |
API Secret Override | The Measurement Protocol API Secret for the data stream. This setting overrides the API Secret used in the Configuration section. |
User ID | A unique identifier for a user. |
Timestamp Micros | A Unix timestamp (in microseconds) for the time to associate with the event. |
Non Personalized Ads | Set to true to indicate these events should not be used for personalized ads. |
Event Type | Select Event Type. For more information and a list of available events, see Events. |
Event Parameters
Parameter | Description |
---|---|
Achievement ID | The id of the achievement that was unlocked. |
Affiliation | A product affiliation to designate a supplying company or brick and mortar store location. |
Campaign ID | The campaign ID. |
Campaign | The name used to identify a specific promotion or strategic campaign. |
Character | The character that achieved the score. |
Content | The campaign content used for A/B testing and content-targeted ads to differentiate ads or links that point to the same URL. |
Content Type | The type of selected content. |
Coupon | The coupon name/code associated with the event. |
Creative Name | The name of the promotional creative. |
Creative Slot | The name of the promotional creative slot associated with the event. |
Currency | Currency of the items associated with the event, in 3-letter ISO 4217 format. |
Custom Event Type | The custom event type. |
Group ID | The ID of the group. |
Item ID | The identifier for the item that was selected or shared. |
Item List ID | The ID of the list in which the item was presented to the user. |
Item List Name | The name of the list in which the item was presented to the user. |
Item Name | The name of the item the virtual currency is being used for. |
Level (number) | The level of the character. |
Location ID | The ID of the location. |
Medium | The campaign medium. |
Method | The method used to login/sign up/share. |
Payment Type | The chosen method of payment. |
Promotion ID | The ID of the promotion associated with the event. |
Promotion Name | The name of the promotion associated with the event. |
Score (number) | The score to post. |
Search Term | The term that was searched for. |
Shipping (number) | Shipping cost associated with a transaction. |
Shipping Tier | The shipping tier (for example, Ground, Air, Next-day) selected for delivery of the purchased item. |
Source | The campaign traffic source. |
Tax (number) | Tax cost associated with a transaction. |
Term | The campaign term used with paid search to supply the keywords for ads. |
Transaction ID | The unique identifier of a transaction. |
Value (number) | The monetary value of the event. |
Virtual Currency Name | The name of the virtual currency. |
User-Provided Data
Parameter | Description |
---|---|
Email Address (already SHA256 hashed) | Provide an email address that has been already whitespace trimmed, lowercased, and SHA256 hashed. Remove all periods (.) that precede the domain name in gmail.com and googlemail.com email addresses before hashing. |
Email Address (apply SHA256 hash) | Provide a plaintext email address and the connector will remove all periods (. ) that precede the domain name in gmail.com and googlemail.com email addresses, and whitespace trim, lowercase, and hash this value using SHA256 hash. |
Phone Number (already SHA256 hashed) | Provide a phone number according to the E164 standard that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Phone Number (apply SHA256 hash) | Provide a plaintext phone number and the connector will remove all non-digit symbols, prefix the number with a plus sign (+ ), whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: First Name (already SHA256 hashed) | Provide first name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: First Name (apply SHA256 hash) | Provide a plaintext first name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Last Name (already SHA256 hashed) | Provide last name that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Last Name (apply SHA256 hash) | Provide a plaintext last name and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: Street Address (already SHA256 hashed) | Provide street address that has been already whitespace trimmed, lowercased, and SHA256 hashed. |
Address Info: Street Address (apply SHA256 hash) | Provide a plaintext street address and the connector will whitespace trim, lowercase, and hash this value using SHA256 hash. |
Address Info: City | City of the user’s address. |
Address Info: State | State code of the user’s address. |
Address Info: Postal Code | Postal code of the user’s address. |
Address Info: Country | Two-letter country code in ISO-3166-1 alpha-2 format of the user’s address. |
User Properties
Parameter | Description |
---|---|
User Properties | User properties describe segments of user base, such as language preference or geographic location. |
Items Data
Parameter | Description |
---|---|
Item ID | The ID of the item. |
Item Name | The name of the item. |
Affiliation | A product affiliation to designate a supplying company or brick and mortar store location. |
Coupon | The coupon name/code associated with the item. |
Currency | The currency, in 3-letter ISO 4217 format. |
Discount | The monetary discount value associated with the item. |
Index | The index/position of the item in a list. |
Item Brand | The brand of the item. |
Item Category | The category of the item. If used as part of a category hierarchy or taxonomy then this will be the first category. |
Item Category 2 | The second category hierarchy or additional taxonomy for the item. |
Item Category 3 | The third category hierarchy or additional taxonomy for the item. |
Item Category 4 | The fourth category hierarchy or additional taxonomy for the item. |
Item Category 5 | The fifth category hierarchy or additional taxonomy for the item. |
Item List ID | The ID of the list in which the item was presented to the user. |
Item List Name | The name of the list in which the item was presented to the user. |
Item Variant | The item variant or unique code or description for additional item details/options. |
Location ID | The location associated with the item. It’s recommended to use the Google Place ID that corresponds to the associated item. A custom location ID can also be used. |
Price | The monetary price of the item, in units of the specified currency parameter. |
Quantity | Item quantity. |
Additional Parameters
Parameter | Description |
---|---|
Debug | This connector uses the GA4 debug endpoint by default when using Trace. Map a boolean value to override this behavior. |
Consent
Parameter | Description |
---|---|
Ad User Data | Sets consent for sending user data to Google for advertising purposes. |
Ad Personalization | Sets consent for personalized advertising. |
This page was last updated: June 28, 2024