Unlock Better Profit Insights: New Shipping & Duty Data in Shopify Analytics

Shopify now delivers richer, real‑time shipping and duty data in Analytics, refining profit margins and custom reports. Learn what changed, who’s affected, and how to adapt your store and code.

Unlock Better Profit Insights: New Shipping & Duty Data in Shopify Analytics
7 sections

Shopify merchants and developers rely on accurate analytics to make data‑driven decisions. The latest Merchant Changelog entry, “Improved shipping and duty data in Analytics,” upgrades the granularity and timeliness of shipping costs and duties across the platform. In this post we’ll unpack the change, identify who it impacts, and give you concrete steps to ensure your reports, dashboards, and custom code stay spot‑on.

What Changed: More Complete Shipping & Duty Data

Shopify now captures a fuller picture of every order’s shipping expenses and any applicable customs duties. The data feed into both native Shopify reports (like “Average profit margin by market” and “Profit margin by order”) and any custom analytics you’ve built using the Analytics API or the new Reports API. The key improvements are:

  • Timeliness – Shipping and duty values are updated as soon as carriers and customs systems confirm the charge.
  • Completeness – Previously omitted fees (e.g., broker fees, ancillary surcharges) are now recorded.
  • Consistency – A single source of truth powers both Shopify‑generated and developer‑created reports, reducing discrepancies.
  • Who Is Affected: Merchants vs. Developers

    Merchants – Store owners will see altered numbers in profit‑related reports. If you’ve set profit‑margin targets or use these metrics to drive advertising spend, expect a short adjustment period while the new data settles.

    Developers – Anyone pulling shipping or duty fields via the GraphQL Analytics API, the REST Admin API, or the Reports API must verify that their queries reference the updated field names and data types. The schema itself hasn’t changed, but the values returned will be richer, which can affect downstream calculations, alerts, and UI components.

    Impact on Reports & Profit Calculations

    Because shipping and duty costs flow directly into profit calculations, you may notice:

  • Higher reported shipping costs for orders that include carrier‑added fees.
  • New duty entries for international orders that previously showed $0.
  • Adjusted profit margins – the “Average profit margin by market” report may dip slightly in markets with high import duties.
  • These shifts are not errors; they reflect a more accurate cost basis. The change also means historic reports will no longer be directly comparable to post‑update data unless you apply a normalization factor.

    Action Steps for Merchants

  • Review the updated reports – Open “Profit margin by order” and confirm the new shipping/duty figures align with carrier invoices.
  • Adjust budgeting – If your advertising ROAS calculations used the old profit numbers, recalculate using the refreshed data.
  • Communicate with finance – Share the changelog note with your accounting team so they understand the source of the variance.
  • Set alerts – In Shopify Flow or a third‑party BI tool, create a trigger when shipping cost exceeds a defined threshold, now that those fees are captured.
  • Educate staff – Update internal documentation that describes how profit is computed, noting the inclusion of duties.
  • Implementation Tips for Developers

  • Check your GraphQL queries – The field paths remain shippingLines.totalPriceSet and duty.amountSet, but the amountSet now includes carrier‑added components. Example query:
  • graphql

    query OrderAnalytics($ids: [ID!]!) {

    orders(first: 100, query: $ids) {

    edges {

    node {

    id

    totalPriceSet {

    shopMoney { amount currencyCode }

    }

    shippingLines {

    totalPriceSet {

    shopMoney { amount currencyCode }

    }

    }

    duties {

    amountSet {

    shopMoney { amount currencyCode }

    }

    }

    }

    }

    }

    }

  • Update any custom profit calculations – If you previously subtracted shippingLines.totalPriceSet only, now also subtract duties.amountSet to keep margins accurate.
  • Validate data freshness – The new data may arrive a few minutes after order fulfillment. If your real‑time dashboards rely on immediate values, add a short retry or a “last updated” timestamp check.
  • Version your reports – When you create a custom report definition via the Reports API, include a note in the description field that it uses the post‑update schema. This helps future team members understand the context.
  • Test in a development store – Deploy the query and compare a handful of orders before and after the change to verify the numbers line up with carrier statements.
  • Sample Code: Adjusting a Custom Profit Report

    Below is a lightweight Node.js snippet that pulls orders, computes net profit, and stores the result in a temporary collection for a dashboard widget. The key addition is the duty subtraction:

    js

    const { GraphQLClient } = require('graphql-request');

    const client = new GraphQLClient('https://your-store.myshopify.com/admin/api/2024-07/graphql.json', {

    headers: { 'X-Shopify-Access-Token': process.env.SHOPIFY_TOKEN }

    });

    const QUERY = `

    query ($ids: [ID!]) {

    orders(first: 200, query: $ids) {

    edges { node {

    id

    totalPriceSet { shopMoney { amount } }

    shippingLines { totalPriceSet { shopMoney { amount } } }

    duties { amountSet { shopMoney { amount } } }

    } }

    }

    }`;

    async function fetchOrders(ids) {

    const data = await client.request(QUERY, { ids });

    return data.orders.edges.map(e => e.node);

    }

    function calculateNetProfit(order) {

    const revenue = parseFloat(order.totalPriceSet.shopMoney.amount);

    const shipping = order.shippingLines.reduce((sum, s) => sum + parseFloat(s.totalPriceSet.shopMoney.amount), 0);

    const duties = order.duties.reduce((sum, d) => sum + parseFloat(d.amountSet.shopMoney.amount), 0);

    // Assume costOfGoods is stored elsewhere; using placeholder 0 for demo

    const costOfGoods = 0;

    return revenue - shipping - duties - costOfGoods;

    }

    (async () => {

    const orders = await fetchOrders('created_at:>2024-09-01');

    const profits = orders.map(o => ({ id: o.id, netProfit: calculateNetProfit(o) }));

    console.log(profits);

    })();

    Integrate this logic into your analytics pipeline, and you’ll see profit margins that match the updated Shopify reports.

    Conclusion & Next Steps

    Shopify’s enhanced shipping and duty data brings greater transparency to the cost side of e‑commerce, empowering merchants to make smarter pricing, marketing, and inventory decisions. By reviewing the refreshed reports, updating any custom calculations, and testing your API integrations, you’ll avoid surprises and fully benefit from the new accuracy.

    Ready to tighten your profit analysis? Dive into your Analytics dashboard today, update your custom queries, and share the insights with your finance team. If you hit any roadblocks, drop a comment below or reach out to a Shopify Expert – we’re here to help you turn data into growth.

    Tags
    Sources

    Related Articles

    Why includeRestOfWorld:true Breaks in API 2027-01 and How to Fix It

    Why includeRestOfWorld:true Breaks in API 2027-01 and How to Fix It

    Starting with GraphQL Admin API version 2027-01, setting DiscountCountriesInput.includeRestOfWorld to true triggers a BAD_REQUEST error. Learn who’s affected, why it matters, and step‑by‑step how to update your apps before the upgrade.

    September 23, 20264 min
    Events Subscription Query Complexity Limit Drops to 100 Points – What Developers Need to Know

    Events Subscription Query Complexity Limit Drops to 100 Points – What Developers Need to Know

    Shopify is lowering the Events subscription query complexity limit from 250 to 100 points. Learn what this means for your apps, how to audit and refactor subscriptions, and the exact steps to stay compliant.

    September 22, 20265 min
    Polaris CDN 1.1 Goes Stable — New Components, Props, and What It Means for Your Shopify Apps

    Polaris CDN 1.1 Goes Stable — New Components, Props, and What It Means for Your Shopify Apps

    Polaris CDN 1.1 is now stable, bringing new UI components, props, and bug fixes. Learn what changed, who it affects, and how to leverage or pin the version in your Shopify apps.

    September 22, 20264 min
    Mastering Shopify Rollouts: Granular Controls for Launches, Events, and Experiments

    Mastering Shopify Rollouts: Granular Controls for Launches, Events, and Experiments

    Shopify’s new Rollouts UI gives merchants and developers precise tools to schedule launches, run temporary events, and test changes with traffic‑percentage controls. Learn what changed, who it affects, and how to implement the new workflow today.

    September 22, 20265 min