Here's how you can set up event tracking on GA4 for Thrive via Google Tags Manager -
- page_view: Tracked when a user views a page on the website.
- view_item: Tracked when a user views the details of a specific food item or menu
- add_to_cart: Tracked when a user adds an item to their cart.
- remove_from_cart: Tracked when a user removes an item from their cart.
- view_cart: Tracked when a user proceeds to the cart page to view cart contents.
- begin_checkout: Tracked when a user starts the checkout process.
- add_payment_info: Tracked when user selects/adds a payment method to proceed with the payment.
- purchase: Tracked when a user completes a purchase.
Add a GA4 Ecommerce Events tag in GTM — In GTM, click to add a new tag. For “Tag Type,” select “Google Analytics: GA4 Event.”
For configuration tag — Add the GA4 tag created above
Event name - Click on the lego button under the event name and add a built-in variable called Event.
Click on More Settings → Send E-commerce data.
For the data source, select the data layer. Ideally it should be selected by default.
Next, we have to select a trigger. Click on Triggering. Click on the + in the upper-right corner. Select Trigger Configuration → Custom Event. Tick the box for Use RegEx matching and in the event name paste the text given below -
view_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_payment_info|purchase|select_promotion|view_promotion
In the trigger fires on select → All Custom Events
Name the trigger and save it. Refer to the image given below.
Name the tag — Name this tag something like “GA4 Ecommerce Events” and then save the tag.
After completing all the steps mentioned, publish your changes and in the debug mode in GA4 check the events flowing after you open your direct ordering link to test the events created.