Spree Commerce comes with a native Google Analytics 4 integration that allows you to track user behavior, sales performance, and marketing effectiveness across your store. With minimal setup required, you can gain valuable insights into how visitors interact with your site, which can help you make informed decisions to improve conversions, user experience, and overall business strategy.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.
Installation
Before you can enable Google Analytics 4, it must be installed. To do so, you need to run the following command:Connect Google Analytics
Sign in to your Spree admin dashboard and navigate to the Integrations tab.

You can find the Measurement ID in the Home screen of your Google Analytics dashboard, if no data has been collected yet. Otherwise, it can be found by navigating to Admin settings > Data Streams and then clicking on the property associated with your Spree site.

Event Tracking
By default, the following events will be tracked in Google Analytics:- page_view
- first_visit
- session_start
- user_engagement
- search
- add_payment_info
- add_shipping_info
- add_to_cart
- add_to_wishlist
- begin_checkout
- purchase
- remove_from_cart
- view_cart
- view_item

