As we mentioned in the previous step, important eCommerce events are not yet flowing through to GA4. This article walks you through the steps to set this up.
What are eCommerce Events?
These are specific actions taken by users on a website and/or booking engine. Common eCommece events in GA4 include:
-
View Item: This event occurs when a user views a specific product or item on your website or app.
-
Add to Cart: This event is triggered when a user adds a product to their shopping cart.
-
Remove from Cart: This event is recorded when a user removes a product from their shopping cart.
-
Begin Checkout: This event is logged when a user initiates the checkout process.
-
Purchase: This event is generated when a successful purchase is made by a user.
-
Product Impression: This event is logged when a user sees a product on a list or grid.
-
Product Click: This event occurs when a user clicks on a product from a list or grid.
These events provide valuable data for analyzing conversion rates, product performance, and the effectiveness of marketing campaigns.
Configuring eCommerce Events in Google Tag Manager
From within your GTM account, click to Add a new tag. We recommend giving the tag a descriptive name such as GA4 eCommerce Events.
Click on Choose a tag to begin setup. This time select Google Analytics: GA4 Event
Select the Google Analytics Configuration tag you set up earlier
Then in the event name we will use a predefined variable that GTM supplies for us. If you start typing two open curly braces as such, {{ you will see a list of what GTM calls variables. We want the first one {{Event}}. This allows us to pass whatever event has occurred from GTM into GA4. It is basically a shortcut that means we don’t have to create individual events for each event we want to pass. It’s also necessary to enable Send Ecommerce data under More Settings
Next we need to tell GTM when to send this data, which means we need a trigger. To add this click underneath the Triggering tab where it says Choose a trigger to make this tag fire. Click on the Plus Symbol to add a new trigger.
Click on Choose a trigger type to begin setup
Scroll down and click choose Custom Event from the list.
In the Event Name paste in the following add_to_cart|view_item|view_item_list|begin_checkout|purchase|view_cart
And ensure that Use Regex Matching is selected.
Update the name to something like All GA4 eCommerce Events. Then click Save.
Once back in the Tag Configuration window update the name of this to be GA4 eCommerce Events as well and click save.
You should see a message in the top right corner saying that the workspace has changed.
Before we publish and save these changes we recommend adding another tag to track zaui_page_views. These are the pages within the Zaui booking engine that users pass through on their path to purchase.
Click to create a new tag. We’ll use the same {{Event}} variable for the event name as before as well as the same Configuration Tag.
Next click on Event Parameters and then Add Row. Next enter pageUrl in the Parameter name text box, then again start typing two curly braces {{. Scroll down to select New variable…
Then click Choose a variable type to begin setup…
Select Data Layer Variable from the list.
Enter a name for the variable, such as pageUrl, and then set the Data Layer Variable Name. this must be pageUrl otherwise it will not work. Click on Save.
We now need to add the trigger for this event as well. Click on Choose a trigger to make this tag fire… Follow the steps as before to setup a Custom Event trigger but this time the event name must be zaui_page_view. Name the Trigger Zaui Page Views and click Save.
Name the tag Zaui Page Views and then save. It should look like this.
On the following screen, enter a Version Name and a Version Description. This will allow you to remember what changed in each version. The more descriptive you are here the easier it will be to figure out what went wrong and when it went wrong if something happens to your GTM. Once this is all done click on Publish.
Once that’s saved, we will need to click Submit and then Publish.
Now if we click on Preview then load up tag assistant and click around as before, we should see those events beginning to trickle into the real time events in GA4. From here, you can follow the same steps as above to build out whatever reports you need!
Step 4: Additional Events You Can Track (Optional)
Comments
0 comments
Please sign in to leave a comment.