Welcome back! In our last lesson, we successfully installed Google Tag Manager on your website, creating a powerful, centralized container for all our future tracking needs. Right now, that container is installed and ready, but it's not yet tracking anything.
Today, we connect the dots. This lesson directly addresses the learning outcome: Create GA4 event tags in GTM to track key user interactions (e.g., 'view_room', 'begin_checkout'). We will start by sending basic page-view data to Google Analytics and then move on to tracking the specific, valuable actions a potential guest takes on your hotel's website. By the end of this lesson, you will see real-time data from your website flowing into your GA4 reports, marking a major milestone in building your analytics capabilities.
1. The Foundation: The GA4 Configuration Tag
Before we can track specific actions like clicks or bookings, we need to tell GTM how to communicate with your GA4 property on every page. This is done with the GA4 Configuration Tag. Think of it as the main power switch for your analytics; it loads the necessary GA4 script and automatically tracks basic interactions like page views. Every other GA4 event tag we create will rely on this one.
Let's set it up. It involves two small but important steps:
- Creating a Constant Variable for your Measurement ID: To avoid re-typing your GA4 Measurement ID (the G-XXXXXXXXXX from our first lesson) for every tag, we'll store it in a reusable variable. This is a crucial best practice that saves time and prevents errors.
- Creating the Configuration Tag: We'll create the tag itself and tell it to fire on every page of your website.
The video below from Analytics Mania clearly demonstrates creating a constant variable and setting up an event tag. We'll adapt the concept for our configuration tag.
How to track events in Google Analytics 4 || GA4 event tracking
This video shows the process of creating a reusable variable for your Measurement ID, a key step for an efficient GTM setup. We will use this technique for our Configuration Tag.
Watch from 11:27 to 12:20. Focus on how a 'Constant' variable is created to hold the Measurement ID. You don't need to create the event tag shown in the rest of the video yet; just follow the steps to create and save your Measurement ID variable.
Now that you have your Measurement ID stored in a variable, follow these steps in GTM:
- Go to Tags > New.
- Name your tag
GA4 - Configuration. - Click Tag Configuration and choose Google Tag.
- In the Tag ID field, click the brick icon and select the Measurement ID variable you just created.
- Click Triggering and select the Initialization - All Pages trigger. This ensures the tag fires as early as possible on every page.
- Click Save.
You've now established the fundamental link between your website and GA4!
2. Understanding and Mapping Hotel Interactions as Events
GA4 is built around the concept of events. An event is any interaction you want to measure, from a page view to a completed booking. While you can create any event name you want, Google provides a list of recommended events, especially for e-commerce.
Using these standard names (view_item, add_to_cart, purchase, etc.) is highly beneficial. It allows GA4 to understand your data and automatically populate its built-in monetization reports, saving you significant reporting and analysis work later.
For your hotel, we can map these standard e-commerce events to the guest's booking journey:
| Standard GA4 Event | Corresponding Hotel Action |
|---|---|
view_item_list |
User views a page of search results for available rooms. |
view_item |
User clicks on and views the details of a specific room. |
add_to_cart |
User selects a room, dates, and clicks "Book Now". |
begin_checkout |
User lands on the first page of the booking form (guest details). |
add_payment_info |
User reaches the payment step of the booking form. |
purchase |
User successfully completes a booking and sees the confirmation page. |
This mapping is the strategic foundation for tracking your booking funnel effectively.
Advanced GA4 Ecommerce Tracking for Hotel Bookings
This article provides excellent examples of how standard GA4 e-commerce events are applied in a hotel booking context. It also shows the kind of data (like room name and price) that should be included with each event.
Read the first part of the article, focusing on the sections '1. View Item List' through '6. Purchase (Booking Confirmation)'. Notice how each standard event name is tied to a specific step in the hotel booking process.
3. Creating a Unified Ecommerce Event Tag
In the past, you might have created a separate tag for each of the events listed above. The modern, efficient method is to create one single tag that can handle all of them. This is possible through the use of a special trigger and a dynamic event name.
This works because your website's booking engine (or a plugin) should be pushing information to a Data Layer—a structured JavaScript object that GTM can read. When a guest views a room, the Data Layer should announce an event named view_item along with all the room details. Our GTM tag will simply listen for these announcements and forward them to GA4.
Let's build this powerful, all-in-one tag.
Step 1: Create the Ecommerce Trigger
First, we'll create a single trigger that fires for any of our desired e-commerce events.
Google Analytics 4 eCommerce Tracking with GTM & Data Layer
This article provides a perfect, step-by-step guide to creating an efficient trigger using Regular Expressions (regex). This is the key to making our single-tag setup work.
Read 'Step 1: Create the Master Trigger Using Regex'. Follow the instructions to create a new Custom Event trigger. Use the regex pattern provided, which includes all standard GA4 ecommerce events.
Step 2: Create the GA4 Event Tag
Now, we'll create the tag that this trigger will fire. This tag will dynamically pass the event name and all associated e-commerce data (like room name, price, and currency) to GA4.

