Skip to content

Commit 15dae35

Browse files
Apply suggestions from code review
Co-authored-by: forstisabella <[email protected]>
1 parent 2ce093a commit 15dae35

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/connections/destinations/catalog/actions-google-analytics-4-web/ga4-faq-and-troubleshooting

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ Yes. In the Set Configuration Mapping, click Show All Fields and scroll to Send
7979

8080
### Differences between Google Analytics 4 Cloud and Google Analytics 4 Web destinations
8181

82-
Segment's [Google Analytics 4 Cloud](/docs/connections/destinations/catalog/actions-google-analytics-4/) server-side destination uses Google's Measurement Protocol API to send event data server to server, whereas Segment's [Google Analytics 4 Web](/docs/connections/destinations/catalog/actions-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 will depend on your specific use case, technical expertise, and the platforms from which you want to track data.
82+
Segment's [Google Analytics 4 Cloud](/docs/connections/destinations/catalog/actions-google-analytics-4/) server-side destination uses Google's Measurement Protocol API to send event data server to server, whereas Segment's [Google Analytics 4 Web](/docs/connections/destinations/catalog/actions-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.

src/connections/destinations/catalog/actions-google-analytics-4-web/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ When you have Segment installed, you can use your existing Analytics 2.0 trackin
1919
2020
## Getting started
2121

