Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Google Analytics 4 Cloud Destination


Destination Info
  • Accepts Page, Alias, Group, Identify and Track calls.
  • Refer to it as Actions Google Analytic 4, or Actions Google Analytics 4, or Google Analytics 4, or Google Analytics 4 Cloud in the Integrations object
(information)

Additional versions of this destination are available

This page is about the Google Analytics 4 Cloud Destination. See below for information about other versions of the Google destination:

Google Analytics 4(link takes you to an external page) is Google's new Analytics property, which you can use for both websites and applications. Google Analytics 4 has machine learning at its core to help surface insights and give you a more complete understanding of your customers across devices and platforms.

When you have Segment installed, you can use your existing tracking implementation to fulfill your data collection needs with Google Analytics 4. Segment will send your data server-side to Google's Measurement Protocol API(link takes you to an external page).

(warning)

Warning

Google Analytics 4 doesn't officially support a pure server-to-server integration. However, Segment monitors the capabilities of the Measurement Protocol API and updates the cloud integration accordingly to achieve a reasonable level of reporting for mutual customers. For full functionality, please see the Google Analytics 4 Web destination.

(information)

Consent mode

Google enforced consent on March 6, 2024 for European Economic Area (EEA) users. Learn more about consent mode and how to set it up.


Benefits of Google Analytics 4 Cloud

benefits-of-google-analytics-4-cloud page anchor

The Google Analytics 4 Cloud destination provides the following benefits:

  • Fewer settings. Data mapping for actions-based destinations happens during configuration, which eliminates the need for most settings.
  • Clearer mapping of data. Actions-based destinations enable you to define the mapping between the data Segment receives from your source and the data Segment sends to Google Analytics 4.
  • Prebuilt mappings. Mappings for recommended Google Analytics 4 events, like Purchase, are prebuilt with the prescribed parameters and available for customization.
  • Support for multi-product arrays. Products nested within arrays, like the products array in the Order Completed event, can be sent to Google Analytics 4.

Before you connect Segment to Google Analytics 4, configure a Google Analytics 4 property in your Analytics account. For more information, see Google's article: Set up Analytics for a website and/or app(link takes you to an external page).

To add the Google Analytics 4 Cloud destination:

  1. From the Segment web app, click Catalog, then click Destinations.
  2. Search for "Google Analytics 4 Cloud" in the Destinations Catalog, and select the destination.
  3. Click Configure Google Analytics 4 Cloud in the top-right corner of the screen.
  4. Select the source that will send data to Google Analytics 4 and follow the steps to name your destination.
  5. On the Settings tab, enter in the Measurement ID(link takes you to an external page) for web streams or the Firebase App ID(link takes you to an external page) for mobile streams. Next, enter in the API Secret associated with your GA4 stream and click Save. To create a new API Secret, navigate in the Google Analytics UI to Admin > Data Streams > choose your stream > Measurement Protocol > Create.
  6. Follow the steps in the Destinations Actions documentation on Customizing mappings.

Property nameTypeRequiredDescription
API Secretstring
required

An API SECRET generated in the Google Analytics UI, navigate to: Admin > Data Streams > choose your stream > Measurement Protocol > Create


Firebase App IDstring

Optional

The Firebase App ID associated with the Firebase app. Found in the Firebase console under: Project Settings > General > Your Apps > App ID. Required for mobile app streams.


Measurement IDstring

Optional

The Measurement ID associated with a stream. Found in the Google Analytics UI under: Admin > Data Streams > choose your stream > Measurement ID. Required for web streams.


Build your own Mappings. Combine supported triggers with the following Google Analytics 4 Cloud-supported actions:

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Add to Cart

add-to-cart page anchor

Send event when a user adds items to a cart

Add to Cart is a Cloud action. The default Trigger is type = "track" and event = "Product Added"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ProductsOBJECT
required

The list of products purchased.


ValueNUMBER

Optional

The monetary value of the event.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user completes a purchase

Purchase is a Cloud action. The default Trigger is type = "track" and event = "Order Completed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


AffiliationSTRING

Optional

Store or affiliation from which this transaction occurred (e.g. Google Store).


