GA4

How to set up GA4 tags with Google Tag Manager

Google Analytics 4 runs in Google Tag Manager on two tag types: the Google tag (which replaced the GA4 Configuration tag in September 2023), fired on the Initialization trigger, and GA4 Event tags for the actions you measure. This guide covers both, the settings variables, Google's collection limits, the e-commerce events with their data layer fields, and a query that checks in the BigQuery export what the tags actually sent.

GA4Alyona Samovar15 min read

How to set up GA4 tags with Google Tag Manager

To set up Google Analytics 4 in Google Tag Manager, add the Google Analytics destination tag, or a Google tag, with your tag ID and fire it on the Initialization – All Pages trigger. Then add a GA4 Event tag, with your measurement ID, for each action you want to measure. Test everything in preview mode before you publish the container.

Guides written before September 2023 send you to a GA4 Configuration tag that no longer exists: Google replaced it with the Google tag that month. GA4 Event tags changed with it: each one now carries its own measurement ID instead of pointing at a configuration tag.

If your conversion counts are someone’s KPI, the tag setup is not plumbing: a purchase without a transaction ID, or an add-to-cart without its items, is a wrong number in next week’s report.

Note: This post was originally published in September 2023. It was fully updated in November 2026 for the Google tag, the Google Analytics destination tag and the Initialization trigger, and checked against Google’s Tag Manager and Analytics Help pages that month.

This guide assumes Google Tag Manager is already installed on your site. If it is not, start with our guide on how to install Google Tag Manager.

Reading to get this done?

Setting up the Google tag, formerly the GA4 configuration tag

Setting up the Google tag, formerly the GA4 configuration tag

The Google tag is the base of a GA4 setup in Tag Manager. It loads your GA4 property on the page, and every GA4 Event tag depends on it having loaded.

Google announced the change in its Tag Manager help center: the Google tag “will replace the Google Analytics: GA4 Configuration tag”, and existing GA4 Configuration tags “will be automatically upgraded to the Google tag”, with measurement working as before (Announcement: Google tag and Tag Manager). What changed for the person setting it up:

Before September 2023 Now
GA4 Configuration tag Google tag, or the Google Analytics destination tag
Measurement ID on the configuration tag Tag ID on the Google tag. GA4 Event tags still use the measurement ID
GA4 Event tag pointed at a configuration tag GA4 Event tag carries its own measurement ID
“Send a page view event when this configuration loads”, “Send to server container” Moved to a configuration settings variable
Fields to Set Replaced by a configuration settings variable and an event settings variable
User Properties on the tag Moved into the event settings variable

Google says these are changes to how the tag looks, with no change to how it behaves.

What does the Google tag do?

What does the Google tag do?

According to Google’s Set up Google Analytics in Tag Manager page, the Google tag loads your GA4 property on the page and:

  1. Declares common settings for Google Analytics tags. Parameters set on the Google tag, or in its configuration settings variable, apply to what follows.
  2. Sets the Google Analytics cookies. That includes the _ga cookie holding the Client ID, which GA4 uses to recognise a returning browser and tell new from returning users.
  3. Sends the automatically collected and enhanced measurement events. A page view event is sent by default, and session_start and first_visit among the automatic events. With enhanced measurement turned on for the web stream, GA4 also collects scrolls, outbound clicks, site search, video engagement, file downloads and form interactions without extra tags.

GA4 has no separate session tag. It builds sessions from the events and the session_start event the Google tag sends.

What the Google tag does not do on its own is record your business events: a newsletter sign-up, an add-to-cart, a purchase. Those are GA4 Event tags, or recommended e-commerce events your site pushes to the data layer.

Hand this to your AI

Your GA4 tags are published in Tag Manager, but you're not sure the e-commerce events send the fields they should.

Paste this into your AI assistant. It checks your GA4 data for each e-commerce event your tags send and lists the ones arriving without items, value or currency.

The prompt

check what my GA4 tags actually sent: for each e-commerce event, how often it fired and how many hits lack items, value or currency

How to set up the Google tag using GTM

How to set up the Google tag using GTM

Google now offers two ways, and recommends the first.

Option 1, recommended: the Google Analytics destination tag. Google’s Set up Google Analytics in Tag Manager page describes it as part of “an improved experience for tags”, with container-level settings and, in its words, “less javascript on your pages”.

  1. Open your container. In Tag Manager, on the Accounts tab, select the container for the site.
  2. Create a new tag. On the overview page, click Add Tag, or go to Tags and click New.

Button highlighting the option to create a new tag in Google Tag Manager.

  1. Choose the tag type. Click Tag Configuration → Google Analytics → Google Analytics.
  2. Enter the Tag ID. For GA4 it is the measurement ID of your web stream, which starts with G-. You find it in Google Analytics under Admin → Data collection and modification → Data streams, in the stream’s details.
  3. Optional settings. Configuration settings, shared event settings, global parameters, sending data to a tagging server, user properties. Leave them at their defaults unless you have a reason.
  4. Triggering. Select Initialization – All Initialization Events, or Some Initialization Events if the tag should not run on every page.
  5. Save.

Option 2: the Google tag. Go to Tags → New, name the tag (for example, Google tag), choose Google Tag as the tag type, enter the Tag ID, and select the same Initialization trigger. The optional settings are the same.

Why Initialization and not All Pages. Older guides, this one included, told you to fire the configuration tag on the All Pages page view trigger. Google’s current instructions say Initialization. The Initialization trigger fires before Page View, DOM Ready and Window Loaded, so the Google tag has loaded before any event tag on the page needs it. If your container still uses All Pages, nothing is broken: it matters only when you have event tags that fire as early as page view, and Google does not describe it as a cause of lost data.

Preview, then publish.

  1. In the Workspace tab, click Preview. Tag Assistant opens in a new tab.
  2. Enter your site’s URL and click Connect. On the first event of the page, the Google tag should be under Tags Fired.
  3. Click Submit, choose Publish and Create Version, give the version a name and a description, and click Publish.

Remove any hard-coded gtag.js snippet for the same property in the same release, or page views are sent twice.

Settings variables. Parameters that every tag should carry, such as a site language or a sale’s discount code, go once into a Google Tag: Configuration Settings or Google Tag: Event Settings variable instead of into each tag.

GA4 event tag: Deeper insights from user interactions

GA4 event tag: Deeper insights from user interactions

The Google tag records that a page was viewed. The GA4 Event tag records what happened on it.

Utility of the GA4 event tag

Interactions. A video in your own player, a price-list download, a specific call-to-action. Enhanced measurement covers some generically; an event tag records yours, with your names and parameters.

Key events. The sign-up, the lead form, the purchase: send each as an event and mark it in GA4 as a key event (GA4’s current name for a conversion).

Your own events. Custom names work, but check Google’s recommended events first: sign_up or generate_lead get report support a custom name does not.

Limits worth knowing before you name things. From Google’s event collection limits, checked in November 2026:

What Limit
Event name length 40 characters. A key event whose name exceeds 40 characters is not reported as a key event
Event parameters per event 25
Parameter name length 40 characters
Parameter value length 100 characters (page_title 300, page_referrer 420, page_location 1,000)
User properties 25 per property; names up to 24 characters, values up to 36
Custom item-level parameters in an e-commerce event up to 27, in addition to the prescribed ones

What goes over a limit is dropped, with no error in Tag Manager.

Setting up the GA4 event tag using GTM

Setting up the GA4 event tag using GTM

