You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/destinations/catalog/actions-google-analytics-4-web/ga4-faq-and-troubleshooting
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -13,21 +13,21 @@ The Google Analytics 4 [debug mode](https://support.google.com/analytics/answer/
13
13
14
14
With Google Analytics 4 Web, events are sent from the browser (client-side) to GA4. If you use Segment’s [Google Analytics 4 Cloud destination](/docs/connections/destinations/catalog/actions-google-analytics-4/#benefits-of-google-analytics-4-cloud) to send events through the Measurement Protocol API and want to tie data between client-side and server-side, you need to pass the same Client ID from the browser and the server for GA4 to merge events around a distinct user, and if you want the server-side event to be tied to the client-side session, you must pass the session_id in the server side event.
15
15
16
-
The client_id and the session_id are both cookies stored in the user browser. You can use [Google gtag get commands](https://developers.google.com/tag-platform/gtagjs/reference#get){:target=”_blank”} or other cookie methods to parse these values from the _ga cookie and _ga_measurementId cookie:
16
+
The client_id and the session_id are both cookies stored in the user browser. You can use [Google gtag get commands](https://developers.google.com/tag-platform/gtagjs/reference#get){:target=”_blank”} or other cookie methods to parse these values from the _ga cookie and _ga_measurementId cookie:
17
17
If your _ga cookie is GA1.1.1783165678.1701112990 then 1783165678.1701112990 is your client_id
18
18
If your _ga_M12454XDR cookie is GS1.1.1710342977.347.1.1710343074.0.0.0 then 1710342977 is you session_id
19
19
20
-
It is not required to send a session number for server-side hits. Session metrics will come from the client-side data after the server-side event data is stitched to the client-side session.
20
+
It is not required to send a session number for server-side hits. Session metrics will come from the client-side data after the server-side event data is stitched to the client-side session.
21
21
22
-
A hybrid GA4 application is an advanced implementation and it is advised to enable GA4 Web destination first, then incorporate GA4 Cloud destination to augment your client-side tracking. It is also recommended you have deep knowledge of GA4 session-stitching, troubleshooting, and known caveats of GA4 Measurement Protocol prior to implementing.
22
+
A hybrid GA4 application is an advanced implementation and it is advised to enable GA4 Web destination first, then incorporate GA4 Cloud destination to augment your client-side tracking. It is also recommended you have deep knowledge of GA4 session-stitching, troubleshooting, and known caveats of GA4 Measurement Protocol prior to implementing.
23
23
24
24
### Additional (unmapped) events are sent to GA4
25
25
26
26
Google Analytics 4 collects events triggered by basic interactions with your site. For more information, see [Google Analytics 4 Automatically Collected events](https://support.google.com/analytics/answer/9234069?hl=en){:target="_blank"}
27
27
28
28
### Data takes a long time to appear in Google's reports
29
29
30
-
Google may take [24-48 hours](https://support.google.com/analytics/answer/9333790){:target="_blank"} 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](https://support.google.com/analytics/answer/9271392){:target="_blank"} 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. Typically we see this when a Custom Definition is not defined in the GA4 Admin panel.
30
+
Google may take [24-48 hours](https://support.google.com/analytics/answer/9333790){:target="_blank"} 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](https://support.google.com/analytics/answer/9271392){:target="_blank"} 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. Typically we see this when a Custom Definition is not defined in the GA4 Admin panel.
31
31
32
32
### Data is not sent to Google
33
33
@@ -36,45 +36,45 @@ For event data to be sent downstream to Google Analytics:
36
36
1. The **Set Configuration Fields** mapping must be configured and enabled in your mappings. 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.
37
37
38
38
2. Ensure that you're calling `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.
39
-
3. Send data with an event, typically this is a page_view as your first event. Note: If you toggled “On” Page Views in your Settings, then the page_view event will automatically send when Set Configuration Mapping is triggered. If you need to override this setting for your particular use case, read {{link to this section: ### Can I override my send_page_view selection that I declared in the Settings?}}
39
+
3. Send data with an event, typically this is a page_view as your first event. Note: If you toggled “On” Page Views in your Settings, then the page_view event will automatically send when Set Configuration Mapping is triggered. If you need to override this setting for your particular use case, read {{link to this section: ### Can I override my send_page_view selection that I declared in the Settings?}}
40
40
41
-
All in all, the Set Configuration Mapping is a crucial part of your GA4 Web setup. It provides the “handshake” between your site and the gtag library. If no events are not sending to your GA4 instance, then use one of the Debugging Tools to check the sequence of GA4 events
41
+
All in all, the Set Configuration Mapping is a crucial part of your GA4 Web setup. It provides the “handshake” between your site and the gtag library. If no events are not sending to your GA4 instance, then use one of the Debugging Tools to check the sequence of GA4 events
42
42
43
43
### Duplicate `page_view` events in GA4
44
44
45
-
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, please refer to Google's documentation on [Ignoring duplicate instances of on-page configuration](https://support.google.com/analytics/answer/9973999?hl=en#:~:text=as%20described%20below.-,Ignore%20duplicate%20instances%20of%20on%2Dpage%20configuration,Click%20Save.,-Give%20feedback%20about){:target="_blank"}.
45
+
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, please refer to Google's documentation on [Ignoring duplicate instances of on-page configuration](https://support.google.com/analytics/answer/9973999?hl=en#:~:text=as%20described%20below.-,Ignore%20duplicate%20instances%20of%20on%2Dpage%20configuration,Click%20Save.,-Give%20feedback%20about){:target="_blank"}.
46
46
47
-
Note: If your site is a Single Page Application (SPA), you may want to leave this toggle ‘off’ in the Google Tag Admin since a new DOM would not be called on each new page path. If that is the case, and you have multiple Set Configuration mappings, utilize the new field Send Page Views field mapping to override the `send_page_view` parameter that is set in your Settings. This selection will take precedence over what is defined in the Segment Settings. Leaving the selection undefined will always fallback to what is selected in the Segment Settings.
48
-
If you have enabled Enhanced Measurement, additional `page_view` events may be sent from this selection where you are tracking pages from Segment, but also from Enhanced Measurement. Typically this happens from **Page changes based on browser history events** under the advanced settings of the **pageviews** section. To avoid double counting pageviews on history state changes disable this feature. More in Google's documentation on [Manual Pageviews](https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag#manual_pageviews){:target="_blank"}.
47
+
Note: If your site is a Single Page Application (SPA), you may want to leave this toggle ‘off’ in the Google Tag Admin since a new DOM would not be called on each new page path. If that is the case, and you have multiple Set Configuration mappings, utilize the new field Send Page Views field mapping to override the `send_page_view` parameter that is set in your Settings. This selection will take precedence over what is defined in the Segment Settings. Leaving the selection undefined will always fallback to what is selected in the Segment Settings.
48
+
If you have enabled Enhanced Measurement, additional `page_view` events may be sent from this selection where you are tracking pages from Segment, but also from Enhanced Measurement. Typically this happens from **Page changes based on browser history events** under the advanced settings of the **pageviews** section. To avoid double counting pageviews on history state changes disable this feature. More in Google's documentation on [Manual Pageviews](https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag#manual_pageviews){:target="_blank"}.
49
49
50
50
### Manually send `page_view` events
51
51
52
52
If you prefer to keep the **Page Views** setting disabled and manually send a `page_view`, please see this Google Doc for more on [Manual Pageviews](https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag#manually_send_page_view_events).
53
53
54
54
With Google Analytics 4 Web, you will need to configure a [Custom Event](/docs/connections/destinations/catalog/actions-google-analytics-4-web/#custom-event) mapping for manually sending `page_view` events. When mapping the events, please make sure to set the Event Name to `page_view`.
55
55
56
-
As announced in an earlier section, Segment recently enabled the ability to override the send_page_view value defined in the Segment Settings. If needed, within your Set Configuration Mapping, select “Show More Fields” to expose the field mapping, and select either True or False. This selection will take precedence over what is defined in the Segment Settings. Leaving the selection undefined will always fallback to what is selected in the Segment Settings.
56
+
As announced in an earlier section, Segment recently enabled the ability to override the send_page_view value defined in the Segment Settings. If needed, within your Set Configuration Mapping, select “Show More Fields” to expose the field mapping, and select either True or False. This selection will take precedence over what is defined in the Segment Settings. Leaving the selection undefined will always fallback to what is selected in the Segment Settings.
57
57
58
58
### Tracking UTM Parameters
59
59
60
60
UTM Parameters are automatically tracked and sent to Google when they are present in the URL. For example, with the following URL:
By default, if the UTM values are found in the `page_location` parameter, GA4 will automatically map 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 could result in erroneous acquisition and attribution mapping. Furthermore, you can observe by triggering a `Page` call with UTM parameters present in the URL and navigating 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 Realtime reflects First User acquisition and may not reflect the parameters of the event if this was a second session event
63
+
By default, if the UTM values are found in the `page_location` parameter, GA4 will automatically map 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 could result in erroneous acquisition and attribution mapping. Furthermore, you can observe by triggering a `Page` call with UTM parameters present in the URL and navigating 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 Realtime reflects First User acquisition and may not reflect the parameters of the event if this was a second session event
64
64
65
65
### Pass Custom Event Parameters to all Events and Custom Item Parameters to all Recommended Ecommerce Events
66
66
67
-
Within the Set Configuration Mapping, click Show All Fields, and enter any custom Event Parameters you would like to pass to all events on the page, including page_view. Remember that any event parameters that have the same parameter key in Event Mappings will take precedence over what is set in the Set Configuration Mapping.
67
+
Within the Set Configuration Mapping, click Show All Fields, and enter any custom Event Parameters you would like to pass to all events on the page, including page_view. Remember that any event parameters that have the same parameter key in Event Mappings will take precedence over what is set in the Set Configuration Mapping.
68
68
69
-
To send custom item parameters, add the custom item parameter name in mappings where there is a Products array. Make sure to register your custom item parameter in the GA4 Admin panel if you would like this value processed in the GA4 UI. Custom item parameters can ONLY be added in the Products array. If added as an Event Parameter, it will be registered as an Event Parameter.
69
+
To send custom item parameters, add the custom item parameter name in mappings where there is a Products array. Make sure to register your custom item parameter in the GA4 Admin panel if you would like this value processed in the GA4 UI. Custom item parameters can ONLY be added in the Products array. If added as an Event Parameter, it will be registered as an Event Parameter.
70
70
71
71
### My Events Send to the wrong Google ID
72
72
73
-
In each Event Mapping, there is a “Send To” parameter. Indicate “True” if you would like to include the send_to parameter and only send the event to the measurement_id indicated within the 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.
73
+
In each Event Mapping, there is a “Send To” parameter. Indicate “True” if you would like to include the send_to parameter and only send the event to the measurement_id indicated within the 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.
74
74
75
75
### Can I override my send_page_view selection that I declared in the Settings?
76
76
77
-
Yes. In the Set Configuration Mapping, click Show All Fields and scroll to Send Page Views. Your selection will override 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.
77
+
Yes. In the Set Configuration Mapping, click Show All Fields and scroll to Send Page Views. Your selection will override 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.
78
78
79
79
### Differences between Google Analytics 4 Cloud and Google Analytics 4 Web destinations
0 commit comments