CouponSTRING

Optional

Coupon code used for a purchase.


CurrencySTRING
required

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ProductsOBJECT
required

The list of products purchased.


Order IdSTRING
required

The unique identifier of a transaction.


ShippingNUMBER

Optional

Shipping cost associated with the transaction.


TaxNUMBER

Optional

Total tax associated with the transaction.


ValueNUMBER

Optional

The monetary value of the event.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send page view when a user views a page

Page View is a Cloud action. The default Trigger is type = "page"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Page LocationSTRING

Optional

The current page URL


Page ReferrerSTRING

Optional

Previous page URL


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Page TitleSTRING

Optional

The current page title


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user selects a promotion

Select Promotion is a Cloud action. The default Trigger is type = "track" and event = "Promotion Clicked"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Creative NameSTRING

Optional

The name of the promotional creative.


Creative SlotSTRING

Optional

The name of the promotional creative slot associated with the event.


Location IDSTRING

Optional

The ID of the location.


Promotion IDSTRING

Optional

The ID of the promotion associated with the event.


Promotion NameSTRING

Optional

The name of the promotion associated with the event.


ProductsOBJECT

Optional

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user begins checkout

Begin Checkout is a Cloud action. The default Trigger is type = "track" and event = "Checkout Started"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CouponSTRING

Optional

Coupon code used for a purchase.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ProductsOBJECT
required

The list of products purchased.


ValueNUMBER

Optional

The monetary value of the event.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user views an item

View Item is a Cloud action. The default Trigger is type = "track" and event = "Product Viewed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send any custom event

Custom Event is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Event NameSTRING
required

The unique name of the custom event created in GA4. GA4 does not accept spaces in event names so Segment will replace any spaces with underscores. More information about GA4 event name rules is available in their docs(link takes you to an external page).


Lowercase Event NameBOOLEAN

Optional

If true, the event name will be converted to lowercase before sending to Google. Event names are case sensitive in GA4 so enable this setting to avoid distinct events for casing differences. More information about GA4 event name rules is available in their docs(link takes you to an external page).


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user selects an item from a list

Select Item is a Cloud action. The default Trigger is type = "track" and event = "Product Clicked"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Item List NameSTRING

Optional

The name of the list in which the item was presented to the user.


Item List IdSTRING

Optional

The ID of the list in which the item was presented to the user.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user views a list of items or offerings

View Item List is a Cloud action. The default Trigger is type = "track" and event = "Product List Viewed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Item List IDSTRING

Optional

The ID of the list in which the item was presented to the user.


Item List NameSTRING

Optional

The name of the list in which the item was presented to the user.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a refund is issued

Refund is a Cloud action. The default Trigger is type = "track" and event = "Order Refunded"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


Order IdSTRING
required

The unique identifier of a transaction.


ValueNUMBER

Optional

The monetary value of the event.


AffiliationSTRING

Optional

Store or affiliation from which this transaction occurred (e.g. Google Store).


CouponSTRING

Optional

Coupon code used for a purchase.


ShippingNUMBER

Optional

Shipping cost associated with the transaction.


TaxNUMBER

Optional

Tax cost associated with a transaction.


ProductsOBJECT

Optional

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user submits their payment information

Add Payment Info is a Cloud action. The default Trigger is type = "track" and event = "Payment Info Entered"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


CouponSTRING

Optional

Coupon code used for a purchase.


Payment TypeSTRING

Optional

The chosen method of payment.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user adds items to a wishlist

Add to Wishlist is a Cloud action. The default Trigger is type = "track" and event = "Product Added to Wishlist"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user signs up to measure the popularity of each sign-up method

Sign Up is a Cloud action. The default Trigger is type = "track" and event = "Signed Up"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


MethodSTRING

Optional

The method used for sign up.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a promotion is shown to a user

View Promotion is a Cloud action. The default Trigger is type = "track" and event = "Promotion Viewed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Creative NameSTRING

Optional

The name of the promotional creative.


Creative SlotSTRING

Optional

The name of the promotional creative slot associated with the event.


Location IDSTRING

Optional

The ID of the location.


Promotion IDSTRING

Optional

