How to Use Item Quantity and Basket Analysis in WooCommerce: Step-by-Step Tutorial

Published by MCP Analytics | Category: WooCommerce Analytics

Introduction to Item Quantity and Basket Analysis

Understanding what customers buy together and in what quantities is crucial for optimizing your WooCommerce store's performance. Item quantity and basket analysis reveals purchasing patterns that can dramatically improve your revenue through better product placement, bundling strategies, and targeted cross-selling.

In this comprehensive tutorial, you'll learn how to analyze your WooCommerce order data to answer critical business questions: What's the typical basket size in your store? Which products are frequently purchased together? Are there opportunities for product bundles that customers are already creating organically?

Unlike traditional analytics that focus solely on individual product performance, basket analysis examines the relationships between products and the aggregate behavior of your customers. This approach, similar to techniques used in AI-first data analysis pipelines, provides actionable insights that can transform your store's profitability.

Prerequisites and What You'll Need

Before You Begin

To successfully complete this tutorial, you'll need:

Required Data Fields

Your export should include these essential fields:

Step 1: Understanding Item Quantity and Basket Analysis Fundamentals

Before diving into the data, it's essential to understand what basket analysis can reveal about your store:

Key Metrics You'll Discover

Average Basket Size

This metric tells you how many items, on average, customers purchase per transaction. A higher basket size often correlates with better customer engagement and higher lifetime value.

Example: If your average basket size is 2.3 items, you know that most customers buy between 2-3 products per order. This benchmark helps you set realistic goals for increasing basket size through bundling or promotions.

Product Affinity

Product affinity measures how often products appear together in the same order. High affinity between two products suggests a natural bundling opportunity.

Basket Size Distribution

Understanding the distribution of basket sizes (how many customers buy 1 item vs. 2 items vs. 5 items) helps you identify customer segments and tailor marketing strategies accordingly.

Why This Analysis Matters

Step 2: Exporting Your WooCommerce Order Data

The quality of your analysis depends entirely on the quality of your data export. Follow these steps to ensure you capture all necessary information:

Method 1: Using WP All Export (Recommended)

  1. Install WP All Export: Navigate to Plugins → Add New in your WordPress admin panel and search for "WP All Export"
  2. Create New Export: Go to All Export → New Export
  3. Select WooCommerce Orders: Choose "WooCommerce Orders" as your export type
  4. Configure Field Mapping: Add the required fields listed in the prerequisites section

Sample Export Configuration

Export Template:
- Order ID: {order_id}
- Product ID: {line_item_product_id}
- Product Name: {line_item_name}
- Quantity: {line_item_quantity}
- Order Date: {order_date}
- Order Total: {order_total}
- Order Status: {order_status}

Filters:
- Order Status: Completed
- Date Range: Last 12 months (or your preferred timeframe)

Method 2: Direct Database Query

If you have database access, you can export data directly using SQL. This method is faster for large datasets:

SELECT
    orders.id AS order_id,
    order_items.product_id,
    order_items.order_item_name AS product_name,
    order_item_meta.meta_value AS quantity,
    orders.post_date AS order_date,
    order_total.meta_value AS order_total
FROM wp_posts AS orders
INNER JOIN wp_woocommerce_order_items AS order_items
    ON orders.id = order_items.order_id
INNER JOIN wp_woocommerce_order_itemmeta AS order_item_meta
    ON order_items.order_item_id = order_item_meta.order_item_id
LEFT JOIN wp_postmeta AS order_total
    ON orders.id = order_total.post_id
    AND order_total.meta_key = '_order_total'
WHERE orders.post_type = 'shop_order'
    AND orders.post_status = 'wc-completed'
    AND order_item_meta.meta_key = '_qty'
ORDER BY orders.post_date DESC;

Data Validation Checklist

Before proceeding, verify your export:

Expected Output

Your CSV file should look like this:

