Shopify COGS Tracking: How to Use It in Google Ads

Learn how to track COGS in Shopify and connect it to Google Ads for profit-based reporting. Improve your pricing and campaign decisions with better data.

Published at Published: 21.07.2025
Updated at Updated: 21.07.2025

One of the most overlooked yet essential metrics in ecommerce is the Cost of Goods Sold (COGS). Without tracking it properly, it’s nearly impossible to evaluate how much you’re really earning from each product, campaign, or order.

Many Shopify merchants struggle with inaccurate pricing, unreliable ad performance data, and poor inventory decisions, all of which trace back to missing or inconsistent COGS tracking.

Shopify COGS What It Is How to Track It

Here are five key takeaways from this guide:

  • COGS shows the true cost of each product sold, including materials, labor, packaging, and production costs.

  • Gross profit = Revenue − COGS, which is a much more useful metric than ROAS alone.

  • Google Ads can report gross profit if you include the [cost_of_goods_sold] attribute in your Merchant Center feed.

  • Many merchants rely on rough estimates or outdated manual inputs, which results in misleading analytics.

  • COGS tracking doesn’t require perfection, but consistent and structured input helps unlock real profitability insights.

This article will walk through what COGS means in ecommerce, how it’s calculated, how it connects to your Shopify store and ads, and what you can do to improve the accuracy of your tracking and reporting.

What Is COGS in Ecommerce and Why Should Shopify Merchants Care?

COGS, or Cost of Goods Sold, refers to the direct costs associated with producing or purchasing the products you sell. These are not your general business expenses like marketing or rent, but rather the specific costs that go into getting a product ready for sale.

Components of Cost of Goods Sold COGS

Here’s what typically falls under COGS:

  • Raw materials used in manufacturing

  • Packaging supplies

  • Freight and shipping into your warehouse

  • Product assembly or production labor

  • Items purchased for resale

In contrast, things like software subscriptions, customer service, or advertising budgets are considered operating expenses and do not belong in COGS.

Why is COGS important for my business?

So why does COGS matter so much?

  • It determines your gross profit, which is a clearer reflection of product-level profitability than revenue or ROAS.

  • It impacts your pricing decisions. If you underestimate your product cost, you may price below what’s sustainable.

  • It’s essential for financial reporting and taxes. Your taxable income depends on correctly calculated expenses.

  • It affects inventory management. Accurate COGS helps you identify which products are worth restocking or promoting.

For Shopify merchants who rely heavily on ads to drive growth, tracking COGS is especially important. It allows you to assess not just how much you sell, but how much you keep from each sale.

Shopify COGS Formula and How to Calculate It

The standard formula for calculating COGS is:

COGS = Beginning Inventory + Purchases During the Period − Ending Inventory

COGS Calculation Process

Each part of this formula refers to inventory value, not sales revenue:

  • Beginning Inventory: The total value of unsold stock at the start of the reporting period.

  • Purchases During the Period: The cost of additional inventory acquired during that time, including materials, packaging, and any related freight charges.

  • Ending Inventory: The value of remaining inventory at the end of the period.

This calculation gives you the total cost of the products that were sold during the selected time frame.

Example

Let’s say you started January with $10,000 in inventory. You purchased another $5,000 worth of stock in January. At the end of the month, your remaining inventory is valued at $4,000.

Your January COGS would be:

$10,000 + $5,000 − $4,000 = $11,000

That means you sold $11,000 worth of inventory during the month, regardless of the revenue you generated.

What Shouldn’t be Included in COGS?

What Shouldn’t be Included in COGS?

  • Marketing costs (ads, email software)

  • Transaction fees

  • Website hosting

  • Salaries for administrative or customer service staff

Why Merchants Often Get It Wrong

Even though the formula is straightforward, many Shopify merchants struggle with accuracy because:

Common Mistakes in COGS Calculation

  • Inventory values are not updated frequently

  • Discounts, bulk pricing, or shipping fees are left out

  • COGS per item is static, even when supplier costs fluctuate

  • They rely on spreadsheets, which aren’t ideal for high-volume stores

This disconnect leads to unreliable profit metrics, especially when evaluating the effectiveness of ads or sales strategies.

How to Track COGS in Shopify (Manual and Automated Options)

Shopify doesn’t automatically calculate or report COGS unless you provide the data yourself. The quality of your profit analytics depends entirely on how this information is entered and updated.

There are two common methods for tracking COGS: manual entry and automated syncing through connected systems.

Manual Tracking in Shopify

Shopify offers a built-in Cost per Item field for each product and variant. You can enter your cost here, and it will be used in Shopify’s profitability reports if enabled.

Steps:

  1. In your Shopify admin, go to Products.

  2. Select a product and scroll down to the Pricing section.

  3. Enter your cost in the Cost per item field.

Should I use manual tracking for my Shopify store?

This method works for small catalogs with stable pricing. However, it becomes difficult to maintain accuracy when:

  • Supplier prices change frequently

  • Shipping or handling costs vary by region

  • Discounts or multi-supplier sourcing are involved

