How to Use Discount Performance in Shopify: Step-by-Step Tutorial

Discover which discount codes drive revenue and which eat into your margins

Introduction to Discount Performance Analysis

Discount codes are a double-edged sword for Shopify merchants. On one hand, they can drive conversions, clear inventory, and reward loyal customers. On the other hand, poorly optimized discounts can erode margins, attract price-sensitive customers who never return, and create a race to the bottom.

The critical question every Shopify store owner faces is: Are my discounts driving revenue or eating margins?

This tutorial will walk you through a systematic approach to analyzing your Shopify discount code performance. You'll learn how to identify which codes generate the most revenue, calculate their true cost, measure their impact on average order value, and track redemption patterns. By the end of this guide, you'll have actionable insights to optimize your discount strategy and maximize profitability.

Understanding discount performance is crucial for data-driven decision making in e-commerce. Similar to how A/B testing requires statistical rigor to validate marketing experiments, discount analysis demands careful measurement to separate signal from noise in your promotional strategy.

Prerequisites and Data Requirements

What You'll Need

Understanding Your Data

Before diving into analysis, ensure your Shopify data includes these key fields:

Time Investment

Completing this tutorial will take approximately 30-45 minutes. You'll spend:

Step 1: Identify Which Discount Codes Drive the Most Revenue

The first step in discount performance analysis is understanding which codes generate the most total revenue. This is not about which code has the highest discount percentage—it's about which codes actually drive sales dollars into your business.

Why This Matters

A 50% off code that generates $1,000 in revenue is less valuable than a 10% off code that generates $10,000. Revenue impact should be your primary metric when evaluating discount performance.

How to Calculate Revenue by Discount Code

Access your Shopify discount analysis tool or export your order data. You'll need to group orders by discount code and sum the total revenue.

If you're using a spreadsheet or SQL query, here's the basic structure:

SELECT
    discount_code,
    COUNT(DISTINCT order_id) as order_count,
    SUM(total_price) as total_revenue,
    SUM(total_price) / COUNT(DISTINCT order_id) as avg_order_value
FROM shopify_orders
WHERE discount_code IS NOT NULL
    AND order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY discount_code
ORDER BY total_revenue DESC;

Expected Output

Your analysis should produce a table like this:

discount_code    order_count    total_revenue    avg_order_value
SAVE20           1,247          $87,290          $70.00
WELCOME10        2,891          $173,460         $60.00
FLASH50          312            $18,720          $60.00
LOYALTY15        1,089          $76,230          $70.00

Interpretation

In this example, WELCOME10 generates the most revenue despite having a lower discount percentage than FLASH50. This suggests that moderate discounts applied to more orders can outperform aggressive discounts on fewer orders—a crucial insight for optimization.

Look for codes that appear in your top 5 by revenue. These are your revenue drivers and should be protected and potentially expanded.

Step 2: Calculate the Average Discount Rate by Code

Revenue tells only half the story. To understand profitability, you need to know how much margin each discount code consumes.

Understanding Discount Rate

The discount rate represents the percentage or dollar amount you're giving away per order. A code might drive high revenue but also give away so much margin that it's actually unprofitable.

Calculating Average Discount Rate

For percentage-based discounts, this calculation is straightforward. For dollar-amount discounts, you'll need to calculate it as a percentage of the original order value:

SELECT
    discount_code,
    AVG(discount_amount) as avg_discount_dollars,
    AVG(discount_amount / (total_price + discount_amount) * 100) as avg_discount_rate,
    SUM(discount_amount) as total_margin_given
FROM shopify_orders
WHERE discount_code IS NOT NULL
    AND order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY discount_code
ORDER BY avg_discount_rate DESC;

Expected Output

discount_code    avg_discount_dollars    avg_discount_rate    total_margin_given
FLASH50          $30.00                  50.0%                $9,360
SAVE20           $14.00                  20.0%                $17,458
LOYALTY15        $10.50                  15.0%                $11,435
WELCOME10        $6.00                   10.0%                $17,346

Critical Analysis

Compare total margin given against total revenue from Step 1:

This reveals that FLASH50, despite its smaller revenue contribution, has a much higher margin cost. If your product margins are less than 50%, this code may actually be losing money.

Margin Safety Threshold

As a general rule, your average discount rate should not exceed 60-70% of your gross margin. If your products have a 40% margin, discount rates above 24-28% put you at risk of unprofitable sales.

Step 3: Measure Discount Impact on Average Order Value

One of the most important questions in discount analysis is: Do discounts increase or decrease average order value?

Counterintuitively, discounts can sometimes reduce AOV if customers use them to purchase smaller quantities than they would have otherwise. Conversely, percentage-based discounts on minimum order thresholds can increase AOV significantly.

The AOV Comparison Method

To measure discount impact, compare the average order value of discounted orders against non-discounted orders, and compare different discount codes against each other:

-- Compare discounted vs non-discounted orders
SELECT
    CASE
        WHEN discount_code IS NOT NULL THEN 'Discounted'
        ELSE 'Full Price'
    END as order_type,
    COUNT(order_id) as order_count,
    AVG(total_price) as avg_order_value,
    AVG(item_count) as avg_items_per_order