22-
Before you connect Segment to Google Analytics 4, configure a Google Analytics 4 property in your Analytics account. Additionally, plan and enable any Custom Definitions in your GA4 Admin Panel prior to sending data from Segment to GA4. For more information, see Google's article [Set up Analytics for a website and/or app](https://support.google.com/analytics/answer/9304153){:target='_blank'}.
22+
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](https://support.google.com/analytics/answer/9304153){:target='_blank'}.
2323

2424
To connect the Google Analytics 4 Web destination:
2525

2626
1. From the Segment web app, click **Catalog**, then click **Destinations**.
2727
2. Search for “Google Analytics 4 Web” in the Destinations Catalog, and select the destination.
2828
3. Click **Configure Google Analytics 4 Web**.
29-
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](/docs/connections/sources/catalog/libraries/website/javascript/). For mobile source tracking, view Firebase Destination configuration {{insert link}}.
29+
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](/docs/connections/sources/catalog/libraries/website/javascript/). For mobile source tracking, view the [Firebase Destination](/docs/connections/destinations/catalog/firebase/).
3030
5. On the **Settings** tab, under **Basic Settings**, enter in the [Measurement ID](https://support.google.com/analytics/answer/9539598){:target='_blank'} associated with your GA4 web stream.
3131
6. Set up your event mappings by following the steps in the Destinations Actions documentation on [Customizing mappings](/docs/connections/destinations/actions/#customizing-mappings).
3232
7. Analytics.js requires an initial Page call to send data to Google Analytics 4 Web. The [Segment snippet](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-add-the-segment-snippet) includes this initial call by default.
3333
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. This command MUST be called at each new page load.
3434

3535
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](https://support.google.com/analytics/answer/9271392){:target="_blank"} or[DebugView](https://support.google.com/analytics/answer/7201382){:target="_blank"} 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 https://tagassistant.google.com(https://tagassistant.google.com){:target=”_blank”} or in your browser’s Dev Tools, view GA4 collect requests by filtering by /collect.
3636

37-
Some events automatically populate in Google Analytics. For example, there are some [Automatically Collected] (https://support.google.com/analytics/answer/9234069){:target=”_blank”} events collected by triggering the Set Configuration Mapping. For example, calling gtag(‘config’), and [Enhanced Measurement events](https://support.google.com/analytics/answer/9216061){:target=”_blank”} controlled by toggling “on” in your GA4 Admin panel use event listeners to send events; in addition, all events tracked via GA4 Web, populate some commonly used parameters like page_location without additional configuration. Review Google’s documents for more information found [here](https://support.google.com/analytics/table/13594742){:target=”_blank”}
37+
Google Analytics automatically populates some events and parameters. For example, there are [Automatically Collected] (https://support.google.com/analytics/answer/9234069){:target=”_blank”} events collected by triggering the Set Configuration Mapping. Calling gtag(‘config’) and enabling [Enhanced Measurement events](https://support.google.com/analytics/answer/9216061){:target=”_blank”}, 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](https://support.google.com/analytics/table/13594742){:target=”_blank” documentation for more information.
3838

3939
### Recommended events
4040

41-
Google Analytics 4 advises for the use of [Recommended events](https://support.google.com/analytics/answer/9267735){:target="_blank"} and properties to power certain built-in reports. Segment’s Google Analytics 4 Web destination provides prebuilt mappings to automatically map your Segment spec events to the corresponding Google Analytics 4 events and properties. If your Segment events don’t follow the Segment spec exactly, you can modify the mappings. For example, Segment maps `Order Completed` events to the Google Analytics 4 `Purchase` event by default. If your company uses `Products Purchase` to indicate a purchase, you can map it in the Purchase action’s Event Trigger instead.
41+
Google recommends that you use their [Recommended events](https://support.google.com/analytics/answer/9267735){:target="_blank"} and properties to power certain built-in reports in Google Analytics 4. Segment’s Google Analytics 4 Web destination provides prebuilt mappings to automatically map your Segment spec events to the corresponding Google Analytics 4 events and properties. If your Segment events don’t follow the Segment spec exactly, you can modify the mappings. For example, Segment maps an `Order Completed` event to the Google Analytics 4 `Purchase` event, but if your company uses `Products Purchase` to indicate a purchase, you can map it in the Purchase action’s Event Trigger instead.
4242

4343
Segment recommends using the prebuilt mappings when possible. However, the Segment spec doesn’t have an equivalent event for every Google Analytics 4 Recommended event. If there are other recommended events you'd like to send, use the [Custom Event action](/docs/connections/destinations/catalog/actions-google-analytics-4-web/#custom-event). For example, to send a `spend_virtual_currency` event, create a mapping for Custom Event, set up your Event Trigger criteria, and input a literal string of `spend_virtual_currency` as the Event Name. You can use the Event Parameters object to add fields that are in the `spend_virtual_currency` event such as `value` and `virtual_currency_name`. Remember to define custom parameters as [custom dimensions and metrics](/docs/connections/destinations/catalog/actions-google-analytics-4-web/#custom-dimensions-and-metrics) within the GA4 Admin panel first.
4444

45-
### Custom events and Event Naming
45+
### Custom events and event naming
4646

4747
Before you create a custom event, make sure the event you want to create isn't already collected through an [Automatically Collected event](https://support.google.com/analytics/answer/9234069?sjid=7831609405656395105-NA){:target="_blank"} or recommended as a [Recommended event](https://support.google.com/analytics/answer/9267735?sjid=7831609405656395105-NA){:target="_blank"}.
4848
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.
@@ -62,11 +62,11 @@ With Google Analytics 4, you must create custom dimensions and metrics, also kno
6262

6363
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`.
6464

65-
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. Additionally, you can add more event parameters when you need them. It is advised to review GA4’s list of defined event parameters - anything beyond that list is a custom event parameter. Lastly, be knowledgeable of the limits of how many Custom Definitions your GA4 instance allows as well as how many parameters you can send with each event, [GA4 Limits](https://https://support.google.com/analytics/answer/9267744){:target=_blank”}
65+
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](https://https://support.google.com/analytics/answer/9267744){:target=_blank”} also impact how many Custom Definitions your GA4 instance allows and how many parameters you can send with each event.
6666

6767
### Conversion events
6868

69-
Some of Segment's prebuilt [Available Actions](/docs/connections/destinations/catalog/actions-google-analytics-4-web/#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](https://support.google.com/analytics/answer/9267568?sjid=1275909514202748631-NA){:target="_blank"} in Google's docs.
69+
Some of Segment's prebuilt [Available Actions](/docs/connections/destinations/catalog/actions-google-analytics-4-web/#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](https://support.google.com/analytics/answer/9267568?sjid=1275909514202748631-NA){:target="_blank"} in Google's documentation.
7070

7171
## Consent mode
7272
[Consent mode](https://support.google.com/analytics/answer/9976101?hl=en){:target="_blank"} is a feature provided by Google in the context of its products, particularly the Gtag library and Google Analytics. As of March 6, 2024, Google announced that consent mode must function for European Economic Area (EEA) users, otherwise data from EEA users won't process.
@@ -113,7 +113,7 @@ To enable consent mode for your Google Analytics 4 Web destination:
113113
* Ad User Data Consent State
114114
* Ad Personalization Consent State
115115
You can manually select `Granted` or `Denied` from the dropdown menu for Advanced consent mode settings, and type in `granted` or `denied` for basic consent mode settings.
116-
5. *(Option 2)* Under the **Select mappings** section, create an event variable to directly grab the value from the payload. For example, `properties.adStorageConsentState`. Ensure it translates to `granted` or `denied`. You can use an insert function to translate to `granted` or `denied`. Use the replace function if it's a string. Do this for these fields:
116+
5. *(Option 2)* Under the **Select mappings** section, create an event variable to directly grab the value from the payload (for example, `properties.adStorageConsentState`). Ensure it translates to `granted` or `denied`. You can use an insert function to translate to `granted` or `denied`. Use the replace function if it's a string. Do this for these fields:
117117
* Ads Storage Consent State
118118
* Analytics Storage Consent State
119119
* Ad User Data Consent State

0 commit comments

Comments
 (0)