Skip to main content

Google Analytics 4 (GA4) Settings

This document explains how to configure GA4 tracking via GTM.

Container File

Download the GA4 container file and import it into GTM:

Download GA4 Container

Container Import

Follow the steps on the Analytics & Tagging page to import the container.

1. Getting Your GA4 Measurement ID

Step 1: Sign in to Google Analytics

Go to analytics.google.com.

Step 2: Navigate to Data Streams

  1. Click Admin in the left menu
  2. Under Property settings > Data collection and modification, click Data streams

GA4 Admin - Data Streams

Step 3: Copy the Measurement ID

  1. Click on your web stream
  2. Copy the Measurement ID value (e.g. G-1234567890)

GA4 Data Streams - Measurement ID

Measurement ID Format

The Measurement ID starts with G-. Example: G-ABC123XYZ

2. Updating the GA4 Measurement ID in GTM

Step 1: Sign in to GTM

Go to tagmanager.google.com.

Step 2: Navigate to Variables

  1. Click Variables in the left menu
  2. Under User-Defined Variables, click GA4 Measurement ID

GTM Variables - GA4 Measurement ID

Step 3: Update the Measurement ID

  1. Replace the G-XXXXXXXXXX value in the Value field with your own Measurement ID
  2. Click Save

GA4 Measurement ID Edit

3. Testing

Preview Mode

  1. Click Preview in the top-right corner of GTM
  2. Enter your site URL and click Connect
  3. Browse your site and verify that events are firing in the GTM Debug panel

GA4 Realtime Report

  1. Go to Google Analytics > Reports > Realtime
  2. Check that data is coming in while browsing the site

4. Publishing

After a successful test:

  1. Click Submit in the top-right corner of GTM
  2. Enter a version name (e.g. "GA4 Setup")
  3. Click Publish

Tracked Events

EventDescription
page_viewPage view (automatic)
view_itemProduct detail page view
view_item_listProduct list view
select_itemSelect product from list
add_to_cartAdd to cart
remove_from_cartRemove from cart
view_cartCart view
begin_checkoutBegin checkout
add_shipping_infoAdd shipping info
add_payment_infoAdd payment info
purchasePurchase
refundRefund
searchSearch
loginLogin
sign_upRegistration
add_to_wishlistAdd to wishlist
generate_leadLead generation
view_promotionPromotion view
select_promotionPromotion selection

Troubleshooting

Events not appearing in GTM

  • Refresh the page and restart Preview mode
  • Clear the browser cache

No data in GA4

  • Make sure the Measurement ID was entered correctly
  • GA4 data may be delayed by 24–48 hours; check the Realtime report

Duplicate events

  • Make sure the same tag has not been imported more than once