FROM shopify_orders
WHERE order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY order_type;

-- Compare AOV across different discount codes
SELECT
    discount_code,
    AVG(total_price) as avg_order_value,
    AVG(item_count) as avg_items_per_order,
    AVG(total_price) / NULLIF(AVG(item_count), 0) as avg_price_per_item
FROM shopify_orders
WHERE discount_code IS NOT NULL
    AND order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY discount_code
ORDER BY avg_order_value DESC;

Expected Output

-- Discounted vs Full Price
order_type       order_count    avg_order_value    avg_items_per_order
Full Price       4,521          $85.00             2.8
Discounted       5,539          $67.00             2.3

-- By Discount Code
discount_code    avg_order_value    avg_items_per_order    avg_price_per_item
LOYALTY15        $70.00             2.9                    $24.14
SAVE20           $70.00             2.5                    $28.00
WELCOME10        $60.00             2.1                    $28.57
FLASH50          $60.00             2.0                    $30.00

Interpreting the Results

In this example, several patterns emerge:

  1. Discounts reduce AOV: Discounted orders average $67 vs $85 for full-price orders—a 21% reduction
  2. Discounts reduce items per order: Discounted orders contain fewer items (2.3 vs 2.8)
  3. LOYALTY15 performs best: Despite offering 15% off, it maintains higher AOV and items per order, suggesting it's being used by more engaged customers who would buy more anyway
  4. FLASH50 has the lowest AOV: Deep discounts may be attracting bargain hunters who buy minimally

Advanced Insight: Incremental AOV

Calculate whether the additional orders generated by discounts offset the reduced AOV:

Even though discounted orders have lower AOV, they generated nearly as much revenue across more transactions. The question becomes: would those 5,539 customers have purchased at all without discounts? This is where AI-driven analysis pipelines can help identify causal relationships in your commerce data.

Step 4: Track Redemption Count and Pattern Analysis

The final critical dimension of discount performance is redemption count—how many times each code has been used and by how many unique customers.

Why Redemption Patterns Matter

High redemption counts can indicate:

Redemption Analysis Query

SELECT
    discount_code,
    COUNT(DISTINCT order_id) as total_redemptions,
    COUNT(DISTINCT customer_id) as unique_customers,
    COUNT(DISTINCT order_id) / COUNT(DISTINCT customer_id) as redemptions_per_customer,
    MIN(order_date) as first_used,
    MAX(order_date) as last_used,
    DATEDIFF(MAX(order_date), MIN(order_date)) as days_active
FROM shopify_orders
WHERE discount_code IS NOT NULL
    AND order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 90 DAY)
GROUP BY discount_code
ORDER BY total_redemptions DESC;

Expected Output

discount_code    total_redemptions    unique_customers    redemptions_per_customer    days_active
WELCOME10        2,891                2,847               1.02                        89
SAVE20           1,247                1,198               1.04                        89
LOYALTY15        1,089                456                 2.39                        89
FLASH50          312                  298                 1.05                        7

Red Flags and Opportunities

Analyzing this data reveals important insights:

1. WELCOME10: High Single-Use Rate

With 1.02 redemptions per customer, WELCOME10 is working as intended—attracting new customers with minimal repeat use. This is healthy for a first-purchase incentive.

2. LOYALTY15: High Repeat Usage

With 2.39 redemptions per customer, LOYALTY15 shows strong repeat usage among a smaller customer base (456 unique customers). This suggests it's successfully rewarding loyal customers, but you should verify it's not being abused by serial discount users.

3. FLASH50: Limited-Time Success

Active for only 7 days with 312 redemptions, FLASH50 generated 44.6 redemptions per day—strong urgency-driven performance. However, the 50% discount rate means careful consideration of whether the volume justifies the margin sacrifice.

Redemption Velocity Analysis

Calculate daily redemption rate to understand code momentum:

discount_code    total_redemptions    days_active    daily_redemption_rate
FLASH50          312                  7              44.6
WELCOME10        2,891                89             32.5
SAVE20           1,247                89             14.0
LOYALTY15        1,089                89             12.2

FLASH50's high velocity (44.6/day) suggests urgency tactics work, but sustaining this would mean heavy discounting. WELCOME10's 32.5/day over 89 days shows consistent new customer acquisition—a healthier long-term pattern.

Interpreting Your Results and Optimizing Discount Strategy

Now that you've analyzed revenue, margin impact, AOV effects, and redemption patterns, it's time to synthesize these insights into actionable optimization strategies.

The Discount Performance Matrix

Create a simple 2×2 matrix classifying your discount codes:

High Revenue Impact Low Revenue Impact
Low Margin Cost (<15%) SCALE THESE
Example: WELCOME10
Action: Increase promotion, expand channels
EXPERIMENT
Action: Test higher promotion or increase discount
High Margin Cost (>25%) OPTIMIZE
Example: SAVE20
Action: Test reducing discount or adding minimum order threshold
ELIMINATE
Example: FLASH50
Action: Discontinue or reserve for specific strategic campaigns

Strategic Recommendations by Code Type

WELCOME10 (Scale These Winners)

