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

Validation

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.

The Google Analytics 4 Measurement Protocol always returns a 2xx status code if the HTTP request was received. The Protocol does not return an error code if the payload data was not formed correctly, the data in the payload was incorrect, or the payload data was not processed by Google Analytics.

Limitations

Google lists the following limitations when using the Google Analytics 4 Measurement Protocol:

  • If you include user_id in your Google Analytics 4 Measurement Protocol events you must also include it in the client-side events.
  • Session data is not supported.
  • Requests, events, user property names and values, parameter names and values, and the post body all have limitations in the Google Analytics 4 Measurement Protocol. For a list of limitations, see the Limitations section in the Google documentation.

The GA4 EventStream connector leverages the Measurement Protocol for GA4. For more information, see Google’s documentation on the Measurement Protocol for GA4.

Configure settings

Navigate to the Connector Marketplace and add a new connector. For general instructions on how to add a connector, see the About Connectors article.

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 a Platform in the Google Analytics UI. Set up your Data Stream and select Measurement Protocol API secrets from the Additional Settings section of the Web stream details window.
  • Measurement ID
    The measurement ID associated with a stream located in the Google Analytics UI. After setting up your Data Stream, navigate to Admin > Data Streams and select your stream. Your measurement ID is available in the Web stream details window.
  • Firebase App ID
    The identifier for a Firebase app. To find the Firebase app ID navigate to Project Settings > General > Your apps > App ID in the Firebase console.

Click Done when you are finished configuring the connector.

Action settings — parameters and options

Click Continue to configure the connector actions. Enter in a name for the action and then select the action type from the drop-down menu.

The following section describes how to set up parameters and options for each action.

Action — Send PageView Event (gtag.js)

Parameters

Parameter Description
Client ID (Required) A unique identifier for a client.
API Secret Override Measurement Protocol API Secret for the Data Stream. This setting overrides API Secret used in the configuration section.
Measurement ID Override The identifier for a Data Stream. This setting overrides Measurement ID used in the configuration section.
User ID If you include user_id in your Google Analytics 4 Measurement Protocol events you must also include it in the client-side events.
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.
Page Title
Page Location (Required) The full URL to the page.
User Properties User properties describe segments of user base, such as language preference or geographic location.
Could be configured into the section “Templates”.
Item ID Either Item ID or Item Name is required.
Item Name Either Item ID or Item Name is required.
Affiliation
Coupon
Currency
Discount (number)
Index (number)
Item Brand
Item Category
Item Category 2
Item Category 3
Item Category 4
Item Category 5
Item List ID
Item List Name
Item Variant
Location ID
Price (number)
Quantity (number)
Template Variables Provide template variables as data input for templates (see: Template Variables Guide).
Name nested template variables with the dot notation (For example: items.name).
Nested template variables are typically built from data layer list attributes.
Templates Provide templates to be referenced in User Properties (see: Templates Guide).
Templates are injected by name with double curly braces into supported fields. For example, {{SomeTemplateName}}.

Action — Send Event (gtag.js)

Parameters

Parameter Description
Client ID (Required)
API Secret Override Measurement Protocol API Secret for the Data Stream. This setting overrides API Secret used in the configuration section.
Measurement ID Override The identifier for a Data Stream. This setting overrides Measurement ID used in the configuration section.
User ID If you include user_id in your Google Analytics 4 Measurement Protocol events you must also include it in the client-side events.
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.
Achievement ID
Affiliation
Character
Content Type
Coupon
Creative Name
Creative Slot
Currency
Custom Event Type
Group ID
Item ID
Item List ID
Item List Name
Item Name
Level (number)
Location ID
Method
Payment Type
Promotion ID
Promotion Name
Score (number)
Search Term
Shipping (number)
Shipping Tier
Tax (number)
Transaction ID
Value (number)
Virtual Currency Name
User Properties User properties describe segments of user base, such as language preference or geographic location.
Could be configured into the section “Templates”.
Item ID Either Item ID or Item Name is required.
Item Name Either Item ID or Item Name is required.
Affiliation
Coupon
Currency
Discount (number)
Index (number)
Item Brand
Item Category
Item Category 2
Item Category 3
Item Category 4
Item Category 5
Item List ID
Item List Name
Item Variant
Location ID
Price (number)
Quantity (number)
Template Variables Provide template variables as data input for templates (see: Template Variables Guide).
Name nested template variables with the dot notation (For example: items.name).
Nested template variables are typically built from data layer list attributes.
Templates Provide templates to be referenced in User Properties (see: Templates Guide).
Templates are injected by name with double curly braces into supported fields. For example, {{SomeTemplateName}}.

Action — Send Firebase Event

Parameters

Parameter Description
Client ID (Required)
API Secret Override Measurement Protocol API Secret for the Data Stream. This setting overrides API Secret used in the configuration section.
Measurement ID Override The identifier for a Data Stream. This setting overrides Measurement ID used in the configuration section.
User ID If you include user_id in your Google Analytics 4 Measurement Protocol events you must also include it in the client-side events.
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.
Achievement ID
Affiliation
Character
Content Type
Coupon
Creative Name
Creative Slot
Currency
Custom Event Type
Group ID
Item ID
Item List ID
Item List Name
Item Name
Level (number)
Location ID
Method
Payment Type
Promotion ID
Promotion Name
Score (number)
Search Term
Shipping (number)
Shipping Tier
Tax (number)
Transaction ID
Value (number)
Virtual Currency Name
User Properties User properties describe segments of user base, such as language preference or geographic location.
Could be configured into the section “Templates”.
Item ID Either Item ID or Item Name is required.
Item Name Either Item ID or Item Name is required.
Affiliation
Coupon
Currency
Discount (number)
Index (number)
Item Brand
Item Category
Item Category 2
Item Category 3
Item Category 4
Item Category 5
Item List ID
Item List Name
Item Variant
Location ID
Price (number)
Quantity (number)
Template Variables Provide template variables as data input for templates (see: Template Variables Guide).
Name nested template variables with the dot notation (For example: items.name).
Nested template variables are typically built from data layer list attributes.
Templates Provide templates to be referenced in User Properties (see: Templates Guide).
Templates are injected by name with double curly braces into supported fields. For example, {{SomeTemplateName}}.

Was this page helpful?

This page was last updated: September 2, 2022