The ID of the promotion associated with the event.


Promotion NameSTRING

Optional

The name of the promotion associated with the event.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user views their cart

View Cart is a Cloud action. The default Trigger is type = "track" and event = "Cart Viewed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user logs in

Login is a Cloud action. The default Trigger is type = "track" and event = "Signed In"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


MethodSTRING

Optional

The method used to login.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user removes items from a cart

Remove from Cart is a Cloud action. The default Trigger is type = "track" and event = "Product Removed"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


ProductsOBJECT
required

The list of products purchased.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user searches your content

Search is a Cloud action. The default Trigger is type = "track" and event = "Products Searched"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


Search TermSTRING
required

The term that was searched for.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.

Send event when a user submits a form or request for information

Generate Lead is a Cloud action. The default Trigger is type = "track"

Property nameTypeRequiredDescription
Data Stream TypeSTRING

Optional

The type of data stream this data belongs in. This can either be a web stream or a mobile app stream (iOS or Android). Possible values: "Web" (default) and "Mobile App".


Firebase App Instance IDSTRING

Optional

Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK. Required for mobile app streams.


Client IDSTRING

Optional

Uniquely identifies a user instance of a web client. Required for web streams.


User IDSTRING

Optional

A unique identifier for a user. See Google's User-ID for cross-platform analysis(link takes you to an external page) and Reporting: deduplicate user counts(link takes you to an external page) documentation for more information on this identifier.


Event TimestampSTRING

Optional

A Unix timestamp (in microseconds) for the time to associate with the event. Segment will convert to Unix if not already converted. Events can be backdated up to 3 calendar days based on the property's timezone.


CurrencySTRING

Optional

Currency of the items associated with the event, in 3-letter ISO 4217 format.


ValueNUMBER

Optional

The monetary value of the event.


User PropertiesOBJECT

Optional

The user properties to send to Google Analytics 4. You must create user-scoped dimensions to ensure custom properties are picked up by Google. See Google’s Custom user properties(link takes you to an external page) to learn how to set and register user properties.


Engagement Time in MillisecondsNUMBER

Optional

The amount of time a user interacted with your site, in milliseconds. Google only counts users who interact with your site for a non-zero amount of time. By default, Segment sets engagement time to 1 so users are counted.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Ad User Data Consent StateSTRING

Optional

Sets consent for sending user data to Google for advertising purposes. Must be either GRANTED or DENIED.


Ad Personalization Consent StateSTRING

Optional

Sets consent for personalized advertising. Must be either GRANTED or DENIED.


Universal Analytics and Google Analytics 4

universal-analytics-and-google-analytics-4 page anchor

Differences between Universal Analytics and Google Analytics 4

differences-between-universal-analytics-and-google-analytics-4 page anchor

Google Analytics 4 uses an event-based data model similar to Segment, with the principle that any interaction can be captured as an event. Universal Analytics, on the other hand, is based on hits and is primarily pageview-based. Because the data collection models are different, data cannot be migrated from Universal Analytics to Google Analytics 4 and Google recommends recreating your existing Universal Analytics tracking in Google Analytics 4. For more information on the different data models, see Google's Events in Google Analytics 4 vs Universal Analytics(link takes you to an external page) and Universal Analytics versus Google Analytics 4 data(link takes you to an external page).

Google Analytics 4 has different out-of-the-box reports. Google Analytics 4's reporting is much more configurable and supports new reporting metrics like churn probability and predictive revenue estimates. In addition, goals defined in Universal Analytics have been replaced with the concept of conversions in Google Analytics 4. Reports and conversions will need to be rebuilt in Google Analytics 4.

(information)

Info

To determine whether you have a Universal Analytics property or a Google Analytics 4 property, look at your property ID. Universal Analytics property IDs start with UA and end with a number (UA-XXXXXXXXX-1). Google Analytics 4 property IDs have only numbers (XXXXXXXXX).

Migrating from Universal Analytics to Google Analytics 4

migrating-from-universal-analytics-to-google-analytics-4 page anchor
(warning)

Warning

