> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Repeat Purchase: Track Returning Customer Orders

> Track repeat purchase events from returning customers in your Shopify store. Measure customer loyalty and retention with pixel-tracked order data.

<Tip>
  Repeat Purchase counts the number of purchase events from returning customers — shoppers who have previously completed an order on your Shopify store.
</Tip>

## Formula

<Info>
  **Repeat Purchases** = **COUNT** ( Purchases ) **WHERE** customer\_type = returning\_customer
</Info>

### Formula Components

| Metric                                                                                             | Definition                                                 |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **Purchases**                                                                                      | Total tracked purchase events from the Upstack pixel       |
| [**customer\_type = returning\_customer**](/data-dictionary/measures-and-dimensions#customer-type) | Filters to orders from customers who have purchased before |

| Metadata        |                                                              |
| --------------- | ------------------------------------------------------------ |
| **Type**        | Number                                                       |
| **Data Source** | [Upstack Pixel](/pixel), [Shopify](/sources/catalog/shopify) |
| **Aggregation** | Count                                                        |

***

## Example

Your Shopify store completed **847 total purchases** in March. Of those, **312 were repeat purchases** from returning customers.

| Metric           | Value | Insight                                       |
| ---------------- | ----- | --------------------------------------------- |
| Total Purchases  | 847   | All tracked purchase events                   |
| Repeat Purchases | 312   | Orders from returning customers               |
| Repeat Rate      | 36.8% | Percentage of orders from returning customers |

***

## How It Works

The Upstack pixel tracks purchase events and matches them to known customer identities. When a customer completes their second or subsequent order, it counts as a repeat purchase. This metric pulls order data directly from your Shopify store and cross-references it with identity resolution to determine customer status.

***

## When to Use

| Scenario                           | Action                                                               |
| ---------------------------------- | -------------------------------------------------------------------- |
| Measuring customer loyalty         | Track how many orders come from returning customers vs new customers |
| Evaluating retention campaigns     | Monitor repeat purchase counts after email/SMS retention campaigns   |
| Comparing acquisition vs retention | Balance new customer acquisition spend against retention revenue     |
| Assessing product stickiness       | Higher repeat purchases indicate strong product-market fit           |

***

## Related Metrics

| Metric                  | Relationship                                                      |
| ----------------------- | ----------------------------------------------------------------- |
| Purchases               | Total purchase count including both new and returning customers   |
| New Customer Purchases  | Purchases from first-time customers (inverse of repeat purchases) |
| Session Conversion Rate | Overall conversion rate for all traffic                           |

[See all Conversions metrics →](/reference/metrics/funnel/conversions)
