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 Web Destination


Destination Info
  • Accepts Page, Alias, Group, Identify and Track calls.
  • Refer to it as Google Analytics 4 Web in the Integrations object
  • This destination is not compatible with Destination Insert Functions.
(information)

Additional versions of this destination are available

This page is about the Google Analytics 4 Web 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 Analytics property that 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 Analytics 2.0 tracking implementation to fulfill your data collection needs with Google Analytics 4. When you enable the Google Analytics 4 Web destination, Segment loads the gtag.js library(link takes you to an external page) for you. To avoid duplicate data, remove the native gtag.js script from your page.

(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.


Getting started

getting-started page anchor

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

To connect the Google Analytics 4 Web destination:

  1. From the Segment web app, click Catalog, then click Destinations.
  2. Search for "Google Analytics 4 Web" in the Destinations Catalog, and select the destination.
  3. Click Configure Google Analytics 4 Web.
  4. Select the web source that will send data to Google Analytics 4 and follow the steps to name your destination. The web source chosen must use Analytics.js 2.0. For mobile source tracking, view the Firebase Destination.
  5. On the Settings tab, under Basic Settings, enter in the Measurement ID(link takes you to an external page) associated with your GA4 web stream.
  6. Set up your event mappings by following the steps in the Destinations Actions documentation on Customizing mappings.
  7. Analytics.js requires an initial Page call to send data to Google Analytics 4 Web. The Segment snippet includes this initial call by default.
  8. For GA4 to accept events on page, enable Set Configuration Mapping triggered by the first Segment event called after analytics.load(). Set Configuration Mapping calls the gtag('config') command to enable tracking to your GA4 Measurement ID.

After you've set up and enabled the Set Configuration Mapping, enable at least one event in your Mappings tab. From there, view your events and parameters using the Google Realtime(link takes you to an external page) or DebugView(link takes you to an external page) reports. These two reports show you the events users trigger on your website as they occur. The DebugView report requires additional configuration before you can use it. Additional tools for debugging are to view all your Google enabled tracking via Tag Assistant(link takes you to an external page) or in your browser's Dev Tools, view GA4 collect requests by filtering by /collect.

Google Analytics automatically populates some events and parameters. For example, there are Automatically Collected(link takes you to an external page) events collected by triggering the Set Configuration Mapping. Calling gtag('config') and enabling Enhanced Measurement events(link takes you to an external page), which are controlled by toggling "on" in your GA4 Admin panel, use event listeners to send events. All events tracked via GA4 Web populate some commonly used parameters like page_location without additional configuration. Review the Google Analytics event parameters(link takes you to an external page) documentation for more information.

Custom events and event naming

custom-events-and-event-naming page anchor

Before you create a custom event, make sure the event you want to create isn't already collected through an Automatically Collected event(link takes you to an external page) or recommended as a Recommended event(link takes you to an external page). Google Analytics 4 does not accept custom event names that include spaces. Segment replaces spaces in the Event Name in the Custom Event action with an underscore. As a result, you see custom events as snake_case in Google Analytics 4.

Event names are case-sensitive in Google Analytics 4. If you would like all event names to be lowercase, use the Lowercase Event Name setting when you create a Custom Event mapping and select Yes from the dropdown. If this setting is disabled, Google treats event names with different casing as distinct events.

Custom Events don't appear in some of Google's standard reports; you must set up custom reports for meaningful analysis.

(information)

Custom Events with Item Parameters

To pass item parameters, you must use Google Recommended Event names that accept the items array, in other words, Ecommerce Events. Item parameters do not pass to GA4 with a Custom Event name or any other Event name if the items array is not specified as a parameter.

Custom dimensions and metrics

custom-dimensions-and-metrics page anchor

With Google Analytics 4, you must create custom dimensions and metrics, also known as Custom Definitions, within the Google Analytics 4 Admin interface to link event parameters to the corresponding custom dimensions or metrics. When creating 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. For more information, see Google Analytics 4 Custom dimensions and metrics(link takes you to an external page).

Understanding event parameters

understanding-event-parameters page anchor

Similar to how properties relate to Segment events, parameters provide additional information about the ways users interact with your website. For example, when someone views a product you sell, you can include parameters that describe the product they viewed, like product_name, category, and price.

Automatically Collected and Enhanced Measurement events include a defined set of parameters by default. Google also provides a set of required and optional parameters to include with each Recommended event, and you can add more event parameters when you need them. Segment recommends that you review GA4's list of defined event parameters, as anything beyond that list is a custom event parameter. The Event collection limits(link takes you to an external page) also impact how many Custom Definitions your GA4 instance allows and how many parameters you can send with each event.

Some of Segment's prebuilt Available Actions that map to Google's recommended events are automatically marked as a conversion in your Analytics dashboard. For example, when you add an "Order Completed" event, it will show up in your Analytics dashboard as "purchase" with the Mark as conversion toggle toggled on by default. However, for other events, such as "Add to Cart", you must manually toggle the Mark as conversion setting on in your Analytics dashboard. If you don't mark the event as a conversion, it will not show up as a conversion in your built-in reports. You can read more about conversion events(link takes you to an external page) in Google's documentation.


Property nameTypeRequiredDescription
Ad Personalization Consent Stateselect

Optional

Consent state indicated by the user for ad cookies. Value must be "granted" or "denied." This is only used if the Enable Consent Mode setting is on.


Ad User Data Consent Stateselect

Optional

Consent state indicated by the user for ad cookies. Value must be "granted" or "denied." This is only used if the Enable Consent Mode setting is on.


Allow Ad Personalization Signalsboolean

Optional

Set to false to disable all advertising features. Set to true by default.


Allow Google Signalsboolean

Optional

Set to false to disable all advertising features. Set to true by default.


Cookie Domainstring

Optional

Specifies the domain used to store the analytics cookie. Set to “auto” by default.


Cookie Expiration In Secondsnumber

Optional

Every time a hit is sent to GA4, the analytics cookie expiration time is updated to be the current time plus the value of this field. The default value is two years (63072000 seconds). Please input the expiration value in seconds. More information in Google Documentation(link takes you to an external page)


Cookie Flagarray

Optional

Appends additional flags to the analytics cookie. See write a new cookie(link takes you to an external page) for some examples of flags to set.


Cookie Pathstring

Optional

Specifies the subpath used to store the analytics cookie. We recommend to add a forward slash, / , in the first field as it is the Default Value for GA4.


Cookie Prefixarray

Optional

Specifies a prefix to prepend to the analytics cookie name.


Cookie Updateboolean

Optional

Set to false to not update cookies on each page load. This has the effect of cookie expiration being relative to the first time a user visited. Set to true by default so update cookies on each page load.


Default Ads Storage Consent Stateselect

Optional

The default value for ad cookies consent state. This is only used if Enable Consent Mode is on. Set to “granted” if it is not explicitly set. Consent state can be updated for each user in the Set Configuration Fields action.


Default Analytics Storage Consent Stateselect

Optional

The default value for analytics cookies consent state. This is only used if Enable Consent Mode is on. Set to “granted” if it is not explicitly set. Consent state can be updated for each user in the Set Configuration Fields action.


Domainstring

Optional

A custom domain to load the Google Analytics script from. For more information see Google's Documentation(link takes you to an external page).


Enable Consent Modeboolean

Optional

Set to true to enable Google’s Consent Mode(link takes you to an external page). Set to false by default.


Measurement IDstring
required

The measurement ID associated with the web stream. Found in the Google Analytics UI under: Admin > Data Streams > Web > Measurement ID.


Page Viewsboolean

Optional

Set to false to prevent the default snippet from sending page views. Enabled by default.


Wait Time to Update Consent Statenumber

Optional

If your CMP loads asynchronously, it might not always run before the Google tag. To handle such situations, specify a millisecond value to control how long to wait before the consent state update is sent. Please input the wait_for_update in milliseconds.


Google Analytics 4 Web has the following presets

Preset NameTriggerDefault Action
Set Configuration FieldsEvent type = "page"Set Configuration Fields

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

(information)

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

This event signifies that an item was added to a cart for purchase.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

The term that was searched for.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Search TermSTRING

Optional

The term that was searched for.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies an item was selected from a list.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Log this event when the user has been presented with a list of items of a certain category.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

The method used for sign up.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Send any custom event

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

Property nameTypeRequiredDescription
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 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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies when one or more items is refunded to a user.

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

Property nameTypeRequiredDescription
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.


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

Total tax associated with the 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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Send event when a user submits their payment information

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies that a user viewed their cart.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Set Configuration Fields

set-configuration-fields page anchor

Set custom values for the GA4 configuration fields.

Set Configuration Fields is a Web action. The default Trigger is type = "page"

Property nameTypeRequiredDescription
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.


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.


Ads Storage Consent StateSTRING

Optional

Consent state indicated by the user for ad cookies. Value must be “granted” or “denied.” This is only used if the Enable Consent Mode setting is on.


Analytics Storage Consent StateSTRING

Optional

Consent state indicated by the user for ad cookies. Value must be “granted” or “denied.” This is only used if the Enable Consent Mode setting is on.


Ad User Data Consent StateSTRING

Optional

Consent state indicated by the user for ad cookies. Value must be "granted" or "denied." This is only used if the Enable Consent Mode setting is on.


Ad Personalization Consent StateSTRING

Optional

Consent state indicated by the user for ad cookies. Value must be "granted" or "denied." This is only used if the Enable Consent Mode setting is on.


Campaign ContentSTRING

Optional

Use campaign content to differentiate ads or links that point to the same URL. Setting this value will override the utm_content query parameter.


Campaign IDSTRING

Optional

Use campaign ID to identify a specific campaign. Setting this value will override the utm_id query parameter.


Campaign MediumSTRING

Optional

Use campaign medium to identify a medium such as email or cost-per-click. Setting this value will override the utm_medium query parameter.


Campaign NameSTRING

Optional

Use campaign name to identify a specific product promotion or strategic campaign. Setting this value will override the utm_name query parameter.


Campaign SourceSTRING

Optional

Use campaign source to identify a search engine, newsletter name, or other source. Setting this value will override the utm_source query parameter.


Campaign TermSTRING

Optional

Use campaign term to note the keywords for this ad. Setting this value will override the utm_term query parameter.


Content GroupSTRING

Optional

Categorize pages and screens into custom buckets so you can see metrics for related groups of information. More information in Google documentation(link takes you to an external page).


LanguageSTRING

Optional

The language preference of the user. If not set, defaults to the user's navigator.language value.


Page LocationSTRING

Optional

The full URL of the page. If not set, defaults to the user's document.location value.


Page ReferrerSTRING

Optional

The referral source that brought traffic to a page. This value is also used to compute the traffic source. The format of this value is a URL. If not set, defaults to the user's document.referrer value.


Page TitleSTRING

Optional

The title of the page or document. If not set, defaults to the user's document.title value.


Screen ResolutionSTRING

Optional

The resolution of the screen. Format should be two positive integers separated by an x (i.e. 800x600). If not set, calculated from the user's window.screen value.


Send Page ViewsBOOLEAN

Optional

Selection overrides toggled value set within Settings


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.

This event signifies when one or more items is purchased by a user.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies a promotion was viewed from a list.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

The event signifies that an item was added to a wishlist. Use this event to identify popular gift items in your app.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies that an item was removed from a cart.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Log this event when a lead has been generated to understand the efficacy of your re-engagement campaigns.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies a promotion was selected from a list.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies that some content was shown to the user. Use this event to discover the most popular items viewed.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

This event signifies that a user has begun a checkout.

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


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.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag

Send event when a user logs in

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

Property nameTypeRequiredDescription
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.


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.


Event ParametersOBJECT

Optional

The event parameters to send to Google Analytics 4.


Send ToBOOLEAN

Optional

If the send_to parameter is not set, events are routed to all Tag Ids (AW-xxx, G-xxx) set via Google Tag


The Google Analytics 4 debug mode, DebugView(link takes you to an external page) is supported with the Google Analytics 4 Web destination. DebugView displays the events and user properties that Analytics collects from a user in real-time. This can be helpful when troubleshooting your implementation.

Send events from both the browser and the server

send-events-from-both-the-browser-and-the-server page anchor

With Google Analytics 4 Web, events are sent from the browser to GA4. If you use Segment's Google Analytics 4 Cloud destination to send events through the API and tie data between client-side and server-side, you need to pass the same Client ID from the browser and the server. To do this, fetch the Gtag-generated clientId on the web client and pass it to Segment as a property. For more information, see Google Analytics 4 destination: User Identification on the next steps. Additionally, when using Gtag, Google generates a session_id and session_number when a session begins. 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, see Using Gtagjs and Google Analytics 4 Cloud Destination for more information and an example.

The client_id and the session_id are both cookies stored in the user browser. You can use Google gtag get commands(link takes you to an external page) or other cookie methods to parse these values from the _ga cookie and _ga_measurementId cookie:

  • If your _ga cookie is GA1.1.1783165678.1701112990 then 1783165678.1701112990 is your client_id
  • If your _ga_M12454XDR cookie is GS1.1.1710342977.347.1.1710343074.0.0.0 then 1710342977 is your session_id

You are not required to send a session number for server-side hits. Session metrics come from the client-side data after GA4 stitches server-side event data to the client-side session.

(success)

Success!

Segment recommends that you enable the GA4 Web destination first then incorporate GA4 Cloud destination to augment your client-side tracking, as a hybrid GA4 application is an advanced implementation. Segment also recommends that you have deep knowledge of GA4 session-stitching, troubleshooting, and known caveats of the GA4 Measurement Protocol prior to implementing the Google Analytics 4 destination.

Additional (unmapped) events are sent to GA4

additional-unmapped-events-are-sent-to-ga4 page anchor

Google Analytics 4 collects events triggered by basic interactions with your site. For more information about which interactions are automatically collected, see Google Analytics 4 Automatically Collected events(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; however, events seen in Realtime reports do not always equate to how the data is processed in the standard reports. This disconnect between events seen in Realtime reports and Standard reports happens when a Custom Definition is not defined in the GA4 Admin panel.

Data is not sent to Google

data-is-not-sent-to-google page anchor

For event data to be sent downstream to Google Analytics:

  1. Configure and enable the Set Configuration Fields mapping. This mapping is required for data to be sent downstream because it sets configuration to the GA4 Measurement ID indicated in the Settings and establishes data flow using the config command.
  2. Confirm you call analytics.page() on page load. Analytics.js requires an initial Page call to send data to Google Analytics 4 Web. The Segment snippet includes this initial call by default.
  3. Send data with an event: typically this is a page_view as your first event.

Google has introduced a feature for collecting user-provided data(link takes you to an external page), which Segment doesn't support. If you've enabled this feature in your Google Analytics 4 account, it is irreversible and may cause issues with receiving data. If everything else is set up correctly but data is still not appearing, check if this feature is enabled. If it is, you'll need to create a new GA4 space to resolve the issue.

(information)

If you toggled Page Views in your Settings to

On", the page_view event automatically sends when the Set Configuration Mapping is triggered" If you need to override this setting for your particular use case, see Can I override my send_page_view selection that I declared in Settings?

If no events are flowing to your GA4 instance, use one of the Debugging Tools to check the sequence of GA4 events.

Duplicate page_view events in GA4

duplicate-page_view-events-in-ga4 page anchor

If you are sending multiple gtag('config') commands called from Set Configuration mapping on one page before a new DOM has loaded, and you have defined send_page_view: true with each 'Config' event, you may see duplicate page_view events sent to your GA4 measurement id. If this is the case, see Google's documentation on Ignoring duplicate instances of on-page configuration(link takes you to an external page).

If your site is a Single Page Application (SPA), you may want to leave the Ignore duplicate instances of on-page configuration toggle disabled in the Google Tag Admin as a new DOM is not called on each new page path. If you have a SPA, disabled the Ignore duplicate instances of on-page configuration toggle, and have multiple Set Configuration mappings, use Segment's new Send Page Views field mapping to override the send_page_view parameter in your Settings. This selection takes precedence over what is defined in the Segment Settings. If you leave the selection for your destination undefined, it will fall back to what you selected in the Segment Settings.

If you enabled Enhanced Measurement, you might see additional page_view events. This happens when you enable the Page changes based on browser history events feature in the Advanced settings section of the pageviews settings. To avoid double counting page views on history state changes, disable the Page changes based on browser history events feature. See Google's Manual pageviews(link takes you to an external page) documentation for more information.

Manually send page_view events

manually-send-page_view-events page anchor

If you prefer to keep the Page Views setting disabled and manually send page_view events, see Google's documentation, Manually send page_view events(link takes you to an external page).

With Google Analytics 4 Web, you must configure a Custom Event mapping to manually send page_view events. When mapping the events, set the Event Name to page_view.

You can now override the send_page_view value defined in the Segment Settings for the GA4 destination. To override the send_page_view value, navigate to your Set Configuration Mapping, click "Show More Fields" to expose the field mapping, and select either True or False. This selection takes precedence over what is defined in the Segment Settings. If you leave this selection undefined, Segment uses the selection you made in the Segment Settings.

Tracking UTM Parameters

tracking-utm-parameters page anchor

Segment automatically tracks UTM parameters when they are present in the URL and sends them to Google. For example, with the following URL, Segment would send email_variation1&utm_medium=email&utm_source=email_promo&utm_campaign=summer_sale&utm_id=abcd to Google: https://www.example.com/?utm_content=email_variation1&utm_medium=email&utm_source=email_promo&utm_campaign=summer_sale&utm_id=abcd

By default, if the UTM values are found in the page_location parameter, GA4 automatically maps the campaign parameters to their appropriate value. There is no additional configuration required, unless you want to override what GA4 defines. This is true for both Event mappings and the Set Configuration mapping. If you modify the output of the page_location and the UTM parameters are not included, this might result in erroneous acquisition and attribution mapping.

To observe this feature, trigger a Page call with UTM parameters present in the URL and navigate to the Realtime overview report in GA4 to see the resulting page_view event under the Event count by Event name card. The Acquisition card in the Realtime overview report reflects First User acquisition, but may not reflect the parameters of the event if this was a second session event.

My Events Send to the wrong Google ID

my-events-send-to-the-wrong-google-id page anchor

In each Event Mapping, there is a "Send To" parameter. Set this to "True" if you would like to include the send_to parameter and only send the event to the measurement_id configured in your settings. If you select "False" or do not enter a selection, GA4 Events will broadcast to all measurement IDs, including Google Ads IDs, on the page. These measurement IDs may be set outside of Segment. For more info on how the send_to parameter works, see Google's documentation on Group and Route Data(link takes you to an external page).

Can I override my send_page_view selection that I declared in the Settings?

can-i-override-my-send_page_view-selection-that-i-declared-in-the-settings page anchor

Yes. In the Set Configuration Mapping, click Show All Fields and scroll to Send Page Views. Your selection overrides what is set within the Settings. This is helpful if you are updating the user_id or user_properties for all events on the page where you want to call the config command but do not want to send a page_view.

Differences between the Google Analytics 4 Cloud and Google Analytics 4 Web destinations

differences-between-the-google-analytics-4-cloud-and-google-analytics-4-web-destinations page anchor

Segment's Google Analytics 4 Cloud server-side destination uses Google's Measurement Protocol API to send event data server to server, whereas Segment's Google Analytics 4 Web device-mode destination loads the gtag.js library client-side and uses Segment's event data to map to gtag.js events directly. Each destination has its own advantages and disadvantages. Your choice between the two depends on your specific use case, technical expertise, and the platforms from which you want to track data.

User-provided data collection

user-provided-data-collection page anchor

Google has introduced a beta feature for collecting data provided by users, User-provided data collection(link takes you to an external page). Note that this feature is currently not supported by Segment, and, acknowledging this feature policy in your Google Analytics 4 Account has irreversible effects.