How to Set Up Google Analytics 4 Ecommerce

Cody Schneider

Setting up Google Analytics 4 ecommerce tracking shows you exactly how users interact with your products, from their first look to the final purchase. It's the key to understanding which marketing efforts actually drive sales and where you might be losing customers along the way. This guide will walk you through the essential setup steps, whether you use an e-commerce platform integration or Google Tag Manager, so you can start measuring what matters most.

Why Bother with GA4 Ecommerce Tracking?

Connecting your store to GA4 goes way beyond simply counting final sales. When properly configured, it transforms your analytics from a simple traffic report into a powerful business intelligence tool. You unlock a much deeper understanding of both your customers and your products.

Here’s what you can actually do with GA4 ecommerce tracking turned on:

  • Visualize the Full Customer Journey: You can see the complete path a shopper takes. Track how many people view a product list, click on a specific item, add it to their cart, start the checkout process, and finally complete the purchase. This bird's-eye view makes it easy to spot where people are getting stuck.

  • Pinpoint Funnel Drop-offs: Are a lot of people adding items to their cart but never starting the checkout? Maybe your cart page has a usability issue or an unexpected shipping fee is scaring them away. GA4 ecommerce reports make these friction points obvious so you can fix them.

  • Measure True Marketing ROI: You can finally connect your marketing campaigns directly to sales. See which Google Ads campaigns, Facebook posts, or email newsletters are not just driving clicks, but are actually leading to transactions and revenue.

  • Uncover Product Performance Insights: Discover which products are your best performers. You can analyze which items get the most views, the highest add-to-cart rate, or are purchased most often. You might even find products that get a lot of views but few purchases, signaling a potential issue with the product page, pricing, or images.

The Building Blocks: Standard GA4 Ecommerce Events

Unlike its predecessor, Universal Analytics, GA4 is built around "events" - specific interactions users have on your site. For e-commerce, Google has a list of recommended events that cover the entire shopping funnel. Implementing these gives you the rich, detailed reports you need.

Here are the most critical ecommerce events you should track:

  • view_item_list: A user sees a list of products (e.g., on a category page or search results). This helps you understand which product categories are most popular.

  • select_item: A user clicks on a product from a list. This shows initial interest.

  • view_item: A user views a specific product detail page. This is a strong signal of consideration.

  • add_to_cart: A user adds an item to their shopping cart. This is a clear measure of purchase intent.

  • remove_from_cart: A user removes an item from their cart. This can help diagnose issues if certain products are removed more often than others.

  • begin_checkout: A user starts the checkout process. This is the first step in the final conversion funnel.

  • add_shipping_info: The user submits their shipping information.

  • add_payment_info: The user adds their payment details.

  • purchase: The user completes a transaction. This is the ultimate conversion event, tracking revenue, tax, shipping, and transaction IDs.

Tracking these events provides the necessary data for GA4 to automatically populate its monetization and e-commerce reports, giving you a clear window into your store's performance.

How to Set Up GA4 Ecommerce Tracking: Two Core Methods

There are two primary ways to implement GA4 ecommerce tracking. The right one for you depends on your e-commerce platform and your technical comfort level.

Method 1: Using a Platform Integration or Plugin (The Easy Way)

Most modern e-commerce platforms like Shopify and WooCommerce have built-in integrations or well-supported plugins that handle nearly all the heavy lifting. This is the recommended route for most store owners.

For Shopify Stores:

Shopify makes this incredibly simple with its native "Google & YouTube" app. It automatically sets up all the standard ecommerce tracking events in GA4 for you.

  1. From your Shopify Admin, navigate to Apps and search for the "Google & YouTube" app. If you don't have it, install it.

  2. Open the app and click "Connect" next to the Google Analytics section.

  3. Sign in with the Google account that has access to your GA4 property.

  4. Choose your GA4 property from the list and click "Connect".

That's it! Shopify will now automatically send events like view_item, add_to_cart, and purchase to your GA4 property along with all the necessary product data. No code required.

For WooCommerce (WordPress) Stores:

For WooCommerce, the most robust way to set up tracking is with a plugin that creates a "data layer" and integrates with Google Tag Manager (GTM). The "GTM4WP" plugin is the most popular and highly recommended for this.

  1. Install Your Tools: Make sure you have Google Tag Manager set up for your site and have installed the GTM4WP plugin.

  2. Enable Ecommerce Tracking in the Plugin: In your WordPress dashboard, go to Settings &gt, Google Tag Manager. Click on the Integration tab, then select WooCommerce.

  3. Check the Box: Check the box for "Track enhanced e-commerce."

This plugin doesn't send data directly to GA4. Instead, it creates a highly detailed "data layer" on your site. Now, you can use Google Tag Manager to capture that data and send it to GA4, as explained in the next method.

