Twilio Segment
Saleor version required: 3.20Repository: GitHub
This application integrates with Twilio Segment. It tracks events occurring in Saleor and sends them to Twilio Segment.
Features
- Send information about order-related events to Segment.
- Events send to Segment have identity set to user ID or email.
Assumptions & limitations
- Currently, only order-related events are supported.
- Order webhooks are asynchronous, meaning events may not be sent to Segment immediately.
- The app uses the
trackAPI. - The app attempts to retrieve user information using the user ID or email. If that fails, it will send an anonymous ID.
- The app has its webhooks initially disabled; configuring the app will activate the webhooks.
Permissions
MANAGE_ORDERS
Application flow
The application subscribes to the following webhooks:
ORDER_CREATEDORDER_CANCELLEDORDER_FULLY_PAIDORDER_REFUNDEDORDER_UPDATED
For each webhook, the application will send the following information to Segment:
- Order
id - User information:
- User
id - User email
- User
- Channel information for the order:
- Channel
id - Channel slug
- Channel name
- Channel
- Name of the shipping method used for the order
- Total amount of the order, including:
- Total gross (amount & currency)
- Total net (amount & currency)
- Order number
- All lines of the order with:
- Line
id - Name of product variant
- Id of product variant
- SKU of product
- Line
Example of successful handling of ORDER_CREATED webhook:
Pre-requisites
- Create an account on Twillo Segment.
- Create a source in the Segment Dashboard UI and note down the
writeKeyfor this source.
Configuration
- Paste
writeKeyinto the main configuration form in the app and clickSave.
Testing
To test if your app is working, create an order in the Saleor Dashboard. Then, go to the Segment Dashboard; you should see the Saleor Order Updated event in Segment.
Troubleshooting
- Events are not showing in Segment Dashboard
- Ensure you have set your
writeKeyin the app configuration screen. - Trigger one of the supported events (see application flow section for more details).
- Ensure you have set your
Development
To run the application locally, follow the Running Saleor Apps locally article.