Google Tag Manager is a flexible tag management tool that lets you deploy and manage analytics, SEO, and marketing scripts across your store without editing code. You can connect services like Google Analytics 4, Google Ads, Meta Pixel, Microsoft Clarity, LinkedIn Insights, and Hotjar from one central workspace. Spree makes it easy to connect your store to GTM and uses its ecommerce dataLayer to automatically push rich event data to your GTM container - no custom code required.Documentation Index
Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
Use this file to discover all available pages before exploring further.
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.

Ignore the GA4 Measurement ID field - simply leave it blank.

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).

