This repository contains a Google Tag Manager (GTM) Web Container export (template.json
) to streamline the integration of GTM and GA4 for Shopify stores using the Addingwell Shopify Application. It is pre-configured to manage key e-commerce tracking events and supports server-side tracking with a server_container_url
.
-
Pre-configured GA4 Tags and Triggers
Includes multiple GA4 tags such as:- Search
- Login
- Sign up
- View Item List
- Select Item
- View Item
- Add to Cart
- Remove from Cart
- Begin Checkout
- Add Payment Info
- Add Address Info
- Add Shipping Info
- Add Address Info
- Purchase
-
DataLayer Variables for Shopify
Captures essential e-commerce data from Shopify's dataLayer, such as:- Transaction ID
- Items
- Tax
- Value
- Currency
- User-specific details (email, phone, address components)
-
Server-Side Tracking Integration
Allows seamless server-side tracking through a configurableserver_container_url
. -
Built-in Debugging and Customization
Includes built-in variables likePage URL
,Referrer
, andEvent
for flexible debugging and monitoring.
Before using this container, ensure you have:
- Addingwell Shopify Application installed and configured on your store.
- Access to a GTM account and a server-side GTM container URL.
- Basic familiarity with GTM and Shopify dataLayer.
- Clone or download the repository and locate
template.json
. - Log in to your Google Tag Manager account.
- Navigate to Admin > Import Container in your web container.
- Upload
template.json
. - Choose either Merge or Overwrite, depending on your setup.
- Confirm the import.
- Edit the GA4 - Measurement ID variable in GTM to include your GA4 measurement ID (e.g.,
G-XXXXXXXX
). - Update the GA4 - Server Container URL variable to your server container URL.
- Ensure that the Addingwell Shopify Application is properly configured with the required settings.
- Verify that the application is enabled in your Shopify theme and that the "Customer Event" (pixel) code has been correctly added.
- Enable GTM Preview mode to validate tag firing.
- Verify events are tracked correctly in GA4.
- Use the GTM server-side debugger for further validation.
-
GA4 Configuration Tag
Base configuration for GA4, includesserver_container_url
. -
GA4 Event Tags
Handles key Shopify interactions:view_item
add_to_cart
begin_checkout
- And more...
- Pre-configured to fire on custom Shopify events, such as:
add_to_cart
begin_checkout
-
Custom Variables for GA4:
GA4 - Measurement ID
GA4 - Server Container URL
-
DataLayer Variables for e-commerce:
- Transaction ID
- Items
- Currency
- User details (email, phone, address components)
Page URL
,Referrer
,Event
, and others for debugging.
- Ensure
server_container_url
is correctly set in the Addingwell app. - Test dataLayer variables and triggers using GTM’s debugging tools.
- Verify GA4 settings (Measurement ID, data streams, etc.).
Contributions to improve or extend this template are welcome. Submit a pull request or open an issue for discussion.