Google’s Set up Google Analytics events in Tag Manager page walks through a newsletter sign-up button. The steps, in short:

  1. Open your container and go to Tags → New.
  2. Name the tag, for example GA4 Event – Signup newsletter.
  3. Choose the tag type: Google Analytics: GA4 Event.
  4. Measurement ID: your GA4 measurement ID.
  5. Event Name: for example signup_newsletter. A new name creates a custom event; a recommended name creates a recommended event.
  6. Event parameters (optional): for a video, video_title; for a form, the form’s name. Or select an event settings variable.
  7. Trigger: click Triggering, then +. Google’s example uses All Elements → Some Clicks with the condition “Click Text contains Sign up for the newsletter”. For an event on a confirmation page, a Page View trigger on that page’s URL does the same job.
  8. Test: in preview, perform the action and check the tag moves to Tags Fired. In GA4, the Realtime report and DebugView show the event and its parameters within a minute or two.
  9. Publish: Submit → Publish and Create Version.

A trigger on visible button text breaks when someone rewrites the button; a stable ID or a data layer event does not.

Set up guide for common events for an e-commerce site

Set up guide for common events for an e-commerce site

E-commerce in GA4 is a set of recommended events, from view_item_list to purchase, each with an items array that describes the products. There is no Enhanced Ecommerce switch as there was in Universal Analytics. The site pushes the events to the data layer in Google’s format; Tag Manager forwards them.

The short route: one tag for all e-commerce events. If your data layer already pushes GA4 e-commerce events, one GA4 Event tag can send them all:

  1. Event Name: the built-in variable {{Event}}, so the tag sends whatever event name the data layer pushed.
  2. More Settings → Ecommerce: tick Send Ecommerce data and set Data source to Data Layer. The tag then reads ecommerce.items, value, currency and the rest without a variable for each.
  3. Trigger: a Custom Event trigger with the event names, for example matching view_item|add_to_cart|begin_checkout|purchase with Use regex matching ticked.

Our guide to e-commerce tracking in Google Analytics 4 covers the data layer side, including the line that clears the previous object before each push, dataLayer.push({ ecommerce: null }). Without it, items from one event can leak into the next.

The long route: variables per parameter. If you need different handling per event, create one tag per event and map each parameter to a data layer variable. The table below lists what each event carries, as Google’s e-commerce developer guide defines it. The items array can hold up to 200 elements.

GA4 Action Description Event Parameter DataLayer Variable GA4 Event
view_item_list View of item impressions in a list items ecommerce.items
item_list_id ecommerce.item_list_id
item_list_name ecommerce.item_list_name
select_item Click on an item in a list items ecommerce.items
item_list_id ecommerce.item_list_id
item_list_name ecommerce.item_list_name
view_item View item details items ecommerce.items
value ecommerce.value
currency ecommerce.currency
add_to_cart Add item(s) to cart items ecommerce.items
value ecommerce.value
currency ecommerce.currency
add_to_wishlist Add item(s) to a wishlist items ecommerce.items
value ecommerce.value
currency ecommerce.currency
view_cart View the contents of the shopping cart items ecommerce.items
value ecommerce.value
currency ecommerce.currency
remove_from_cart Remove item(s) from the cart items ecommerce.items
value ecommerce.value
currency ecommerce.currency
begin_checkout Initiate the checkout process items ecommerce.items
value ecommerce.value
currency ecommerce.currency
coupon ecommerce.coupon
add_shipping_info Add shipping info during the checkout flow items ecommerce.items
value ecommerce.value
currency ecommerce.currency
coupon ecommerce.coupon
shipping_tier ecommerce.shipping_tier
add_payment_info Add payment info during the checkout flow items ecommerce.items
value ecommerce.value
currency ecommerce.currency
coupon ecommerce.coupon
payment_type ecommerce.payment_type
purchase Purchase items that were checked out items ecommerce.items
transaction_id ecommerce.transaction_id
value ecommerce.value
tax ecommerce.tax
shipping ecommerce.shipping
currency ecommerce.currency
coupon ecommerce.coupon
refund Refund one or more items items ecommerce.items
transaction_id ecommerce.transaction_id
value ecommerce.value
tax ecommerce.tax
shipping ecommerce.shipping
currency ecommerce.currency
coupon ecommerce.coupon
view_promotion View of promotions creative_name ecommerce.creative_name
creative_slot ecommerce.creative_slot
promotion_id ecommerce.promotion_id
promotion_name ecommerce.promotion_name
items ecommerce.items
select_promotion Click on a promotion creative_name ecommerce.creative_name
creative_slot ecommerce.creative_slot
promotion_id ecommerce.promotion_id
promotion_name ecommerce.promotion_name
items ecommerce.items

