> For the complete documentation index, see [llms.txt](https://responsive-media.gitbook.io/advanced-free-shipping/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://responsive-media.gitbook.io/advanced-free-shipping/conditions-customer/customer-order-count.md).

# Customer Order Count

## Overview

The **Customer Order Count** condition applies discounts based on how many orders a customer has completed. This is perfect for first-time customer incentives, loyalty rewards, and repeat customer programs.

{% hint style="info" %}
**Important**: This condition works for BOTH logged-in customers AND guests! Shopify tracks order count even for guest checkouts using email address.
{% endhint %}

## Available Operators

* **Is equal to**: Customer has exactly this many orders.
* **Is less than**: Customer has fewer than this many orders.
* **Is greater than**: Customer has more than this many orders.
* **Is at most**: Customer has this many orders or fewer.
* **Is at least**: Customer has this many orders or more.

## Common Use Cases

### First-Time Customer Free Shipping

**Free shipping for first-time customers**

**Configuration**:

* Condition: Customer order count **is equal to** 0
* Discount: Free shipping

**Use case**: Encourage first purchases with free shipping.

{% hint style="info" %}
Order count = 0 means this is their first order. The count increases AFTER the order is completed.
{% endhint %}

### Repeat Customer Reward

**Free shipping for customers with 5+ orders**

**Configuration**:

* Condition: Customer order count **is at least** 5
* Discount: Free shipping

**Use case**: Reward loyal repeat customers.

### Second Purchase Incentive

**Discount for second-time buyers**

**Configuration**:

* Condition: Customer order count **is equal to** 1
* Discount: Free shipping

**Use case**: Encourage customers to come back after their first purchase.

### New Customer Threshold

**Free shipping for customers with fewer than 3 orders**

**Configuration**:

* Condition: Customer order count **is less than** 3
* Discount: Free shipping

**Use case**: Help new customers get comfortable with your store.

## Order Count Logic

### How Counting Works

```
Order 1 (current checkout): count = 0 → First-time customer
Order 2 (current checkout): count = 1 → Second purchase
Order 3 (current checkout): count = 2 → Third purchase
Order 10 (current checkout): count = 9 → Tenth purchase
```

{% hint style="info" %}
The count represents COMPLETED orders. The current order being placed is not yet counted.
{% endhint %}

### Guest Customers

Order count works for guests because Shopify tracks by email address:

* Guest uses `customer@example.com` for order 1 → count = 0
* Same guest uses `customer@example.com` for order 2 → count = 1
* Works even if they never create an account!

{% hint style="info" %}
This is a huge advantage over customer tags, which only work for logged-in customers.
{% endhint %}

## Examples by Strategy

{% tabs %}
{% tab title="First-Time Customer Welcome" %}
**Goal**: Convert first-time visitors

**Configuration**:

* Customer order count **is equal to** 0
* Discount: Free shipping

**Message**: "Welcome! Enjoy free shipping on your first order."
{% endtab %}

{% tab title="Loyalty Progression" %}
**Goal**: Reward increasing loyalty

**Discount 1** (New customers):

* Order count **is equal to** 0
* Discount: $5 off shipping

**Discount 2** (Repeat customers):

* Order count **is at least** 3
* Discount: Free shipping

**Discount 3** (VIP customers):

* Order count **is at least** 10
* Discount: Free express shipping
  {% endtab %}

{% tab title="Win-Back Campaign" %}
**Goal**: Re-engage customers who've ordered before

**Configuration**:

* Order count **is at least** 1
* Active dates: Limited time
* Discount: Free shipping

**Message**: "We miss you! Free shipping for returning customers."
{% endtab %}

{% tab title="Exclusive for Veterans" %}
**Goal**: Reward most loyal customers

**Configuration**:

* Order count **is at least** 20
* Discount: Free shipping + free express upgrade

**Message**: "Thank you for your loyalty!"
{% endtab %}
{% endtabs %}

## Combining with Other Conditions

### Order Count + Value

**First-time customers get free shipping at lower threshold**

* Rule Group 1 (First-time):
  * Order count **is equal to** 0
  * Cart total **is at least** $30
* Rule Group 2 (Repeat):
  * Order count **is at least** 1
  * Cart total **is at least** $50

### Order Count + Tags

**Automatic VIP upgrade for high-order-count customers**

* Condition 1: Order count **is at least** 10
* Condition 2: Customer tag **contains** VIP
* Discount: Always free shipping

{% hint style="info" %}
Use Shopify Flow to automatically tag customers when they hit certain order counts.
{% endhint %}

### Order Count + Product

**First-time customers get free shipping on starter products**

* Condition 1: Order count **is equal to** 0
* Condition 2: Collection **contains** "Starter Kit"

### Order Count + Location

**First-time US customers get free shipping**

* Condition 1: Order count **is equal to** 0
* Condition 2: Country **is one of** US

## Operator Examples

{% tabs %}
{% tab title="Is equal to (=)" %}
**Exact order count**

```
Order count is equal to 0
```

* 0 orders (first purchase) → ✓ Matches
* 1 order → ✗ No match
* 5 orders → ✗ No match

**Use for**: First-time customers, specific milestones
{% endtab %}

{% tab title="Is at least (≥)" %}
**Minimum order count**

```
Order count is at least 5
```

* 0 orders → ✗ No match
* 4 orders → ✗ No match
* 5 orders → ✓ Matches
* 10 orders → ✓ Matches

**Use for**: Loyalty rewards, repeat customer benefits
{% endtab %}

{% tab title="Is less than (<)" %}
**Below threshold**

```
Order count is less than 3
```

* 0 orders → ✓ Matches
* 2 orders → ✓ Matches
* 3 orders → ✗ No match
* 5 orders → ✗ No match

**Use for**: New customer programs
{% endtab %}

{% tab title="Is greater than (>)" %}
**Above threshold**

```
Order count is greater than 10
```

* 5 orders → ✗ No match
* 10 orders → ✗ No match
* 11 orders → ✓ Matches
* 20 orders → ✓ Matches

**Use for**: Exclusive veteran customer rewards
{% endtab %}
{% endtabs %}

## Best Practices

{% hint style="info" %}
**Start with first-time customers.** Order count = 0 is the most powerful use case. First-time customer incentives drive significant conversion.
{% endhint %}

{% hint style="info" %}
**Create loyalty tiers.** Use multiple discounts with increasing benefits: 0 orders, 5+ orders, 10+ orders, 20+ orders.
{% endhint %}

{% hint style="info" %}
**Combine with tags.** Use order count to trigger automatic tagging (via Shopify Flow), then use tags for more complex logic.
{% endhint %}

{% hint style="info" %}
**Test with guest checkout.** Verify the discount works for guests using the same email address multiple times.
{% endhint %}

{% hint style="warning" %}
**Different email = different count.** If a customer uses multiple email addresses, each email has its own order count.
{% endhint %}

## First-Time Customer Strategies

The most common use of this condition:

### Strategy 1: Pure First-Time Discount

```
Order count = 0 → Free shipping
```

Simple and effective. All first-time customers get free shipping.

### Strategy 2: First-Time with Threshold

```
Order count = 0 AND cart total ≥ \$30 → Free shipping
```

Encourages first-time customers to reach a minimum order value.

### Strategy 3: First-Time OR High Value

```
Rule Group 1: Order count = 0
Rule Group 2: Cart total ≥ \$75
→ Free shipping
```

First-time customers always qualify, OR anyone spending $75+.

### Strategy 4: First-Time Exclusive Products

```
Order count = 0 AND collection contains "First-Time Bundle"
→ Free shipping
```

Promote specific starter products to new customers.

## Troubleshooting

<details>

<summary>Discount not applying to first-time customer</summary>

* Verify order count condition is set to "is equal to 0"
* Check if customer has previous orders with that email
* Confirm customer hasn't created an account with prior orders
* Test in Test Mode with a new email address

</details>

<details>

<summary>Repeat customer not getting discount</summary>

* Check the order count threshold
* Verify customer's actual order count in Shopify admin
* Ensure they're using the same email address
* Confirm previous orders were completed (not cancelled)

</details>

<details>

<summary>Guest checkout not working</summary>

* This should work automatically - Shopify tracks by email
* Verify the email address is the same across orders
* Check if other conditions are blocking the discount

</details>

## Related Conditions

* [**Customer Tags**](/advanced-free-shipping/conditions-customer/customer-tags.md): Combine with tags for advanced loyalty programs
* [**Cart Total**](/advanced-free-shipping/conditions-cart-and-order/cart-total.md): Add value thresholds to order count discounts
* [**Has Subscription**](/advanced-free-shipping/conditions-cart-and-order/has-subscription.md): First-time subscription customer incentives
* [**Product in Cart**](/advanced-free-shipping/conditions-products/product-in-cart.md): First-time customer product bundles


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://responsive-media.gitbook.io/advanced-free-shipping/conditions-customer/customer-order-count.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