order_id,product_id,product_name,quantity,order_date,order_total
1001,234,"Organic Coffee Beans",2,2024-01-15,45.99
1001,567,"French Press",1,2024-01-15,45.99
1002,234,"Organic Coffee Beans",1,2024-01-16,28.50
1002,890,"Coffee Grinder",1,2024-01-16,28.50
1003,567,"French Press",1,2024-01-16,19.99

Step 3: Uploading and Running the Analysis

Now that you have your data properly formatted, it's time to analyze it using the MCP Analytics platform:

Upload Your Data

  1. Navigate to the WooCommerce Item Quantity Analysis tool
  2. Click "Upload Data" or drag and drop your CSV file
  3. Verify that the column mapping is correct (the system will auto-detect most fields)
  4. Confirm that your data preview looks accurate

Configure Analysis Parameters

The analysis engine offers several configuration options to tailor the results to your needs:

Time Period Settings

Threshold Settings

Minimum Support Threshold: 0.01
(Products must appear in at least 1% of orders)

Minimum Confidence Threshold: 0.20
(Co-occurrence must happen in at least 20% of cases)

Maximum Basket Size: 10
(Filter out unusually large bulk orders if needed)

Run the Analysis

Click "Analyze" to process your data. Depending on the size of your dataset, this may take 30 seconds to a few minutes. The system will generate multiple visualizations and statistical reports.

What's Happening Behind the Scenes

The analysis engine applies advanced techniques similar to those described in ensemble learning methods to identify patterns:

Step 4: Interpreting Your Results

Once the analysis completes, you'll receive a comprehensive report with multiple sections. Here's how to interpret each component:

Basket Size Distribution

This chart shows how many items customers typically purchase per order:

Example Output:

Basket Size | Percentage of Orders | Cumulative %
1 item      | 35%                  | 35%
2 items     | 28%                  | 63%
3 items     | 18%                  | 81%
4 items     | 10%                  | 91%
5+ items    | 9%                   | 100%

Average Basket Size: 2.4 items
Median Basket Size: 2 items

Key Insights:

Product Affinity Matrix

This section reveals which products are frequently purchased together:

Example Output:

Product A              | Product B          | Co-occurrence | Confidence | Lift
Organic Coffee Beans   | French Press       | 15%          | 45%        | 3.2
Organic Coffee Beans   | Coffee Grinder     | 12%          | 36%        | 2.8
French Press           | Coffee Filters     | 8%           | 28%        | 2.1
Yoga Mat               | Yoga Blocks        | 22%          | 65%        | 4.5

Understanding the Metrics:

Actionable Insights:

In the example above, customers who buy "Organic Coffee Beans" purchase a "French Press" 45% of the time. This is a strong signal to:

Quantity Patterns

Understanding how many units of each product customers buy helps with inventory and pricing:

Example Output:

Product Name           | Avg Qty/Order | Most Common Qty | % Buying Multiple
Organic Coffee Beans   | 2.1           | 2               | 65%
French Press           | 1.0           | 1               | 5%
Coffee Filters (50pk)  | 1.8           | 2               | 55%

Strategic Applications:

Temporal Patterns

The analysis also reveals how basket behavior changes over time, helping you identify seasonal trends and the impact of marketing campaigns.

Step 5: Applying Insights to Optimize Your Store

Analysis is only valuable when you take action. Here's how to implement your findings:

1. Create Product Bundles

Based on high-affinity product pairs, create curated bundles:

// Example: WooCommerce product bundle setup
1. Install "WooCommerce Product Bundles" plugin
2. Create new product: "Coffee Enthusiast Starter Kit"
3. Add components:
   - Organic Coffee Beans (Qty: 2)
   - French Press (Qty: 1)
   - Coffee Grinder (Qty: 1)
4. Set bundle price: $89 (vs $105 individual = 15% savings)
5. Configure bundle discount: "Save $16 when purchased together"

2. Optimize Product Recommendations

