Google Analytics 4 - Collect
What Is Google Analytics 4 - Collect?
Google Analytics 4, commonly referred to as GA4, is the latest iteration of Google's web analytics platform, designed to provide deeper insights into user behavior across websites and apps. It offers a more holistic approach to analytics by integrating data from various touchpoints, including websites, mobile apps, and other digital platforms. GA4 focuses on user-centric measurement, emphasizing the importance of understanding individual user journeys and interactions.
MetaRouter has two integrations for GA4. The GA4 - Collect integration uses the collect endpoint for data and measurement, and it is the recommended integration for GA4. For more information about Google Analytics 4- Measurement, please see here.
Google Analytics 4 - Collect Endpoint vs Measurement Protocol
Collect Endpoint:
- More data accuracy in
- Age demographic
- Page count
- Session start events
- Cannot collect screen resolution data
Measurement Protocol:
- Can collect screen resolution data
- More data on device category
Important Notes & Limitations
- Enable Google Ads auto-tagging for Google Ads reporting.
- Auto-tagging automatically imports Google Ads data into Analytics. Combining Google Ads data with the rich post-click information provided by Analytics allows you to see what happened on your site after people clicked on your ads. When you enable auto-tagging, a parameter called
gclid
is added to your landing page URL when a user clicks over to your site from an ad.
- Auto-tagging automatically imports Google Ads data into Analytics. Combining Google Ads data with the rich post-click information provided by Analytics allows you to see what happened on your site after people clicked on your ads. When you enable auto-tagging, a parameter called
- No user engagement reporting.
- Cross network reporting may not be present in user and traffic acquisition reports.
Getting Started - From Your Google Analytics Account
Obtain your Measurement ID
- Log in to your Google Analytics account.
- Navigate to the Admin section.
- In the “Property settings” column, expand “Data collection and modification”, click on "Data Streams."
- Here, you'll find a list of data streams associated with the property.
- Click on the data stream for which you want to find the measurement ID.
- The measurement ID is displayed at the top of the page. Ex, “G-XXXXX00000”.
Getting Started - From Your MetaRouter Account
Adding a Google Analytics - Collect integration.
From the integration library, add a Google Analytics 4 (Collect) integration. Then, fill out the Connection Parameters:
Connection Parameter | Description |
---|---|
MEASUREMENT_ID | The GA4 measurement ID is a unique identifier assigned to each Google Analytics 4 property, allowing data to be collected and associated with that specific property. |
Adding a Google Gtag Sync
To gather the cid
, gclid
(Google click ID) value, dclid
(Display click ID) value, session ID, and session count, you must add a Google Gtag sync.
- From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three dot dropdown and select “Build AJS File.”
- In the Identity Syncs section, select the Google Gtag sync.
- Fill out the following fields:
- GTAG.js Tag ID - The Tag ID in GA4, also known as the Measurement ID, can be found in Data Streams. Alternatively, you can find it in your GTAG settings. Examples of Tag IDs include GT-XXXXXXXXX, G-XXXXXXXXX, and AW-XXXXXXXXX. For more information on locating the GTAG.js Tag ID, please refer to this guide
- Destination IDs - Allows the sync to connect and direct events to the correct Google product. For Google Ads, the destination ID is the same as the conversion tracking ID, for example AW-98765.
- Floodlight Advertiser ID Object - The Floodlight Advertiser ID. This is not required for the Google Ads integration, but it is used for other Google integrations such as Campaign Manager.
- Cookie Lifetime (in days) - 45 days default
- Fire on Re-sync - Re-syncs for an updated identifier when an Identify call is made.
- Send MetaRouterSync to GA4 - Sends a MetaRouterSync event to GA4 when the sync is loaded on the page.
- Enable Google Consent Mode - If enabled, consent categories 'ad _storage, 'ad_user_data', 'ad _personalization', 'analytics_storage' will be sent to Google when user is opt-in or opt -out
- Advanced Consent Mode Type (when consent mode is enabled) - If consent mode is enabled, the consent mode will be set to advanced' when this is on, and 'basic' when this is off
- Scroll down and click the Save and Build File button.
- Deploy your AJS file to propagate changes to your web property.
Event Mappings
MetaRouter provides all of the event mappings that Google integrations typically require. You may add custom events, parameters or mappings in accordance with Google Analytics 4 - Collect’s API documentation.
Global
Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String | N/A - Expression |
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: Integer |
|
| Type: Integer | N/A - Expression |
| Type: String | Enrichment - |
| Type: Integer | Enrichment - |
| Type: Boolean | Enrichment - |
Type: String | N/A - Expression |
*Note: You must set up user parameters in GA4 as a custom dimension to avoid errors with this function. To do this:
- Navigate to Admin > Data Display > Custom Definitions in GA4.
- Click Create Custom Dimension.
- Name your dimension, set the Scope to User, and set the User Property to
metarouter_anonymousid
.
Event Specific
page
Output Key | Description | Expected Input |
---|---|---|
| Type: String | Enrichment - |
| Type: Boolean | Enrichment - |
cart_viewed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | Enrichment - |
product_added
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | N/A - Expression |
| Type: Boolean | Enrichment - |
| Type: String | Enrichment - |
order_refunded
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: Number |
|
| Type: Number |
|
| Type: String | Enrichment - `` |
product_viewed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | N/A - Expression |
| Type: Boolean | Enrichment - |
| Type: String | Enrichment - |
order_completed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: Number |
|
| Type: Number |
|
| Type: Boolean | Enrichment - |
| Type: String | Enrichment - |
product_clicked
Output Key | Description | Expected Input |
---|---|---|
| Type: String | N/A - Expression |
| Type: String | Enrichment - |
product_removed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | N/A - Expression |
| Type: String | Enrichment - |
checkout_started
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: Number |
|
| Type: Number |
|
| Type: String | Enrichment - |
promotion_viewed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String | Enrichment - |
products_searched
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String | Enrichment - |
promotion_clicked
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: String | Enrichment - |
product_list_viewed
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String | Enrichment - |
payment_info_entered
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: String |
|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | Enrichment - |
product_added_to_wishlist
Output Key | Description | Expected Input |
---|---|---|
| Type: String |
|
| Type: Number | N/A - Expression |
| Type: String | N/A - Expression |
| Type: String | Enrichment - |
Required & Recommended Identifiers
These identifiers must be mapped to Google Analytics 4 - Collect in order for successful user matching to occur. Without these IDs, any events sent to Google Analytics 4 - Collect will not appear in your dashboard. For your convenience, required and recommended IDs are mapped as Global parameters to ensure they are added to every event.
Attribute | Example | Sync Injector Required? |
---|---|---|
| 35009a79-1a05-49d7-b876-2b884d0f825b | Yes |
| Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14 | No |
| 1.2.3.4 | No |
| AJKDLSJFKLJ2390SKDFJLKJ23KJF9 | Yes |
| 620 | Yes |
Additional Identifiers
These identifiers should be mapped to Google Analytics 4 - Collect whenever possible to ensure the highest user match rates possible. If using these identifiers, they must be added as Global or Event Specific mappings.
Attribute | Description | Example |
---|---|---|
gclid | A Google Click Identifier generated by Google Ads or Search Ads 360. | &gclid=CjwKCAjwt-OwBhBnEiwAgwzrUkyNMRwtorgWNStUyWMG50WbzKNMWAFeWOHtq5q0cEbAHYKX7a4hNBoCwugQAvD_BwE |
dclid | Conversions can be attributed to ad clicks through the use of Display Click IDs (DCLIDs), typically used for DV360 conversions. | &dclid=CKDdz-fE_IUDFYtTCQkdbyMOPg |
Additional Google Analytics 4 - Collect Documentation
- [GA4] Recommended events
- [GA4] Custom events
- Enhanced measurement events
- [GA4] Tag your Google Ads final URLs
Updated 18 days ago