Segment
Track essential commerce analytics with Segment.
Features
- Automatic analytics tracking for events related to Orders, Swaps, and Claims.
- Flexibility to track analytics for custom events or operations.
Prerequisites
How to Install
1. Run the following command in the directory of the Medusa backend:
2. Set the following environment variable in
:Copy to clipboard.env
3. In
add the following at the end of theCopy to clipboardmedusa-config.js
array:Copy to clipboardplugins
Test the Plugin
1. Run the following command in the directory of the Medusa backend to run the backend:
2. Place an order using a storefront or the Store APIs. You should see the event tracked in Segment.
Additional Resources

Build your own plugins
Develop your own plugins with our API to speed up your processes.
Make your plugin available via npm for it to be shared in our Plugin Library with the broader Medusa community.
.png)