SAVE20 (Optimize These Performers)

LOYALTY15 (Nurture Strategic Codes)

FLASH50 (Eliminate or Reserve)

Advanced Optimization Tactics

1. Minimum Order Thresholds: Add thresholds to high-performing codes to boost AOV. Test "$20 off orders over $100" instead of "20% off".

2. Time-Limited Activations: Create urgency with expiration dates. FLASH50's velocity shows urgency drives redemptions.

3. Segment-Specific Codes: Create unique codes for email, social, influencer, and paid channels to track performance by acquisition source.

4. Progressive Discounts: Test "10% off your first order, 15% off when you spend $100, 20% off when you spend $200" to maximize both conversion and AOV.

For more sophisticated approaches to promotion testing and analysis, explore how survival analysis techniques can help you understand the time-to-conversion impact of different discount strategies.

Common Issues and Solutions

Issue 1: Insufficient Data for Reliable Analysis

Symptom: You have fewer than 50 redemptions per discount code, making statistical patterns unreliable.

Solution: Extend your analysis period to 90-180 days, or combine similar discount codes (e.g., all "20% off" codes) for aggregate analysis. Wait until codes accumulate more usage before making major strategic decisions.

Issue 2: Discount Codes Not Tracked Consistently

Symptom: Some orders show NULL or missing discount code data even when you know codes were used.

Solution: Review your Shopify checkout settings to ensure discount codes are properly captured. Check if you're using third-party checkout apps that might not pass discount data correctly. For historical data gaps, use order dates and discount amounts to infer which codes were likely used.

Issue 3: Unable to Separate New vs. Returning Customer Impact

Symptom: You can't tell if discount codes are acquiring new customers or just discounting existing ones.

Solution: Add a customer segmentation dimension to your analysis. Classify each order as "first purchase" or "repeat purchase" using the customer_id field and order count. This reveals whether codes like WELCOME10 truly drive new customers or if existing customers are exploiting them.

Issue 4: Seasonal Variations Distorting Results

Symptom: Black Friday or holiday codes massively outperform others, making year-round comparisons difficult.

Solution: Analyze seasonal promotions separately from evergreen codes. Compare year-over-year performance for seasonal codes (Black Friday 2024 vs. 2023) and month-over-month for regular codes. Use the discount analysis service to automatically segment seasonal vs. evergreen performance.

Issue 5: Can't Calculate True Incrementality

Symptom: You don't know how many discounted purchases would have happened anyway at full price.

Solution: This is the hardest question in discount analysis. Create holdout tests where you randomly withhold discount codes from a small percentage of users to establish a control group. Compare conversion rates between those who received codes and those who didn't. This requires more advanced experimentation infrastructure but provides the gold standard for measuring true discount incrementality.

Issue 6: Multiple Codes Per Order

Symptom: Some orders use multiple discount codes (if your platform allows it), making attribution difficult.

Solution: If your Shopify setup allows code stacking, attribute the order to the primary code (typically the first applied or largest discount). Alternatively, track "code combinations" as distinct entities to understand which combinations perform best together.

Automate Your Discount Performance Analysis

While the manual analysis approach outlined in this tutorial provides valuable insights, running these queries repeatedly across dozens of discount codes can become time-consuming and error-prone.

Automate this entire workflow with our Shopify Discount Performance Analysis Tool.

What You'll Get:

Analyze Your Shopify Discounts Now →

Next Steps with Shopify Analytics

Congratulations! You now have a systematic framework for evaluating discount code performance in Shopify. Here's how to continue building on this foundation:

1. Expand Your Analysis Dimensions

Beyond the core metrics covered here, consider analyzing:

2. Implement Continuous Monitoring

Set up weekly or monthly reviews of discount performance. Create a scorecard with these key metrics:

3. Run Structured Experiments

Use your baseline data to design tests:

4. Integrate with Broader Analytics

Connect discount performance to your overall business metrics:

5. Learn Advanced Analytical Techniques

Deepen your data analysis skills with resources like:

6. Explore Full-Service Analysis

If you need deeper insights or lack the time to run manual analyses, consider our managed discount analysis service. We'll provide comprehensive quarterly reviews with strategic recommendations tailored to your business.

Conclusion

Discount code performance analysis is not a one-time exercise—it's an ongoing strategic practice that separates profitable e-commerce businesses from those that compete solely on price. By systematically measuring revenue impact, margin cost, AOV effects, and redemption patterns, you can transform discounts from a necessary evil into a precision tool for growth.

The four-step framework you've learned in this tutorial—revenue analysis, margin calculation, AOV measurement, and redemption tracking—provides a repeatable process for evaluating any promotional strategy. Apply it consistently, and you'll develop an intuitive understanding of which discounts drive profitable growth and which simply erode margins.

Remember: the goal is not to eliminate discounts but to optimize them. Strategic, well-measured discounting can acquire customers, clear inventory, reward loyalty, and drive revenue—when implemented with the discipline of data-driven analysis.

Start your analysis today with the MCP Analytics Shopify Discount Performance Tool and transform your promotion strategy from guesswork to precision.

Explore more: Shopify Analytics — all tools, tutorials, and guides →