Example: How to set up a tag for an e-commerce event

Example: How to set up a tag for an e-commerce event

This section shows the per-event route for one event, add_to_cart. The other events follow the same pattern with their own parameters from the table.

Add_to_cart

When a visitor adds a product to the cart, the site pushes an add_to_cart event to the data layer. It is a strong signal of purchase intent and the first step of most shopping funnels.

  • Trigger: a Custom Event trigger with the event name add_to_cart, firing on all custom events with that name.

Trigger setup for a custom event named “add_to_cart” that fires for all events.

  • Variables: one Data Layer Variable per parameter, with Data Layer Version 2. For the items, the variable name is ecommerce.items; use the same settings for ecommerce.value and ecommerce.currency.

Data Layer Variable in Google Tag Manager reading ecommerce.items from the data layer, with Data Layer Version 2.

  • Tag: a Google Analytics: GA4 Event tag with your measurement ID, the event name add_to_cart (or the {{Event}} variable), and event parameters items, value and currency mapped to the three variables.

Remove_from_cart

The remove_from_cart event shows when visitors change their mind and take a product out of the cart. Read next to add_to_cart, it points at products people hesitate over.

View_item_list

view_item_list fires when visitors see a list of products, usually a category page or search results.

Select_item

select_item fires when a visitor clicks a product in a list.

View_item

view_item records a visit to a product detail page. It is the top of most product funnels.

Add_to_wishlist

add_to_wishlist records a product saved for later.

View_cart

view_cart fires when visitors open the cart.

Begin_checkout

begin_checkout marks the start of the checkout.

Add_shipping_info

add_shipping_info fires when the customer enters or confirms shipping details, with shipping_tier for the option chosen.

Add_payment_info

add_payment_info fires when the customer submits payment details, with payment_type. It is the last step before the purchase.

Purchase

purchase records a completed transaction, with transaction_id, value, tax, shipping and currency. It is the event every revenue report rests on, and the one to test most carefully. GA4 removes duplicate purchases with the same transaction ID only on web streams and only under certain conditions; our guide on duplicate transactions in GA4 has the details.

Refund

refund records money returned to the customer. Without the items array it refunds the whole transaction; with it, only the listed items. Refunds usually happen outside the website, so this event is often sent from the server through the Measurement Protocol rather than from a tag.

View_promotion

view_promotion fires when visitors see an internal promotion, such as a homepage banner.

Select_promotion

select_promotion fires when a visitor clicks that promotion.

Check what your tags actually sent

Check what your tags actually sent

Preview mode tells you a tag fired. It does not tell you the event arrived complete on every page and for every visitor. With GA4’s free BigQuery export turned on, you can count it.

As an example, we ran the query below on Google’s public GA4 sample, the obfuscated export of the Google Merchandise Store (bigquery-public-data.ga4_obfuscated_sample_ecommerce), for November 2020 to January 2021. It counts, per e-commerce event, how many events arrived with an empty items array, and how many purchases arrived without a transaction ID. Run on 10 November 2026:

SELECT
  event_name,
  COUNT(*) AS events,
  COUNTIF(ARRAY_LENGTH(items) = 0) AS events_without_items,
  ROUND(100 * COUNTIF(ARRAY_LENGTH(items) = 0) / COUNT(*), 1)
    AS pct_without_items,
  COUNTIF(event_name = 'purchase'
          AND (ecommerce.transaction_id IS NULL
               OR ecommerce.transaction_id = '(not set)'))
    AS purchases_without_id
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20201101' AND '20210131'
  AND event_name IN ('view_item', 'add_to_cart', 'begin_checkout',
                     'add_shipping_info', 'add_payment_info', 'purchase')
