GA4 eCommerce Tracking allows you to track all the steps users take on your site as they go through their purchase process. This post is a complete guide for GA4 eCommerce Tracking, Reporting, and Analysis.
As you might already know GA4 has an event-based model, which means every user action or interaction on your site or app is tracked as an event in GA4 (Google Analytics 4). GA4 provides you with a set of recommended events that you can use to track the various steps of the eCommerce journey starting from viewing an item to finally purchasing it.
GA4 eCommerce Recommended Events
GA4 provides the following events that you can use to track various steps. The names of these events are easy to understand and indicate the step that you can track. These events are:
Event | Track This Event when |
---|---|
add_payment_info | a user submits their payment information |
add_shipping_info | a user submits their shipping information |
add_to_cart | a user adds items to the cart |
add_to_wishlist | a user adds items to a wishlist |
begin_checkout | a user begins the checkout |
generate_lead | a user submits a form or a request for information |
purchase | a user completes a purchase |
refund | a user receives a refund |
remove_from_cart | a user removes items from a cart |
select_item | a user selects an item from a list |
select_promotion | a user selects a promotion |
view_cart | a user views their shopping cart |
view_item | a user views an item |
view_item_list | a user sees a list of items/offerings |
view_promotion | a user sees a promotion on your site or app |
Keep in mind that the event name you pass to GA4 has to match the names as are listed above.
Along with these events you need to pass certain parameters that track the item or items and their value along with some other information.
Items Array for GA4 eCommerce Tracking
One of the common parameters for most of these events is an array containing the item or items that the user is interacting with when a particular event is being tracked. For example when a user views an item or product then you will track view_item event and pass the information about the item or product in an array called "items".
Items array contains the following parameter (source: https://developers.google.com/analytics/devguides/collection/ga4/reference/events#view_item_list_item)
Now that you understand the items array let's look at the event parameters for other events
GA4 eCommerce Event Parameters
Events: view_item, add_cart, view_cart take the following parameters
Event: begin_checkout
In addition to the above 3 event parameters, begin_checkout also takes coupon as an additional parameter to track coupon codes.
Event: add_shipping_info
Parameters:
Event: add_payment_info
Parameters:
Event: purchase
Parameters
Event: view_item_list
Parameters
GA4 eCommerce Implementation
You can implement all these events via putting the page code directly on your site (gtag) or app or via Google Tag Manager (GTM). I highly recommend using GTM because it will not only make it easier implementation but will also remove your dependency on the developers. Let's take a look at an example of the both these.
GA4 eCommerce Implementation with gtag
Below is an example of the tracking purchase event in GA4. This gtag call (a JavaScript code) needs to be called or triggered when the user completes the purchase.
The syntax for all other events is the same, the only two things that change are the name of the event and the parameter for that event.
GA4 eCommerce Tracking with GTM (Google Tag Manager)
In GTM you will need to configure the GA4 event for each step that you want to track. Below is an example of the purchase event.
The values for each of the parameters can come from various variables on your site. The preferred method is to have all the values in a dataLayer. However, if the values are not in the data layer then you can use JavaScript variables or pull the values from the web page using CSS or JavaScript. Each site is different so how you pull the values will depend on the structure of your site. If you do need any help then reach out to us at support@optizent.com or fill out the form to contact us.
GA4 eCommerce Reports
Within 24 hours of tracking GA4 events, you will see the data in eCommerce reports in GA4
GA4 eCommerce Analysis
eCommerce Event parameters are available as various dimensions and metrics in GA4 Explore section.
You can create your own custom explorations and slice and dice the data you want. One of the common explorations for eCommerce is Funnel Exploration.
Need Google Analytics 4 help and support
We are here to help you with all your Google Analytics needs. Our team can get you up and running in no time and also train you and your team to save you a lot of time so that you can focus on driving the business outcomes rather than configuring Google Analytics 4.
Online Course - If you want to learn on your own then check out Google Analytics 4 Masterclass
Workshop - We conduct the onsite customized workshop. Reach out to us for more details.
Consulting - Reach out to us for more details.