Configuring BeginCheckout Event for GA4 in Shopify with GTM & dataLayer
Vložit
- čas přidán 2. 11. 2023
- 👉 Detailed Blog Post: trackingacademy.com/blog/shop...
Want to set up the Begin Checkout (begin_checkout) Event on your Shopify store using Google Tag Manager? 🛒 In this tutorial, I guide you step-by-step through the process. From accessing theme files to publishing the changes, we cover it all.
For further insights on configuring the purchase event, make sure to watch our other tutorial video. And if you found this video helpful, don't forget to give it a thumbs up! 👍
Chapters:
0:00 🎬 Intro
0:01 📌 Configuring Google Analytics & Google Tag Manager for Shopify
0:14 🛒 Tracking 'Begin Checkout' Event
0:44 🧰 Setting up Configuration Tag
1:10 📊 Finding Measurement ID
2:04 ✍️ Creating Constant Variable
2:28 🏷️ Creating First Tag
3:23 🔍 Previewing the Configuration
4:33 🎒 Begin Checkout Event
5:32 📝 Sending Code to Developer
6:08 🛠️ Adding Code for 'Begin Checkout' Event
6:33 🛠️ Accessing Theme Files
7:14 🧐 Previewing the Connection
7:28 🔗 Configuring Tags and Triggers
8:25 📊 Event Parameters in GTM
10:58 🏷️ Creating Google Analytics Event Tag
11:43 🕵️♂️ Testing & Debugging
12:27 🚀 Publishing Changes
Hi, I have noticed, that if you add the product to cart on the product page and from there direct hit checkout button, the Ecommerce Item is sent to GA4 without information.
Hi, the reasons it's not populating any product data, is because the cart data is initialized with the cart on the page load. The cart_data = {{ cart | json }}; assignment occurs on page load and the add_to_cart event happens later, then the begin_checkout event is being triggered with outdated cart data.
A simple fix would be: Fetch Updated Cart Data on Checkout Event: Modify the event listener for the checkout button so that it fetches the latest cart data before pushing the data layer event. I have updated the script for the custom_begin_checkout on the blog post.
Happy Tracking..!!
I'm not able to get through this step. I installed code on the website, and now its just not detecting the preview in GTM
There can be a few reasons, the main one can be that the custom_begin_checkout only works with the /cart route, and not with the mini-cart for now. I have not covered the mini-cart yet.