Google announced that all standard Universal Analytics properties will stop processing new data on July 1, 2023. 360 Universal Analytics properties with a current order will receive a one-time processing extension ending on July 1, 2024. Learn more about when Google Analytics 4 will replace Universal Analytics(link takes you to an external page).

Segment's Google Analytics 4 Cloud integration is a server-side integration with the GA4 Measurement Protocol API. This is similar to Segment's Google Universal Analytics cloud-mode integration in that all data is sent directly to Google's servers. Please note that this means client-side functionality, such as Enhanced Measurement(link takes you to an external page), may not be available through Segment. In addition, as Google continues to develop the GA4 Measurement Protocol API ahead of general availability of the API, there may be limitations that impact what can be seen in the Google Analytics 4 reports.

In addition to recommended events, you can also send custom events using the Custom Event action. Custom events are events that you name. Custom events don't appear in most standard reports; you need to set up custom reports for meaningful analysis. To create custom events in the Google Analytics 4 web interface, see Google's Modify and create events through the user interface(link takes you to an external page).

(information)

Event naming limitations

Google Analytics 4 requires that all event names contain only alpha-numeric characters and underscores, must start with an alphabetic character, and support a maximum of 40 characters. Segment replaces spaces in Event Names with an underscore, so that these events are accepted by GA4. For example, Segment renames an event named Home Profile to Home_Profile. In some cases, GA4 may reject an event outright, due to unsupported characters. For example, an event named Home | Profile will be silently rejected due to the pipe character.

In all cases, event names in GA4 are case sensitive and require values in all properties. The Custom Event action includes a Lowercase Event Name option, to ensure consistency of all events sent to Google. For more information, see Google's articles Google Analytics 4 event name rules(link takes you to an external page) and Event name limitations(link takes you to an external page).

Custom dimensions and metrics

custom-dimensions-and-metrics page anchor

With Google Analytics 4, you must create custom dimensions and metrics within the Google Analytics 4 interface and link parameters to the corresponding dimension or metric. When you create the dimension or metric, you can either select a parameter from the list of already collected fields or enter the name of the parameter you plan to collect in the future. Custom dimensions can be either event-scoped or user-scoped, and custom metrics must be event-scoped.

To send parameters to Google Analytics 4, use the Event Parameters or User Properties object available on every action. Only pass flat key-value pairs in the Event Parameters and User Properties objects. Keep in mind that Google silently drops any events that include nested parameters.

To achieve parity with Universal Analytics, you should create the same custom dimensions that you defined in Universal Analytics. Additionally, in Google Analytics 4, you should recreate many of the values that you tracked as event dimensions in Universal Analytics, particularly event category and event label. For more information, see Google Analytics 4 Custom dimensions and metrics(link takes you to an external page).

Tracking active users and sessions

tracking-active-users-and-sessions page anchor
Server-side Implementation using Google Analytics 4 Cloud Destination
server-side-implementation-using-google-analytics-4-cloud-destination page anchor

The Google Analytics 4 reports only display active users who engage with your site for a non-zero amount of time. To ensure users are rendered in reports, Segment sets the engagement_time_msec parameter to 1 by default. If you track engagement time on your Segment events, you can use the Engagement Time in Milliseconds field mapping to set engagement_time_msec to a different value.

Besides Engagement Time in Milliseconds, you can also generate your own session_id and session_number and pass them as event properties to Segment. These properties can then be mapped to their corresponding parameters in Segment's Google Analytics 4 Cloud destination.

(information)

Session tracking limitations

Session tracking server-side only supports a subset of user dimensions. Certain reserved fields such as location, demographics, other predefined user dimensions(link takes you to an external page) and device-specific information are not supported by Google's Measurement Protocol API.

Using Gtag.js and Google Analytics 4 Cloud Destination
using-gtagjs-and-google-analytics-4-cloud-destination page anchor