Because the field accepts only one static value per variant, it doesn’t account for real-world fluctuations unless you update it regularly.

Automated Tracking (via Inventory or Finance Tools)

For stores with larger catalogs or international fulfillment, COGS tracking is often handled by inventory management tools, ERP systems, or accounting platforms that integrate with Shopify. Automated Tracking Tools

These tools can:

  • Pull cost data from suppliers or purchase orders

  • Assign different costs by location, supplier, or variant

  • Adjust COGS dynamically as inventory changes

Automated tracking also enables per-order cost accuracy, which is useful when combined with analytics tools or when sending COGS to ad platforms.

Recommendation for Shopify Stores

If you’re managing fewer products or costs rarely change, start with manual inputs. For growing stores or multi-channel operations, syncing cost data through integrated systems helps maintain reliability without constant oversight.

Why Google Ads Profitability Depends on Accurate COGS

In Google Ads, most Shopify merchants rely on ROAS (Return on Ad Spend) to evaluate performance. While this shows how much revenue was generated per dollar spent on ads, it leaves out a critical factor: how much the products cost to sell.

Without accurate COGS, ROAS can be misleading. A campaign might show strong returns, but after accounting for product costs, it may actually be unprofitable.

What COGS Adds to the Picture

When you include COGS in your reporting, you can calculate:

COGS Impact on Profit Analysis

  • Gross profit per product: How much is left after subtracting the cost of the item

  • Gross profit margin: Profit percentage across campaigns or product groups

  • Profit-based performance segments: Identify which products bring the highest return after costs

These metrics allow smarter bidding and budget allocation. For example:

  • You can reduce spend on low-margin items, even if they sell well

  • You can increase exposure for high-margin products, even if they have a lower ROAS

How Google Uses the COGS Attribute in Merchant Center

The [cost_of_goods_sold] attribute in your Merchant Center feed is what enables Google to show profit metrics alongside ad performance data. While it’s not a required field, it becomes essential if you want visibility into how much profit your ads are generating, not just revenue.

When this attribute is included:

Enhancing Google Ads with COGS

  • Google calculates gross profit by subtracting the submitted COGS from the conversion value.

  • Profit-based metrics (like gross profit and gross profit margin) appear in your Google Ads reports.

  • You can access features like automated discounts, which factor in your profit thresholds.

Requirements for Submitting COGS to Google

To ensure the COGS attribute works correctly:

COGS Submission Requirements

  • Use ISO 4217 currency codes (e.g., USD, EUR).

  • Use a period for decimal points (e.g., 14.99 USD).

  • Keep the currency consistent with your product pricing.

  • Provide one value per item, average COGS is acceptable if it varies.

This information is used only for reporting. It doesn’t affect bidding directly but allows you to interpret your results through the lens of profitability instead of just sales volume.

By enabling this attribute, you’re not changing how your ads run, you’re changing how you evaluate their success.

Using Conversions with Cart Data (CwCD) for Better Profit Tracking

Conversions with Cart Data (CwCD) is a feature in Google Ads that captures not just the total order value but also which specific products were purchased during a conversion. This matters because the item clicked in an ad isn’t always the one the customer ends up buying.

Insights with Conversions with Cart Data

By enabling CwCD, you gain visibility into:

  • The exact items purchased per conversion

  • Product-level metrics such as quantity sold and gross profit

  • Which ads or products act as entry points vs actual converters

Why It Matters for COGS

When the [cost_of_goods_sold] attribute is paired with cart data, you get accurate gross profit reporting per item — not just averages across the order.

Benefits of COGS and Cart Data

This enables:

  • More precise campaign evaluations, especially for multi-product carts

  • Better understanding of upsell and cross-sell patterns

  • Data-driven product prioritization in Shopping or Performance Max campaigns

Built for Shopify - No Dev Work Required - Fast Setup
Analyzify logo

Missing Conversions in GA4 or Meta Ads?

Standart browsing tracking misses conversions - Analyzify adds Server-side tracking for accurate GA4 & Meta reports.
Protect Your Tracking Accuracy

How to Use It

To use CwCD with COGS:

  1. Set up purchase tracking through Google Tag Manager or the global site tag.

  2. Ensure item-level data is sent with each conversion event.

  3. Include the COGS attribute in your product feed.

How to ensure COGS data appears correctly in Google Ads reports?

⚠️ Important note: For COGS data to appear correctly in Google Ads reports, the product ID sent with the conversion event must match the ID in your product feed. If there’s a mismatch or inconsistent formatting (e.g. missing variant ID or different structure), COGS won’t be applied to the product in reporting. Make sure your item_id values are clean and consistent across your store, product feed, and tracking setup.

When configured correctly, your reports will show not just revenue per ad but also how much profit each product contributed to the result.

How Analyzify Helps: Tracking Revenue Is Not Enough Without COGS

Analyzify doesn’t manage or calculate COGS - that part is handled through your product feed, inventory tools, or Shopify’s built-in fields. But once accurate cost values are in place, Analyzify plays a key role in ensuring that your purchase tracking includes the necessary item-level data for profit-based reporting in Google Ads.

