Google Tag Manager
This section explains how to set up Google Tag Manager (GTM) to accomplish the integration of events. Specifically, we will cover the cart
and transaction_end
events, which are essential for monitoring user actions on product and checkout pages.
The setup involves adding two types of code snippets to your pages:
- Shared Tag: This tag loads
ftltag.js
, making theftltag
method available for use in other event-specific tags. - Event-Specific Tags: One tag tracks when a product is added to the cart (
cart
event), and another captures purchases made during checkout (transaction_end
event).
This method ensures consistent tracking with minimal setup, making it an efficient choice for event tracking. Below are the detailed steps for implementation.
Loading ftltag.js
Create a tag that fires on both the product and checkout pages.
Your setup should resemble the following:
Capturing the Cart Event
Create a tag that fires when a product is added to the cart. Refer to the cart
event for the cart event format.
Example:
Capturing the Purchase Event
Create a tag that fires when a purchase is successfully completed. Refer to the transaction_end
event for the purchase event format.
Example: