Klaviyo integration for Spree Commerce
This is an official Klaviyo email marketing extension for Spree Commerce - the open-source eCommerce platform for Rails.
Event Tracking
Once the Spree and Klaviyo integration is set up, Spree automatically tracks the following customer events happening on your store website and sends them to Klaviyo, so you could set up your desired email campaigns triggered by these events:
- Product view
- Product list view
- Product search
- Product added to cart
- Product removed from cart
- Checkout step view
- Checkout step complete
- Coupon entered/removed
- Coupon applied/denied
- Checkout email entered
- Newsletter subscription
- Unsubscribe from newsletter
Note
When a user subscribes to the newsletter on the storefront, they’re automatically added to the list you configured in the integration settings.
These events populate the Audience → Profiles section in Klaviyo, where you can view each user’s tracked activity and properties. Lists used for newsletter subscriptions can be found in Audience → Lists & Segments.
Installation
-
Add this extension to your Gemfile with this line:
bundle add spree_klaviyo
-
Run the install generator
bundle exec rails g spree_klaviyo:install
-
Restart your server
If your server was running, restart it so that it can find the assets properly.
Setup guide
Please follow our setup guide how to setup Klaviyo with Spree Commerce.
Developing
-
Create a dummy app
bundle update bundle exec rake test_app
-
Add your new code
-
Run tests
bundle exec rspec
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_klaviyo/factories'
Releasing a new version
bundle exec gem bump -p -t
bundle exec gem release
For more options please see gem-release README
Contributing
If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.
Copyright (c) 2025 Vendo Connect Inc., released under the AGPL 3.0 license.
Join the Community
Join our Slack to meet other 6k+ community members and get some support.
Need more support?
Contact us for enterprise support and custom development services. We offer:
- migrations and upgrades,
- delivering your Spree application,
- optimizing your Spree stack.