How to Set Up GA4 Events in Google Tag Manager

Google tag manager

Accurately tracking user behavior and ecommerce interactions is essential for making data-driven decisions. If your website already sends event data to the data layer, the next step is to configure Google Tag Manager (GTM) to forward that data to Google Analytics 4 (GA4).

This guide walks you through setting up ecommerce, custom, search, and login events in GTM.


Preliminary: Set Up a Google Tag

A Google Tag is required for all GA4 Event tags to send data to your GA4 property. You may already have one set up in your GTM container — check your existing tags for a tag of type Google Tag with your GA4 Measurement ID (G-XXXXXXXXXX).

  • If it already exists: no action needed, note the tag name for reference in the steps below.
  • If it doesn’t exist: create a new tag with the following configuration:
    • Tag Name: Google Tag - G-XXXXXXXXXX
    • Tag Type: Google Tag
    • Tag ID: G-XXXXXXXXXX (your GA4 Measurement ID)
    • Triggering: All Pages

Setting up Ecommerce Events in GTM

1. Create Data Layer Variables

Create a new variable for each of the items below, choosing Data Layer Variable as the type:

Variable Name Data Layer Variable Name
DLV - ecommerce.coupon ecommerce.coupon
DLV - ecommerce.currency ecommerce.currency
DLV - ecommerce.item_list_id ecommerce.item_list_id
DLV - ecommerce.item_list_name ecommerce.item_list_name
DLV - ecommerce.items ecommerce.items
DLV - ecommerce.shipping ecommerce.shipping
DLV - ecommerce.tax ecommerce.tax
DLV - ecommerce.transaction_id ecommerce.transaction_id
DLV - ecommerce.value ecommerce.value

2. Create a Trigger

Create a new trigger with the following configuration:
- Trigger Name: Ecommerce Events (Regex)
- Trigger Type: Custom Event
- Event Name: ^(view_item|view_item_list|select_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_shipping_info|add_payment_info|purchase|refund|view_promotion|select_promotion)$
- Enable Use regex matching
- Fires on: All Custom Events

3. Create a Tag

Create a new tag with the following configuration:
- Tag Name: GA4 - Ecommerce Events
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: (select your Google Tag from the preliminary step)
- Event Name: {{Event}}
- More Settings: Enable Send Ecommerce data, with data source set to Data Layer

💡 This setting automatically forwards all standard ecommerce fields (items, value, currency, etc.) from the data layer to GA4 — no need to map them individually as event parameters.

  • Triggering: Ecommerce Events (Regex)

Setting up Custom Events in GTM

Below is the setup for tracking the following custom interaction events: shipping_address, billing_address, address_validation, payment_method, enter_coupon, remove_coupon, enter_client_order_ref, enter_customer_message

1. Create Data Layer Variables

Create a new variable for each of the items below, choosing Data Layer Variable as the type:

Variable Name Data Layer Variable Name
DLV - interaction interaction
DLV - type type

Only some events send interaction or type. It’s okay if the value is undefined for others.

2. Create a Trigger

Create a new trigger with the following configuration:
- Trigger Name: Custom Events (Regex)
- Trigger Type: Custom Event
- Event Name: ^(shipping_address|billing_address|address_validation|payment_method|enter_coupon|remove_coupon|enter_client_order_ref|enter_customer_message)$
- Enable Use regex matching
- Fires on: All Custom Events

3. Create a Tag

Create a new tag with the following configuration:
- Tag Name: GA4 - Custom Events
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: (select your Google Tag from the preliminary step)
- Event Name: {{Event}}
- Event Parameters:

Event Parameter Value
interaction {{DLV - interaction}}
type {{DLV - type}}
  • Triggering: Custom Events (Regex)

Setting up Search and Login Events in GTM

1. Create Data Layer Variables

Create a new variable for each of the items below, choosing Data Layer Variable as the type:

Variable Name Data Layer Variable Name
DLV - search_term search_term
DLV - method method

2. Create Triggers

Create a new trigger for each of the items below, both using trigger type Custom Event:

Trigger Name Event Name
Search search
Login login

3. Create Tags

Create two new tags — one for Search and one for Login.

Search Tag:
- Tag Name: GA4 - Search
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: (select your Google Tag from the preliminary step)
- Event Name: search
- Event Parameters:

Event Parameter Value
search_term {{DLV - search_term}}
  • Triggering: Search

Login Tag:
- Tag Name: GA4 - Login
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: (select your Google Tag from the preliminary step)
- Event Name: login
- Event Parameters:

Event Parameter Value
method {{DLV - method}}
  • Triggering: Login

To learn about GA4 for website chat CLICK HERE