Method 2: Manual Setup with Google Tag Manager (The Flexible Way)

If your platform doesn't have a reliable integration or you need more customization, setting up events manually with Google Tag Manager (GTM) gives you total control. This approach requires that your website has a properly configured data layer.

Step 1: The Prerequisite - Understanding the Data Layer

The "data layer" is the backbone of dynamic tracking in GTM. It's a snippet of JavaScript code on your site that holds critical information like product names, prices, and IDs. When a user adds a product to their cart, your site should "push" an add_to_cart event with all the product details to this data layer.

Here's what a data layer push for a purchase event might look like:

Your web developer or an e-commerce plugin (like GTM4WP for WooCommerce) is responsible for creating this code on your site.

Step 2: Create a GA4 Configuration Tag in GTM

This is the base tag that connects your site to GA4. You only need to set this up once.

  1. In GTM, create a New Tag and choose the tag type "Google Analytics: GA4 Configuration."

  2. In the Measurement ID field, enter your GA4 property's ID (it starts with "G-").

  3. Set the trigger to fire on "Initialization - All Pages." This ensures it loads first on every page view.

  4. Give it a name like "GA4 Config" and save it.

Step 3: Create GTM Variables to Capture Data

Next, you need to teach GTM how to read the information from the data layer. You do this by creating variables.

  1. Go to the Variables section and click "New."

  2. Choose "Data Layer Variable" as the variable type.

  3. In the "Data Layer Variable Name" field, you'll enter the path to the data you want. For example, to capture the ecommerce data block, you’d enter ecommerce. Let's name this variable "DLV - ecommerce".

Step 4: Create a Trigger for Your Ecommerce Event

A trigger tells GTM when to fire a tag. We'll use the purchase event as an example.

  1. Go to Triggers and create a New Trigger.

  2. Choose the trigger type "Custom Event."

  3. For the Event name, type purchase. This must exactly match the event name being pushed to the data layer.

  4. Name it "Custom Event - purchase" and save.

Step 5: Create the GA4 Event Tag

Now, we'll create the tag that bundles all this information and sends it to Google Analytics.

  1. Go to Tags and create a New Tag. Choose the tag type "Google Analytics: GA4 Event."

  2. For Configuration Tag, select the GA4 Config tag you made in Step 2.

  3. For Event Name, type purchase. GA4 automatically recognizes this specific name.

  4. Click on Event Parameters. You'll add parameters for all the purchase data. The most efficient way is to send the entire items array and let Google parse it.

    • Add a parameter with the name items and set its value to {{DLV - ecommerce.items}}. You would first create a Data Layer Variable named "DLV - ecommerce.items" to capture this specific part of the data layer. For other top-level fields:

    • Add a parameter with the name transaction_id and set its value to a Data Layer Variable pulling ecommerce.transaction_id.

    • Add a parameter with the name value and set its value to a Data Layer Variable pulling ecommerce.value.

    • ...and so on for currency, tax, etc.

  5. Set the Trigger to the "Custom Event - purchase" trigger you just created.

  6. Save the tag as "GA4 Event - Purchase". Repeat this process for all other events like add_to_cart and view_item.

Step 6: Test and Publish

Before publishing, use GTM's "Preview" mode to test your setup. Navigate through your website and perform the actions (view a product, add to cart, etc.). You should see your custom event triggers fire in the Preview debug window, and the GA4 event tags should send successfully with all the correct data.

Inspecting Your New Data in GA4

Once your tracking is live, it can take up to 24-48 hours for data to populate fully in GA4's reports. You'll find most of your valuable e-commerce information under the Reports &gt, Monetization tab.

  • Ecommerce purchases: A high-level view of which items are selling, providing data on item views, add-to-carts, purchase revenue, and more.

  • Purchase journey: A funnel visualization showing you how users move from viewing a product all the way to purchase, highlighting where they drop off.

For more advanced analysis, dive into the Explore section to build custom funnel exploration reports, enabling you to see every step in your specific checkout process.

Final Thoughts

Setting up GA4 ecommerce tracking, whether through a simple plugin or the powerful GTM, is a foundational step for any online store. It moves you from guessing about performance to making data-driven decisions that can directly increase your revenue and improve the user experience.

After getting this data flowing into GA4, the next step is combining it with information from your other tools like Shopify, Salesforce, and ad platforms to see the full picture. Logging into multiple analytics platforms just to piece everything together can be a huge time sink. We built Graphed to solve this by connecting all your data sources in one place. You can then ask questions in plain English, like "Show me a dashboard of my marketing funnel from Facebook Ads clicks to Shopify purchases," and get real-time, unified dashboards instantly, saving you hours of manual reporting.