Promo code triggers — wildcards, privacy & health
How promo-code triggers match under the hood, prefix wildcards, privacy and timing, health warnings, and advanced recipes.
This is the deep companion to Using promo codes as triggers, which covers the basic add-a-code flow. This page documents the mechanics behind that flow, the advanced patterns it unlocks, and the edge cases that trip merchants up. It assumes you already know how to add a Promo Code rule to a condition, so it does not repeat the basic setup steps.
New to promo code triggers? Start with the walkthrough first, then come back here for wildcards, privacy details, and troubleshooting.
How the trigger matches under the hood
When you pick a discount code in a condition rule, the app does not store the code text on your rule. Instead it stores an internal promo code ID — a private reference that points to the code behind the scenes. The discount code text itself lives in a separate, app-side record that maps that ID back to the human-readable code.
At storefront runtime the flow is:
- The shopper applies one or more discount codes to their cart.
- The app's proxy resolves those applied codes back into the matching internal promo code IDs.
- Your Promo Code rule matches against those resolved IDs — not against the raw code text.
This indirection has two practical consequences you can rely on:
- The same code can be reused across many conditions and campaigns. Each rule that references a code keeps its own internal ID, so reusing
SUMMER20in three different campaigns is completely safe — they do not collide or overwrite each other. - Your trigger codes stay out of your page source. Because the rule stores an opaque ID and the matching happens on the server, the actual code text is never written into your storefront's HTML.
Every time you save a campaign that uses promo codes, the app re-syncs these mappings to match exactly what your rules currently say. You never manage the IDs yourself — you only ever pick the discount code by name.
Two matchers
The Promo Code rule supports two matchers. The matcher you choose decides whether one exact code fires the offer or a whole family of codes does.
| Matcher | UI label | What it matches | Best for |
|---|---|---|---|
| Exact code | is equal to | The applied code must be exactly the code you selected. | A single coupon, e.g. one email campaign code. |
| Prefix / wildcard | starts with | Any applied code that begins with the text you enter. | Influencer and affiliate code families, bulk-generated codes. |
Exact code (is equal to)
This is the default behavior most merchants want. The offer fires only when the shopper has applied the specific code you chose — SUMMER20 triggers, SUMMER21 does not.
Prefix wildcard (starts with)
With starts with, you provide a prefix and the offer fires for any applied code that shares it. For example, the prefix INFLUENCER matches:
INFLUENCER_ALEXINFLUENCER_SAMINFLUENCER_2026
This is the right tool for code families you generate in bulk — one rule covers every code that shares the prefix, so you do not have to add a separate rule for each influencer or affiliate.
Prefix matching is case-insensitive — influencer_alex and INFLUENCER_ALEX are treated the same when compared against your prefix.
Behind the scenes, choosing starts with changes how the proxy resolves codes: instead of looking up only exact codes, it runs a prefix (regex) lookup on the server so that any applied code sharing the prefix resolves to your rule and fires the offer. You do not need to register the individual codes in the app — only the prefix.
Keep prefixes specific. Because starts with fires for every code that begins with your text, a short or generic prefix like S or SALE can accidentally catch unrelated codes. Use a distinctive prefix such as INFLUENCER_ or AFF2026_ to avoid over-matching.
Which campaign types support promo codes
The Promo Code data point is only available on three campaign types:
| Campaign type | Promo code trigger available? |
|---|---|
| Gift with Purchase | Yes |
| Auto-Add | Yes |
| Checkout Upsells | Yes |
| All other types | No — the data point is hidden |
If you are editing a campaign of a different type and do not see Promo Code in the data-point list, that is expected — the selector is hidden on campaign types that do not support it. To use a promo code trigger, build it on a Gift with Purchase, Auto-Add, or Checkout Upsell campaign.
Privacy and timing
Promo-code triggers are designed so your codes stay private and your offers fire reliably — but the design also introduces a small delay you should plan for.
Your codes are never exposed
The code text is never written into your storefront's page source. Shoppers cannot read your trigger codes by inspecting the page, because the rule only ever carries the internal ID and the code-to-ID resolution happens on the app's server.
Expect a short round-trip delay
Promo conditions are evaluated on the app's server and proxy — not inside the storefront widget. After a shopper applies a code, there is a brief delay (about one request round trip) before the triggered offer appears while the app resolves the applied codes and re-evaluates the condition. This is normal and is not a sign of a misconfiguration.
Pre-checkout placement only
Promo-code-triggered offers are intended for placements before checkout (cart, product page, drawer), not inside Shopify's checkout extensions. The condition is evaluated through the app's proxy, which checkout extensions do not call, so a promo-code trigger will not reliably fire inside the Shopify checkout page itself. Use it for pre-checkout offers.
Keeping the trigger healthy
A promo-code trigger can only fire if the discount code it points to is still active in Shopify. The app continuously checks this and surfaces problems in two ways.
The campaign list health warning
The app validates the codes referenced by each active campaign against the Shopify Admin API. If a referenced code is no longer usable, a red health warning appears next to the campaign name in the campaign list, with the message:
The promo code
{code}is inactive.
If several codes are inactive, they are all listed comma-separated in a single message — for example The promo code CODE1, CODE2 is inactive. — so a campaign that references several broken codes shows every one of them in that one line.
A disabled or deleted code means the campaign can no longer fire — shoppers who apply that code will not see the offer.
What the validator checks
When the app validates a code against the Shopify Admin API, it can report any of these problems:
| Reported problem | Meaning | Fix |
|---|---|---|
INVALID | The discount code does not exist. | Recreate the code in Shopify, or point the rule at an existing code. |
NOT_FOUND | The code could not be found in the system. | Confirm the code name and that it still exists in Shopify. |
INACTIVE | The discount is no longer active. | Re-enable the discount in Shopify. |
LIMIT_REACHED | The code has hit its usage limit. | Raise or remove the usage limit in Shopify, or switch to a code with capacity. |
How to fix an unhealthy trigger
Open the flagged campaign
In the campaign list, find the campaign showing the red health icon and hover it to read which code is inactive.
Re-enable or replace the code in Shopify
In your Shopify admin, re-enable the discount, or recreate it if it was deleted. If the code hit its usage limit, raise or remove that limit.
Or point the rule at an active code
If you have retired the code for good, open the campaign's conditions and update the Promo Code rule to reference a code that is still active.
Save and re-check
Save the campaign. The health warning clears once the referenced code validates as active. If it does not refresh, use the campaign Sync action to force a re-check.
Always update the campaign whenever you retire a code in Shopify. Disabling or deleting a discount silently breaks every trigger that points to it, and the only visible signal is the red health warning in the campaign list.
For the full list of campaign health warnings and what each one means, see Campaign statuses, limits & health warnings.
Combining promo codes with other rules
A promo-code rule is just one rule inside a condition, so you can combine it with any other data point using AND / OR logic.
- AND a code with a subtotal or product rule to scope the gift — for example, "applied
GIFT50AND cart subtotal is greater than or equal to 50". The offer only fires when both are true. - OR several codes together so that any one of them fires the same offer — useful when one promotion is run under multiple codes.
Within a single rule group, AND requires every rule to match and OR requires at least one. To require a code and a subtotal, put both rules in an AND group. To let several codes fire the same offer, put each code rule in an OR group. See How conditions work for the full AND/OR model.
Recipes
Troubleshooting
The code is applied but the offer does not appear
Work through these in order:
Wait for the server round-trip
Promo conditions are evaluated on the app's server, so give it a moment after the code is applied. The offer appears about one request round trip later.
Confirm the code is active and within its usage limit
Check the campaign list for a red health warning. An INACTIVE, INVALID, NOT_FOUND, or LIMIT_REACHED code cannot fire the offer. Re-enable the code in Shopify or point the rule at an active one.
Force a refresh with Sync
If rules still look out of sync on the storefront, use the campaign Sync action to force a refresh, then re-apply the code and test again.
If you are using starts with, double-check that the applied code actually begins with your prefix (matching is case-insensitive but must still be a true prefix). A typo in the prefix is the most common reason a wildcard family silently fails to fire.
