# Margin-based display rules for Extensions

How to show an upsell only when the cart is profitable

May 13, 2025

## Overview

With costs climbing and squeezing profit margins, it’s no longer enough to simply drive more orders—you need to drive **profitable** orders. Margin‑based rules let you do exactly that.

By attaching a gross‑margin condition to any PDQ Checkout Extension, you can automatically hide discounts, upsells, or shipping incentives when the cart isn’t profitable, and show them when it is.

Protect your margins while still delivering a high‑conversion checkout experience.

* * *

## Why use margin‑based rules?

|     |     |
| --- | --- |
| **Benefit** | **What it means for you** |
| **Safeguard profit** | Prevent discounts or freebies from appearing on low‑margin carts. |
| **Smarter incentives** | Offer free shipping or gifts only when there’s money to spare. |
| **Profit‑aware personalization** | Combine margin conditions with segmentation, A/B tests, and delivery rules (shipping‑method support coming soon). |

* * *

## How it works

1. PDQ pulls **Cost** and **Price** data from Shopify for every product in the cart.
2. We aggregate that data at the cart level to calculate **Gross Margin ($)** and **Gross Margin (%)**.
3. Your chosen extension will render _only_ if the cart’s margin meets the thresholds you set.

**Formula**  
​ _Gross Margin ($) = Cart Subtotal - Product Costs_
  
​ _Gross Margin (%) = (Gross Margin $ / Cart Subtotal) × 100_

* * *

## Set up a margin‑based rule

1. **Open the PDQ Admin → _Extensions_.**
2. Click the extension you want to control (e.g., _Gift Unlock_ or _Checkout Upsell_).
3. Scroll to **Display Conditions** and click **\+ Add rule**.
4. In the first dropdown, choose **Gross margin**.
5. Select **is greater than / equals / is less than** as needed.
6. Enter your target value and choose **%** or **$**.
7. Save changes and publish.

## Example: Free gift only when margin ≥ 25 %

|     |     |
| --- | --- |
| **Step** | **Setting** |
| **Rule** | **Gross margin (%), is greater than or equal, 25, %** |
| **Result** | _Gift Unlock_ extension appears only when the cart’s profit margin is 25 % or higher. |

* * *

## Best practices

- **Start with %, then fine‑tune $**: Percentage thresholds scale naturally with cart size; use $ to cap absolute profit targets.
- **Test before rolling out:** Spin up an A/B test (margin‑rule vs. no‑rule) to measure impact on net profit and AOV.
- **Combine with customer tags:** Exclude VIPs from profit protections to keep the experience friction‑free.

* * *

## Frequently Asked Questions

**Q: Does PDQ include shipping costs in the margin calculation?**  
_A:_ Not yet. Margin is calculated using product cost and price data only. Shipping‑cost‑aware rules are on the roadmap.

**Q: What happens if cost data is missing in Shopify?**  
_A:_ We’ll treat those items as $0 cost, which may inflate margin. We recommend auditing missing cost fields before relying on the rule.

**Q: Can I see margin values live in the order timeline?**  
_A:_ Yes—gross margin ($ and %) appear under the _Profitability_ card once an order is placed.

* * *

## What’s next

- **Shipping Method rules** – Auto‑show free shipping only on profitable carts.
- **Checkout Segments** – Target high‑margin shoppers with VIP offers.
- **A/B Tests** – Compare different margin thresholds side‑by‑side.

* * *

## Need help?

Our team is happy to walk you through setup just let us know.

* * *