Enhancing Google Ads with Analyzify

What Analyzify Enables

Analyzify’s tracking setup ensures that your purchase events include detailed item-level data, such as product IDs, variant details, and revenue values, which are required for Google Ads profit reporting features.

This data is passed through client-side tracking methods, including support for Google’s Enhanced Conversions, which enrich attribution using first-party customer data like hashed email addresses. These enhancements can improve match quality and reporting in Google Ads - but they still rely on browser-based events.

⚠️ Important note: However, even when purchase events are tracked correctly, COGS values won’t appear in reports unless they are present in the product feed and properly formatted. The item ID in your feed must also match the ID sent with the conversion event. Any mismatch or formatting issue may prevent COGS data from being applied in Google Ads reporting.

Practical Use Case

Let’s say a customer clicks an ad for Product A but ends up purchasing Product B and C instead. With the right setup:

How to optimize ad performance using Analyzify?

  • You’ll see which products were actually purchased

  • Gross profit can be calculated at the item level when COGS is provided

  • Ad performance can be evaluated based on profitability, not just clicks or revenue

Analyzify ensures that the necessary purchase details are captured accurately, aligned with Google’s Enhanced Conversions requirements, and structured correctly for CwCD-based reporting.

Final Thoughts: Better Data, Better Profitability

Tracking revenue without COGS only gives part of the picture. To understand how your Shopify store is really performing, you need to know how much it costs to sell each product, and how those costs relate to your ad spend and conversion results.

Adding COGS to your product feed and enabling detailed conversion tracking allows you to:

  • Measure gross profit per item, not just revenue

  • Make better pricing and budgeting decisions

  • Optimize ads for what’s actually profitable, not just popular

Built for Shopify - No Dev Work Required - Fast Setup
Analyzify logo

Standart Tracking Methods Aren't Enough for Shopify

Let Analyzify combine client-side and server-side tracking. So you capture every important event, even when browser script fail.
Fix Your Tracking Gaps Today

Analyzify helps ensure that your product-level purchase data is captured cleanly and sent to the right platforms, including support for Enhanced Conversions in Google Ads. While it doesn’t calculate COGS, it gives you the infrastructure needed to report on it accurately.

Frequently Asked Questions

What should I do if COGS isn’t showing in my Google Ads reports?

If COGS values aren’t appearing, first check that your product feed includes the [cost_of_goods_sold] attribute for each item, using the correct format (e.g. 12.50 USD). Then make sure the item_id sent in your conversion events exactly matches the ID in your feed. Even small formatting mismatches (like missing variants or inconsistent casing) can prevent the data from linking properly.
Yes. Google accepts average or estimated COGS values for reporting purposes. It doesn’t need to be exact. The goal is to provide a consistent, structured input that gives a reliable picture of gross profit over time. You can update COGS periodically as needed, especially for high-volume or high-variation products.
Not directly. Google Ads doesn't use COGS values to adjust bidding automatically. However, once you have profit data in your reports, you can manually adjust your campaigns based on gross profit instead of just ROAS. For example, you might lower bids on low-margin items or increase visibility for products with higher profitability.
Yes. You can test by completing a real or test purchase and reviewing the product-level conversion data in Google Ads. Use the “Cart Data” or “Purchased Items” columns in your reports. If gross profit and COGS columns remain empty, double-check your feed and tag setup, especially the match between item_id and product feed.
Google Ads will only show gross profit metrics for products that have a valid COGS value in the feed. Products without COGS will still appear in reports, but profit-related columns will remain blank for those items. It’s best to include at least rough values for all products you actively advertise.

Latest Posts

The latest news, technologies, and resources from our team.
View all posts
Blog Post Icon
Shopify COGS Tracking: How to Use It in Google Ads
Published at 21.07.2025
Published by İsmail Atasoy
Learn how to track COGS in Shopify and connect it to Google Ads for profit-based reporting. Improve your pricing and campaign decisions with better data.
Blog Post Icon
How Shopify One-Page Checkout Tracking Works
Published at 18.07.2025
Published by İsmail Atasoy
Understand Shopify one-page checkout tracking and how to capture events like payment selection, discount codes, and UI alerts with Analyzify.
Blog Post Icon
How to Customize Reports in Google Analytics 4 (GA4)
Published at 17.07.2025
Published by Aysegul Uslu
Learn how to customize reports in Google Analytics (GA4) using filters, dimensions, the Library, and more, plus real examples and tips for accurate data.
Blog Post Icon
How to Track Campaign Source and Click IDs in Shopify Orders
Published at 14.07.2025
Published by İsmail Atasoy
Tired of missing attribution in GA4 or Meta? Learn how to store GCLID, FBCID, and UTM data directly in Shopify orders and improve your server-side tracking.
Sign up for our newsletter
Be the first to know about releases and industry news and insights.
We care about your data in our privacy policy.
Take the first step towards reliable tracking Join 3,000+ merchants who trust their tracking with Analyzify.