If you choose to integrate with Google Analytics 4 client-side (either with Segment's Google Analytics 4 Web destination or outside of Segment) and also use Segment's Google Analytics 4 Cloud destination to send events through the API, you will have all the reserved parameters and sessions tracking information available in Google Analytics 4 reports.

When using Gtag, Google generates a session_id and session_number when a session begins(link takes you to an external page). The session_id and session_number generated on the client can be passed as Event Parameters to stitch events sent through the API with the same session that was collected client-side. Additionally, client_id must be the same for both client-side and server-side events in order to deduplicate user counts in GA4 (unless User-ID is used as the basis for user identification). For events to stitch properly, server-side events must arrive within a 48 hour window of when the client-side events arrive.

You can check your client_id, session_id and session_number with the Google Site Tag function(link takes you to an external page) or by running this script in your JavaScript console and replacing G-xxxxxxxxxx with your Google Analytics 4 Measurement ID:

1
const sessionIdPromise = new Promise(resolve => {
2
gtag('get', 'G-xxxxxxxxxx', 'session_id', resolve)
3
});
4
const sessionNumPromise = new Promise(resolve => {
5
gtag('get', 'G-xxxxxxxxxx', 'session_number', resolve)
6
});
7
8
const clientIdPromise = new Promise(resolve => {
9
gtag('get', 'G-xxxxxxxxxx', 'client_id', resolve)
10
});
11
12
Promise.all([sessionIdPromise, sessionNumPromise, clientIdPromise]).then(function(session_data) {
13
console.log("session ID: "+session_data[0]);
14
console.log("session Number: "+session_data[1]);
15
console.log("client ID: "+session_data[2]);
16
});

Segment requires a Client ID or Firebase App Instance ID to send data to Google Analytics 4. The Client ID is the web equivalent of a device identifier and uniquely identifies a given user instance of a web client. By default, Segment sets Client ID to the Segment userId, falling back on anonymousId. This mapping can be changed within each action if you prefer to map a different field to Client ID.

The Firebase App Instance ID is the mobile equivalent of a device identifier and uniquely identifiers a given Firebase app instance. No default is set for Firebase App Instance ID, as this value needs to be retrieved through the Firebase SDK(link takes you to an external page).

Segment also allows you to send a User-ID with your events. The User-ID feature lets you associate your own identifiers with individual users so you can connect their behavior across different sessions and on various devices and platforms. For more information on User-ID, see Google's Measure activity across platforms(link takes you to an external page).

There are certain scenarios where sending a User-ID can be helpful. For example, if you choose to integrate with Google Analytics 4 client-side (either with Segment's Google Analytics 4 Web destination or outside of Segment) and also use Segment's Google Analytics 4 Cloud destination to send events through the API, you may consider taking the following approach:

  • Use the Gtag-generated Client ID. Gtag will set a Client ID automatically. The Client ID is stored in a cookie and can be fetched on the web client. To tie data between client-side and server-side, pass the Gtag-generated Client ID to Segment as a property and use that value as the Client ID in the Google Analytics 4 Cloud destination mappings.
  • Use the Segment userId for User-ID. The Segment userId should be your company's canonical user identifier. By setting Google's User-ID to the same value as userId on client-side and server-side, you can benefit from cross-platform analytics. In addition, if you use Firebase to send mobile data to Google Analytics 4, using the same User-ID across web and mobile will ensure users are stitched together across devices.

Validating and comparing data

validating-and-comparing-data page anchor

Google recommends a period of dual-collection with both Universal Analytics and Google Analytics 4. This dual-collection approach lets you build a historical record in Google Analytics 4 while continuing to depend on Universal Analytics until you're ready to fully switch over.

During this period, you may find it hard to perfectly compare between the two properties because reports and configuration settings vary between Universal Analytics and Google Analytics 4 properties. Google provides guidance on the conditions that must be met(link takes you to an external page) in order to compare data in the Realtime reports, as well as which metrics are comparable versus not(link takes you to an external page).

For a complete map of Universal Analytics functionality to corresponding Google Analytics 4 functionality, please see Google's Migration Reference(link takes you to an external page).


Data not sending to Google

data-not-sending-to-google page anchor

Ensure that at least one mapping has been configured and enabled in the destination mappings for an event that you would like to reach Google. Without any mappings enabled to trigger on an event that has been ingested by the connected source, the destination will not send events downstream.

Google doesn't currently support passing certain reserved fields to the Google Analytics 4 Measurement Protocol API. This includes attribution data, like UTM parameters. If you rely on attribution reporting, you can either send this data as custom dimensions or implement a parallel client-side integration to collect this data with gtag.js (web) or Firebase (mobile).

The Google Analytics 4 debug mode(link takes you to an external page) only works with a client-side implementation through gtag.js, Google Tag Manager, or Firebase. Because Segment's Google Analytics 4 Cloud integration is server-side and uses the Measurement Protocol API, debug mode is not supported.

However, you can use Google's /debug endpoint to test your events against Google's Measurement Protocol Validation Server. For more information, see Google's Validate events(link takes you to an external page) documentation.

To validate your events:

  1. Run a test through Segment's Event Tester with the event you're concerned about.
  2. Copy the Request from Segment value you see. This is the payload that Segment attempts to send to Google.
  3. Use an API testing tool, like Postman, to send that payload to Google's /debug endpoint.
  4. Google's /debug endpoint returns a validation code(link takes you to an external page) and a description of the error.

To achieve complete reporting, Google recommends use of their Firebase SDKs to send mobile data to Google Analytics 4. To assist in your implementation, Segment has a Firebase destination available for mobile analytics. For more information on linking Google Analytics 4 properties to Firebase, see Google Analytics 4 Firebase integration(link takes you to an external page).

The Segment Google Analytics 4 Cloud destination supports sending mobile app events server-side to supplement your Firebase implementation. To send mobile events server-side, configure the Firebase App ID in the Destination settings. In each mapping, change the Data Stream Type to Mobile App and set a Firebase App Instance ID so that data routes to a mobile stream.

Google reserves certain event names, parameters, and user properties. Google silently drops any events that include these reserved names(link takes you to an external page). Google doesn't accept events in the following conditions:

  • event or user property names have spaces in them
  • fields with null values
  • fields or events with reserved names
  • fields with a number as the key
  • fields or events with a dash (-) character in the name
  • property names with capital letters

Verifying Event Meet GA4's Measurement Protocol API

verifying-event-meet-ga4s-measurement-protocol-api page anchor

Why are the events returning an error Param [PARAM] has unsupported value.? Google has some requirements/limitations(link takes you to an external page) imposed by their Measurement Protocol API(link takes you to an external page). If an event contains null/object/array parameters, GA4 silently drops the event, so Segment does not attempt to send the event but instead returns an error of Invalid Type that can be found in the destination's Event Delivery tab. To verify whether an event will return this error, you can send an event to GA4's debug endpoint(link takes you to an external page) with an API tool like Postman(link takes you to an external page).

Data takes a long time to appear in Google's reports

data-takes-a-long-time-to-appear-in-googles-reports page anchor

Google may take 24-48 hours(link takes you to an external page) to process data sent to Google Analytics. As a result, the Google Analytics user interface may not reflect the most current data. The Google Analytics Realtime report(link takes you to an external page) displays activity on your site as it happens.

Events with timestamps older than 72 hours are not showing on Google's end

events-with-timestamps-older-than-72-hours-are-not-showing-on-googles-end page anchor

Because Google's Measurement Protocol API(link takes you to an external page) only accepts events that are backdated by up to 72 hours, GA4 can't accept events older than 72 hours.

The Google Analytics 4 Cloud destination does not support Google Optimize. This destination operates in cloud-mode (sending events from Segment servers to Google Analytics using the Measurement Protocol API), which prevents the required Optimize SDK(link takes you to an external page) snippet from loading on the page.

Client/server-side event deduplication

clientserver-side-event-deduplication page anchor

Google doesn't offer guidance around how to deduplicate the same event coming in server and client side. As a result, Segment recommends that you don't send the same event into Google Analytics 4 from two different locations such that you would expect Google to deduplicate one of the events out of their pipeline. You can deduplicate user counts using the User ID field, but you cannot deduplicate whole events in the Google platform as far as Segment is aware.

User-provided data collection

user-provided-data-collection page anchor

Google offers a beta feature called User-provided data collection(link takes you to an external page) that collects data directly from users. Segment doesn't support this feature. Acknowledging the feature policy in your Google Analytics 4 account is permanent, even though you can later disable the data collection itself.