Marketing

Attribute Email & SMS Campaign Costs to Per-Order Margin Impact

Agentis connects to Klaviyo to attribute the cost of email and SMS campaigns to individual orders, so you know whether that 20%-off win-back flow is actually profitable.

How It Works

Agentis reads Klaviyo campaign and flow data (including send volumes, campaign costs, and attributed revenue) then allocates marketing cost to orders that were influenced by each campaign. When a customer clicks a Klaviyo email with a discount code and places an order, Agentis factors in the campaign's per-order cost alongside COGS, shipping, and payment fees. This gives you true marketing-adjusted margin per order and per campaign.

Data Flows

  • →Campaign and flow send costs from Klaviyo → Agentis marketing cost allocation
  • →Attributed revenue per campaign/flow from Klaviyo → Agentis campaign margin model
  • →Discount code usage linked to Klaviyo flows → Agentis promo margin impact analysis
  • →SMS message costs per recipient from Klaviyo → Agentis per-order marketing cost

Benefits

  • Know the true margin impact of every Klaviyo flow, not just revenue but profit
  • Identify win-back and discount flows that generate revenue but destroy margin
  • Allocate SMS costs (typically $0.01-0.05/message) to individual order profitability
  • Optimize campaign strategy based on margin contribution, not just attributed revenue

Setup

  1. 1Connect your Klaviyo account to Agentis via private API key (read-only)
  2. 2Agentis imports your flow and campaign history, send costs, and attribution data
  3. 3Map discount codes to Klaviyo flows for precise promo-to-campaign attribution

Technical Details

Agentis uses Klaviyo's v3 REST API with a private API key (read-only scope). We query the /campaigns, /flows, and /events endpoints to pull send volumes, costs, and attribution data. Campaign cost allocation uses Klaviyo's native attribution window (default 5-day click / 24-hour open) to assign marketing spend to converted orders. Data syncs every 30 minutes via polling. For discount code mapping, Agentis cross-references Klaviyo flow triggers with Shopify discount code usage on orders.

Frequently Asked Questions

How does Agentis allocate Klaviyo campaign costs to individual orders?

Agentis divides the total campaign send cost by the number of attributed conversions, then applies that per-order marketing cost to each order's margin calculation. For flows, we use the per-message cost (email or SMS) multiplied by the touchpoints that led to conversion.

Can Agentis act on a campaign-driven order that is unprofitable?

Yes. You can configure Agentis to flag orders, or hold them before fulfillment, where the combined discount and marketing cost pushes net margin below your floor. Many teams use this integration mainly for campaign-level reporting.

Does Agentis support Klaviyo SMS and email cost separately?

Yes. SMS messages have a measurable per-send cost ($0.01-0.05 depending on country) that Agentis tracks separately from email (which is billed per profile). Both are factored into per-order margin calculations.

Related Solutions

Key Concepts

Free Audit, No Commitment

Protect Every Order's Profit Margin

See exactly how much margin Agentis can recover for your store in 7 days, no commitment required.