Learn / Guides / GA glossary (A-Z)
Transactions in Google Analytics 4 (GA4)
Wondering which products are your best sellers? Or perhaps you're eager to understand the source of your revenue? Tracking Google Analytics transactions does more than just quantify numbers—it unlocks a treasure trove of insights into your sales funnel.
This guide gives you a solid understanding of Google Analytics (GA4) transactions and shows you how to use this data to increase your sales and propel your ecommerce store to new heights.
What are transactions and how does GA4 track them? In GA4, transactions are unique sales and are logged as 'purchase events'; however, unlike other events in GA4, they require manual setup
How GA4’s ecommerce metrics enhance transaction tracking: GA4's ecommerce metrics enhance your transaction tracking by giving you deeper insights into customer interactions and behaviors
How to set up transaction tracking in GA4 in five simple steps: follow a comprehensive process to correctly configure purchase event tracking for accurate sales insights
Four ways to increase your ecommerce transactions: discover strategies to amplify your transactions, from heatmaps and A/B testing to leveraging direct customer feedback
What are transactions and how does GA4 track them?
In GA4, a transaction is an ecommerce metric that measures the number of unique sales on your website.
Each activity on your site is categorized as an 'event’ in GA4. A sale or transaction is specifically captured as a 'purchase event'. However, unlike activities such as page views, GA4 doesn't automatically track transactions. This requires manual setup on your end.
Setting up transaction events correctly in GA4 is essential. By ensuring every sale is accurately logged, you gain critical insights that empower you to optimize and refine your ecommerce strategy for better results.
💡 Hit-based vs. events-based tracking
Older versions of Google Analytics used hits-based tracking, where specific interactions on a website (including transactions) triggered the tracking code to send a ‘hit’ to Google’s servers.
GA4 uses an events-based tracking approach. Now, when someone completes a purchase on your site, instead of sending a generic ‘hit’, GA4 sends a 'purchase event’, including more detailed information like the product's name and price.
This extra layer of data allows you to better understand your customers' behavior and make more informed decisions about your products, pricing, and marketing campaigns.
How GA4’s ecommerce metrics enhance transaction tracking
GA4 offers two main categories of ecommerce metrics: event-scoped metrics and item-scoped metrics. These metrics provide valuable insights into your customers' behaviors and interactions leading up to a transaction, helping you better understand the buyer’s journey.
❗To differentiate: event-scoped metrics count ecommerce actions, like adding an item to a cart. Item-scoped metrics reveal which specific items users are interacting with, so you can understand individual product performance. For example, while event-scoped metrics might tell you three items were added to a cart, item-scoped metrics would specify that it was a red dress, blue shirt, and black boots.
These metrics capture the number of times a specific ecommerce event was triggered.
Add to carts: represents how many times users have triggered the ‘add_to_cart’ event. If a user adds two different items to their cart, this counts as two add-to-cart events.
Checkouts: captures the number of times users initiate the checkout process
Item-list click events: counts how often users trigger the ‘select_item' event, i.e. clicking on an item in a list
Item-list view events: denotes the number of times users trigger the 'view_item_list' event, implying they viewed a list of items
Item view events: shows how many times users trigger the 'view_item' event, meaning they viewed a specific item
Promotion clicks: quantifies the number of times users triggered the 'select_promotion' event, indicating they clicked on a promotion
Promotion views: measures how often the 'view_promotion' event is triggered, suggesting users viewed a promotion
Purchases: represents how many times the 'purchase' event is triggered
Quantity: gives the total count of items across all events
Refunds: reflects the number of times the 'refund' event is triggered
These metrics shed light on user interactions with specific items during ecommerce events.
Items added to cart: details the unique items users add to carts
Items checked out: specifies the unique items users purchase
Items clicked in list: denotes the total number of individual items users click on within lists
Items viewed in list: specifies the count of individual items users view within a list
Items viewed: indicates the number of times users view a specific item
Items clicked in promotion: shows the count of individual items users click on within promotions
Items viewed in promotion: illustrates how many specific items within promotions users viewed
Items purchased: details the total number of individual items users bought
Item quantity: reflects the quantity of a specific item within an event
Item refund: gives the number of individual items users refund
Elevate your ecommerce strategy with Hotjar
Take control of your success by pairing GA4’s robust data with Hotjar’s in-depth customer insights.
5 simple steps to set up transaction tracking in GA4
Setting up transaction tracking in GA4 allows you to closely monitor your sales activity and provides invaluable insights into your customers’ purchasing patterns. Follow these five straightforward steps to ensure you’re accurately logging every sale.
1. Go to the 'Events' section
Sign in to your Google Analytics account. Select ‘Admin’ in the bottom left corner, then click ‘Events’ in the ‘Property’ column.
In the next screen, click ‘Create event’.
Note: GA4 automatically creates existing events, such as 'page_view' and 'first_visit' that appear in this section.
2. Create a purchase event
Click on the field ‘Custom event name’ and select the predefined event called ‘purchase’.
To enrich your data, add the parameters that will capture the necessary details about your transactions. Typical parameters you might include are
Product_id: the unique identifier for the purchased product
Product_name: the name of the purchased product
Category: the segment or category to which the product belongs
Price: the amount of the purchased product
Quantity: the number of products bought in the transaction
Currency: the type of currency used for the transaction, like USD or EUR
Value: the total transaction value, representing the combined cost of all items
Items: an array or list detailing the individual products in the transaction, often including product_id, product_name, category, price, and quantity for each item
Note: the parameters ‘currency’, ‘value’, and ‘items’ are all required for setting up a purchase event.
3. Configure the tracking for purchase events
If you're already tracking general metrics like traffic on GA4, it means the Global Site Tag (gtag.js) is already implemented on your website. However, to specifically track purchase events and their associated parameters, you need to ensure the existing tracking code is correctly configured for ecommerce activity.
If you’re using an ecommerce platform like WordPress, Wix, or Shopify, there are various plugins or integrations to take care of this process, allowing you to easily add or modify event parameters without diving deep into the code.
However, you might need to make adjustments to the gtag.js or add event tracking scripts to capture your specific ecommerce data. If you're not well-versed in these configurations, you might prefer to work with a web developer to ensure GA4 is properly set up and captures all the relevant purchase event data you've specified.
4. Flag the transaction event as a conversion
Back in the 'Events' section, find the ‘purchase’ event you set up in step two. Click on the event name and toggle the 'Mark as conversion' switch to the 'On' position.
This step makes it possible to analyze and report on your conversion paths, sources, and overall ROI.
5. Validate that your transactions are being tracked correctly
To ensure your tracking is working as it should, do a test purchase on your website. Go to ‘Reports’ and then ‘Conversions’ to see if the transaction appears. Bear in mind that it may take several hours for conversions to show up in GA4, so don’t panic if you don’t see it right away.
If you want immediate feedback during your test purchase, GA4 offers a real-time debugging tool called DebugView. This tool allows you to see events sent to GA4 in real time, helping you pinpoint any issues immediately. To use it, activate the ‘debug_mode’ parameter in your GA4 configuration.
Then, go to the 'Admin' section of your GA4 property and select 'DebugView' under the 'Monitor' section to easily identify any errors or discrepancies in your event setup from your test transaction.
💡 Troubleshooting missing transactions
If your transaction isn’t showing up after a day or two, follow these steps to pinpoint and address the error.
Verify your tracking code: ensure the Global Site Tag (gtag.js) is placed directly before the closing </head> tag on every page, especially checkout pages. Tools like Google's Tag Assistant can help you verify this.
Check your event configuration: confirm that the 'purchase' event and its parameters (like product_id, price) are set up correctly
Turn off ad blockers: some ad blockers or strict browser settings can prevent tracking. Disable ad blockers or try a different browser.
Review your ecommerce integration: if you're using a platform like Shopify or WooCommerce, ensure that the GA4 integration is active and configured properly
Check your filters: in GA4's admin settings, ensure there are no filters that exclude pages or IP addresses linked to your test transaction
4 ways to increase your ecommerce transactions
Now that you know how to track transactions in GA4, you can report on your sales and access important metrics about your customers’ purchasing behaviors, preferences, and patterns. But how can you generate more transactions?
While GA4 provides a wealth of quantitative data, enriching those insights with qualitative data offers a holistic view of your customer experience. By understanding not just the 'what' but also the 'why', you can implement effective conversion rate optimization (CRO) strategies and improve your sales.
1. Identify popular products or categories with heatmaps
Knowing which parts of your store your customers are most drawn to helps you make informed decisions about your website design and marketing campaigns.
Heatmaps show you where website users click, scroll, engage, and move across a page. They’re a simple, visual way to understand which parts of your site attract the most attention and which parts customers overlook or aren’t interested in.
If a certain category generates significant attention on your heatmap, you might consider making it more prominent on your homepage or creating special promotions around it. Similarly, if high-performing products are nestled deep within your site, use this data to rearrange your layout and make these products more accessible to potential buyers.
2. Recognize and address potential barriers in the sales funnel
Every ecommerce store's sales funnel is a series of steps guiding a visitor from the initial discovery of your product to the final transaction (the purchase). Potential blockers—like unclear product descriptions, unintuitive site navigation, or complex checkout processes—can hinder this journey and cause drop-offs.
Tools like Hotjar Funnels help you spot exactly where these drop-offs happen and why. Addressing these pain points ensures you create a more user-friendly shopping experience that drives up your conversion rates.
3. A/B test to improve under-performing pages
By comparing two versions of a web page, you’re able to determine which one encourages more purchases. Use data from GA4 to identify pages with potential for improvement. For example, if you notice a product page with high traffic but low conversions, this could be a prime candidate for testing.
Using an A/B testing tool like Optimizely or Omniconvert, create a variant of the page—perhaps with a clearer call to action, different product images, or revised pricing—and divert a portion of your traffic to this new version. As the test progresses, monitor which version yields higher sales. Once you've gathered enough data, implement the changes that show the best results for maximum sales.
💡 Pro tip: your A/B testing tool tells you which version of your site performs better, but it doesn’t tell you why. Use the Hotjar Recordings tool (free forever) to watch real customer interactions with each version so you can see where they get lost or frustrated and use those insights to create more user-friendly pages.
A Hotjar recording in action
4. Gather direct feedback with surveys
While GA4’s transaction data shines a light on purchasing patterns in your ecommerce store, harnessing your customers’ feedback holds the keys to true optimization. By asking ecommerce survey questions like, "What other information would you like to see on this page?" or "What stopped you from making a purchase today?", you uncover valuable insights you wouldn’t get with transaction tracking alone.
Direct feedback reveals areas of improvement and empowers you to tailor the shopping experience to your audience’s needs. Not sure what to ask? Hotjar's AI-driven Surveys help you tap into the most valuable insights for your online store.
Master transaction tracking and hit your ecommerce goals
Tracking your sales is essential for driving ecommerce success. By monitoring sales, you identify which products are your top performers, recognize seasonal trends, and adjust your marketing strategies accordingly. However, sales figures only provide half of the story.
Integrating Hotjar with GA4 enables you to visualize customer behavior and understand the nuances behind each transaction. Leverage both tools to create a customer-centric shopping experience that’s primed for conversions and growth.
Go beyond tracking transactions with Hotjar
Complement GA4 transaction data with rich, actionable insights—straight from your customers.