This integration allows you to use either Google Tag Manager or Google Analytics 4 - but not both at the same time. Only one key (GTM or GA4) should be active in the integration settings. If you plan to use GA4 with GTM, you must set up GA4 inside of your GTM workspace manually.
Requirements
To use this integration, you’ll need:- An active Google Tag Manager account
- A GTM container set up for your store
- Any additional tools (e.g., Google Analytics 4, conversion tracking, custom tags) configured within GTM
Installation
Before you can enable Google Tag Manager, it must be installed. To do so, you need to run the following command:Connect Google Tag Manager
Sign in to your Spree admin dashboard and navigate to the Integrations tab.


Event Tracking
Spree sends a full suite of ecommerce events to the GTM dataLayer. This allows you to create triggers and tags based on:- Product views
- Cart actions (add/remove)
- Checkout progress
- Payment info added
- Purchase confirmation
- Search activity
- Wishlist adds
- Newsletter signups
- User engagement (sessions, first visits, etc.)
Manage Your Integration
To remove the integration or switch between GTM and GA4: Return to the integration setup page in Spree and either:- Clear the GTM field and enter a GA4 Measurement ID, or
- Click Delete in the lower-right corner to remove the integration completely
Only one analytics key should be set at a time (GA4 or GTM).