How it works
Follow these 4 simple steps to track Shopify refunds in Mixpanel automatically
Refund Created
Refund Created
Retrieve Order
Retrieve Order
Custom Code
Custom Code
Create an Event
Create an Event
Make it your own
Customize this workflow even further:
Add product-level refund details
Modify the custom code to create separate events for each refunded line item instead of one aggregated event, enabling product-specific refund rate analysis and identifying which products drive the most returns.
Include refund method information
Add properties to the Mixpanel event that capture the refund gateway, payment method, or whether it was a store credit versus original payment method refund, helping analyze refund processing patterns.
Send alerts for high-value refunds
Add a filter step before Mixpanel that checks {{custom.total_refund_amount}} and sends Slack notifications when refunds exceed a certain threshold, enabling immediate investigation of significant returns.
Track time-to-refund metrics
Modify the custom code to calculate the days between order creation ({{shopify_1.created_at}}) and refund creation ({{shopify.created_at}}), adding this as a property to analyze how quickly refunds are processed.
Frequently asked questions
What if a refund doesn't have a reason specified?
The Refund Reason property ({{shopify.order_adjustments[0].reason}}) will be empty if no reason was entered when processing the refund. The event will still be created with all other properties populated. Consider adding a filter or default value in the custom code if you want to ensure every event has a reason.
Can I track partial refunds versus full refunds differently?
Yes, add a comparison in the custom code that checks if {{custom.total_refund_amount}} equals the order's {{shopify_1.total_price}} to determine full versus partial refunds, then add this as a property or create different event names for each type.
How are refund amounts calculated when there are multiple transactions?
The custom code loops through all transactions in {{shopify.transactions}} and sums the amounts. The code negates the amounts because Shopify stores refund transaction amounts as positive numbers, but they represent money leaving your account, so the code converts them to negative values for accurate refund total calculation.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.
Ready to track Shopify refunds in Mixpanel automatically?
Join thousands who've automated their work and saved an average of 3.5 hours every week.
Use this template — It's free7-day free trial • 5 min setup • Cancel anytime