The video and article below walk you through this process. The key is to use the built-in {{Event}} variable and enable the "Send Ecommerce data" setting.
Google Tag Manager Ecommerce Tracking: GA4 Event Tag & Google Ads Conversion Setup
This video from Loves Data provides a concise visual demonstration of creating the GA4 Ecommerce event tag and, critically, highlights the 'Send Ecommerce Data' checkbox.
Watch from 04:03 to 05:53. Pay close attention to two key settings: setting the 'Event Name' to the {{Event}} variable and enabling 'Send Ecommerce Data' under 'More Settings'.
For a detailed textual guide to reinforce these steps, refer back to the LINK article.
Google Analytics 4 eCommerce Tracking with GTM & Data Layer
This section of the article explains the 'why' behind the steps shown in the video, detailing how the {{Event}} variable works and what the 'Send Ecommerce data' checkbox does behind the scenes.
Read 'Step 2: Create the GA4 Event Tag'. Make sure you understand why you don't manually add parameters like 'currency' or 'value' when using this method for standard ecommerce tracking.
Test your understanding!
You've set up your single ecommerce event tag. In GTM's Preview Mode, you see that the add_to_cart event fires correctly, but when you check the tag details, there is no room price or currency being sent to GA4. What is the most likely cause of this issue?
Show answer
The most likely cause is a problem with the Data Layer on your website. The "Send Ecommerce data" checkbox tells GTM to look for a specifically formatted ecommerce object in the Data Layer. If that object is missing, named something else (e.g., ecom_data), or doesn't contain the value and currency parameters, GTM has no data to send. The tag is firing correctly, but the necessary data isn't being provided to it from the website.
A Note on Custom Hotel Parameters
Standard ecommerce tracking is a great start. However, for deeper analysis of your hotel business, you'll want to track custom data points like check_in_date, number_of_guests, or length_of_stay.
These are passed as custom parameters within the event. While the "Send Ecommerce Data" feature handles the standard fields, these custom ones must be manually captured from the Data Layer using Data Layer Variables in GTM and added to your tag.

We won't implement this today, but it's important to know that you can enrich your tracking with this highly relevant business data. The article on hotel tracking from LINK provides more context on which custom parameters are most valuable.
4. Verification: See Your Events in Real-Time
You've built the tags, but the job isn't done until you've verified they work. This is a two-step process using GTM's Preview Mode and GA4's DebugView.
- GTM Preview Mode: Confirms that your trigger conditions are met and your tag is firing.
- GA4 DebugView: Confirms that GA4 is receiving the event and its parameters correctly.
Google Analytics 4 eCommerce Tracking with GTM & Data Layer
This guide provides a clear, written walkthrough of the entire verification process, from navigating your site in Preview Mode to inspecting the data in both Tag Assistant and GA4's DebugView.
Read the section 'Verification: Confirming Everything Works'. Follow the steps: open Preview Mode, perform an action on your site (like viewing a room), check for the event in the Tag Assistant, and then look for it in GA4's DebugView.
Once you see events like view_item and begin_checkout appearing in DebugView with associated room details, you have successfully configured event tracking! You can now Submit and Publish your GTM container to make these changes live for all your website visitors.
Conclusion
This was a major step forward. You've gone from an empty GTM container to a sophisticated event tracking system that can measure the entire guest booking journey.
Key Takeaways:
- The GA4 Configuration Tag is the foundational tag that must be present on all pages.
- Mapping your hotel's user journey to GA4's recommended event names (e.g.,
view_item,purchase) is crucial for unlocking powerful, automated e-commerce reports. - The modern, efficient method for e-commerce tracking uses a single GA4 Event Tag combined with a regex-based Custom Event Trigger.
- The
{{Event}}variable and the "Send Ecommerce data" checkbox are the two key settings that make this single-tag approach work. - Always verify your setup with GTM Preview Mode and GA4's DebugView before publishing.
What's Next?
Now that you have a robust analytics setup for GA4, our next lesson, Set up the Meta Pixel using Google Tag Manager, will demonstrate the true power of GTM. We will add a completely different tracking tool to your site to support your paid advertising efforts—and we'll do it entirely within the GTM interface, without ever needing to touch your website's code again.