kapa.ai is there any documentation on how to use Shopify Flows to send order data to Mixpanel? All the attempts I make get a response back saying the body is malformed
Please stand by Matthew M. as I search the knowledge base. I normally take about 15 seconds or so. 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
I’m sorry, but the provided knowledge sources don’t mention using Shopify Flow specifically to send order data to Mixpanel, so I can’t give you a Flow-specific recipe or JSON schema.What is documented is: - The recommended Shopify → Mixpanel setup is via the Mixpanel JavaScript SDK on your storefront plus the Shopify Web Pixel API for checkout/order events, not via Shopify Flow HTTP calls.[Shopify guide; CMS & E‑Commerce]
- The Web Pixel examples show how to track product_viewed and checkout_completed by subscribing to Shopify’s pixel events and then calling mixpanel.track(...) with a JSON object of properties. [Shopify web pixel]Example (from the docs) for checkout_completed: js analytics.subscribe('checkout_completed', (event) => { (function (f, b) { /** Mixpanel snippet **/ })(document, window.mixpanel || []); mixpanel.init('YOUR_PROJECT_TOKEN');LBKS const checkout = event.data.checkout; mixpanel.track('Checkout completed', { value: checkout.totalPrice.amount, created_at: event.timestamp, order_number: checkout.order.id, userId: event.clientId, order_id: checkout.order.id, products: checkout.lineItems.map((item) => { return { product_id: item.id, title: item.variant.product.title, quantity: item.quantity, price: item.variant.price.amount, currency: item.variant.price.currencyCode, sku: item.variant.sku, size: item.variant.product.size } }) }); });LBKS
[Checkout example]Because there’s no documentation here about Shopify Flow’s HTTP action or the exact error you’re seeing, I can’t say precisely why your body is “malformed” (e.g., wrong endpoint, encoding, or field names). The docs only note, in general, that malformed payloads to Mixpanel’s Import API will return a 400 and must not be retried.[Import best practices; Google PubSub errors]Given the available docs, the supported and documented path for order data from Shopify into Mixpanel is: 1. Install the Mixpanel JS SDK with Autocapture in theme.liquid for general behavior. [Shopify integration]
2. Use Shopify Web Pixel + Mixpanel SDK to track structured order/checkout events (like the checkout_completed example above). [Shopify web pixel]If you want to keep going with Shopify Flow specifically, the docs here don’t provide enough detail to troubleshoot the malformed body error, so I’d recommend either: - Switching to the documented Web Pixel approach, or
- Sharing the exact Flow HTTP configuration and response with Mixpanel Support so they can validate the payload against the Import/Track API requirements.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