Update your "Related Products" and "You May Also Like" sections based on actual affinity data rather than categories alone:

// Example: Custom recommendation logic
Product Page: Organic Coffee Beans
Recommended Products (by affinity score):
1. French Press (Lift: 3.2) - "45% of customers also bought this"
2. Coffee Grinder (Lift: 2.8) - "Perfect companion for fresh beans"
3. Coffee Filters (Lift: 2.1) - "Complete your coffee setup"

3. Implement Dynamic Discounting

Encourage basket growth with smart discount rules:

4. Refine Email Marketing

Use affinity data to create targeted email campaigns:

Scenario: Customer purchased Organic Coffee Beans but not French Press

Email Template:
"We noticed you recently purchased our Organic Coffee Beans. Did you know that 45% of our customers also enjoy brewing with our French Press? Here's an exclusive 20% discount to complete your coffee experience..."

5. Inventory Optimization

Stock complementary products proportionally:

If Coffee Beans and French Press have 45% co-occurrence:
- For every 100 bags of coffee beans ordered
- Plan to stock ~45 French Presses
- Adjust based on existing French Press standalone sales

Measuring Success

After implementing changes, track these metrics:

Re-run your analysis monthly to track improvements and identify new opportunities. Consider using A/B testing methodologies to validate the impact of specific changes.

Ready to Discover Your Store's Hidden Patterns?

You've learned the fundamentals of item quantity and basket analysis, but the real insights are waiting in your own data. Don't leave revenue on the table by guessing what your customers want—let the data guide your decisions.

Start Your Free Analysis Today

Upload your WooCommerce order data to the MCP Analytics platform and discover:

  • Which products are purchased together most frequently
  • Optimal bundle combinations for maximum revenue
  • Customer segments based on basket behavior
  • Seasonal trends and purchasing patterns

Launch Item Quantity Analysis Tool →

The analysis takes less than 5 minutes to set up, and you'll have actionable insights within minutes. Join hundreds of WooCommerce store owners who have increased their average order value by 15-30% using data-driven basket optimization.

Next Steps and Advanced Techniques

Expand Your Analysis

Once you've mastered basic basket analysis, consider these advanced approaches:

1. Customer Segmentation

Analyze basket patterns by customer segment (new vs. returning, high-value vs. low-value) to create personalized experiences.

2. Temporal Analysis

Examine how basket composition changes by day of week, season, or in response to marketing campaigns.

3. Sequential Pattern Mining

Go beyond single-order analysis to understand the sequence of purchases across multiple orders (what do customers buy on their second order after buying Product X first?)

4. Price Sensitivity Analysis

Combine basket analysis with pricing data to understand how discounts affect product combinations and basket size.

Related Resources

Join the Community

Connect with other data-driven store owners, share insights, and learn advanced techniques in the MCP Analytics community forum.

Troubleshooting Common Issues

Problem: "No significant product affinities found"

Cause: Dataset too small or highly fragmented product catalog

Solutions:

Problem: "Export file too large to upload"

Cause: Dataset exceeds platform limits (typically 50MB)

Solutions:

Problem: "Inconsistent or missing product names"

Cause: Product variations or database encoding issues

Solutions:

// Clean data before upload using spreadsheet formulas
1. Remove special characters: =SUBSTITUTE(A2,CHAR(160)," ")
2. Standardize case: =PROPER(A2)
3. Remove leading/trailing spaces: =TRIM(A2)
4. Consolidate variations: Find/Replace "Coffee - Organic" → "Organic Coffee"

Problem: "Lift scores seem incorrect or counterintuitive"

Cause: Misunderstanding of lift calculation or insufficient sample size

Understanding:

Problem: "Analysis results change dramatically between runs"

Cause: Small sample size or highly volatile purchasing patterns

Solutions:

Problem: "Can't connect export plugin to database"

Cause: Database permissions or hosting restrictions

Solutions:

Getting Additional Help

If you encounter issues not covered here:

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