GROUP BY event_name
ORDER BY events DESC
event_name events events_without_items pct_without_items purchases_without_id
view_item 386,068 144,192 37.3 0
add_to_cart 58,543 0 0.0 0
begin_checkout 38,757 6,766 17.5 0
add_shipping_info 19,722 19,722 100.0 0
add_payment_info 13,899 13,899 100.0 0
purchase 5,692 2 0.0 906

Read as a tag audit, this store’s setup has four gaps. add_shipping_info and add_payment_info never send their items, so no product report can show which products drop out at those steps. A third of view_item events and a sixth of begin_checkout events arrive without items. And 906 of 5,692 purchases, 16%, have no transaction ID, so GA4 cannot deduplicate them and no order system can be matched to them. The data is Google’s obfuscated sample, and the obfuscation itself may account for some of the missing IDs, so treat the pattern as an example of what to look for, not as a benchmark. A missing transaction ID does not lower GA4 revenue; it makes orders impossible to match. If GA4 revenue is below your order system’s, look first for purchases that never arrive: payment methods that skip the confirmation page, visitors who decline consent.

Run the same query on your own export after any change to the e-commerce tags: a gap is cheaper to find in the first week than in the quarterly revenue reconciliation.

Once the events are right in the export, OWOX Data Marts lets an analyst define the funnel or revenue SQL once on top of the export, as a Data Mart, and publish it to Google Sheets, Excel or Data Studio. It does not set up or change tags, and it does not send data into GA4: the tags in this guide are what fill the export.

Hand this to your AI

Your GA4 tags are published in Tag Manager, but you're not sure the e-commerce events send the fields they should.

Paste this into your AI assistant. It checks your GA4 data for each e-commerce event your tags send and lists the ones arriving without items, value or currency.

The prompt

check what my GA4 tags actually sent: for each e-commerce event, how often it fired and how many hits lack items, value or currency

FAQ

Frequently Asked Questions

Can you use GTM for GA4?

Yes. Install the Google Tag Manager container on your site, then add the Google Analytics destination tag (or a Google tag) with your GA4 measurement ID, fired on the Initialization – All Pages trigger. For actions such as sign-ups or purchases, add GA4 Event tags, each with the same measurement ID and its own trigger. Test in preview mode before you publish the container. Since September 2023 the Google tag has replaced the old GA4 Configuration tag.

How to use GA4 for SEO?

GA4 shows what search visitors do once they land; Search Console shows the queries that brought them. For SEO, link the two properties and use the Search Console reports in GA4 for queries and landing pages. Filter the Traffic acquisition report to the Organic Search channel to see sessions, engagement and key events from search. Mark the actions that matter, such as a sign-up or a purchase, as key events, so you can see which landing pages from search lead to them.

How do I get my GTM code in GA4?

The GTM code does not come from GA4. It comes from your Tag Manager container: open tagmanager.google.com, select the container for your website (one per site, not per GA4 property), and click its ID, which starts with GTM-, or go to Admin, Install Google Tag Manager. Paste the snippet as high in the head section of every page as possible, or use the platform option for your CMS. GA4 is then added inside the container as a tag, with the measurement ID (G-...) from your GA4 web data stream.

Who wrote this

Alyona Samovar

Alyona Samovar Senior Digital Analyst

Alyona Samovar is a Senior Digital Analyst who spent years at OWOX helping enterprise clients design analytics systems, build BigQuery reporting pipelines, and optimize marketing measurement. She specializes in SQL-based analytics, data modeling, and turning raw marketing data into actionable insights. Alyona writes about practical analytics workflows, BigQuery best practices, and data-driven decision-making.