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

    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Shopify’s rebuilt Store activity log centralizes every modification—from products to payments—into one searchable timeline. Learn what’s new, who can see it, and how merchants and developers can act today.

    November 13, 20264 min
    Custom Draft Order Discounts Now Respect Presentment Currency

    Custom Draft Order Discounts Now Respect Presentment Currency

    Shopify now calculates custom draft‑order discounts in the draft’s presentment currency instead of the shop’s default. Learn what this means for merchants, developers, and how to update your workflow today.

    November 13, 20264 min
    Checkout Functions Get Smarter: `cart.deliverableLine` Now Includes Cost Modeling and Direct Cart Line Links

    Checkout Functions Get Smarter: `cart.deliverableLine` Now Includes Cost Modeling and Direct Cart Line Links

    Shopify’s latest checkout function update adds cost modeling to `cart.deliverableLine` inputs and ties them directly to their originating cart lines. Learn what this means for developers, how to adjust your code, and the best practices to stay compliant.

    November 13, 20264 min
    Case-Insensitive Market Metafields: What the 2027-01 Storefront API Change Means for Your Store

    Case-Insensitive Market Metafields: What the 2027-01 Storefront API Change Means for Your Store

    Shopify's Storefront API 2027-01 now matches Market.metafields keys case‑insensitively. Learn why this matters, who is affected, and how to update your apps and custom storefronts before the change breaks your logic.

    November 13, 20264 min