Using promo codes as triggers
Trigger a campaign when a shopper applies a specific discount code to their cart.
You can use an applied discount code as a campaign condition, so an offer only fires when a shopper enters a specific promo code at the cart. This is a great way to reward customers who arrive through a coupon, an influencer code, or an email campaign with a matching upsell or gift.
How a promo code trigger works
A campaign pairs an offer (the products you want to recommend or add) with conditions (the rules that decide when that offer shows up). The Promo Code condition is one of the data points you can build a rule on — alongside things like cart subtotal, products in the cart, collection membership, and customer tags.
When you choose the promo code condition, the rule checks the discount codes the shopper has applied to their cart. As soon as a matching code is applied, the cart satisfies the condition and your offer fires.
The promo code condition reads codes the shopper has actually applied to their cart — it does not generate or validate discounts on its own. Create the discount code in Shopify first, then reference it here.
Add a promo code condition
Open your campaign
Create a new campaign or open an existing one, then go to its conditions.
Add a rule for the discount code
In the condition's rule group, choose Promo Code as the data point and enter the discount code the shopper must apply for the offer to fire.
Choose how the code is matched (optional)
By default the rule looks for an exact code with the Equals matcher. If you run a family of related codes that share a prefix — for example INFLUENCER-AVA, INFLUENCER-BEN — switch the matcher to Starts with so a single rule catches every code in the family.
Combine with other rules (optional)
Each condition is made up of rule groups joined by AND or OR logic. You can require the promo code and another rule — for example, a code plus a minimum cart subtotal — or use OR so any one of several codes triggers the offer.
Save and activate
Save the campaign and set it to active. Only active campaigns are served to shoppers.
Going further. This page covers the basic setup. For prefix and wildcard code families with Starts with, how the privacy and evaluation mechanics work in detail, validating that a code is healthy, and ready-made recipes, see Advanced promo-code triggers.
Combine the trigger with scheduling and targeting
A promo code trigger works alongside the campaign's other targeting settings. On any campaign you can also set:
- Date range — the campaign only fires between a start and end date and time.
- Markets — the campaign only fires for customers in selected Shopify markets.
- Customer tags — restrict the campaign to logged-in customers with specific tags.
Pair these with a promo code trigger to run, for example, a code-gated offer that is only live during a sale window or only for a specific market.
What shoppers see
Because the offer is tied to the applied code, there are a couple of behaviors worth knowing:
- A short delay is normal. Promo code conditions are evaluated on the app's server, not in the storefront widget itself. There is a brief delay between when a shopper applies a code and when the triggered offer appears — about one request round trip.
- The code stays private. The discount code you set as a trigger is never written into your storefront's page source, so shoppers cannot read your trigger codes by inspecting the page.
Promo-code-triggered campaigns are evaluated through the app's proxy. They are not read directly by Shopify's checkout extensions, so this trigger is intended for offers that appear before checkout rather than inside the checkout page.
Keep your trigger healthy
The app checks each active campaign for issues and shows a warning icon in the campaign list if a promo-code trigger references a disabled discount code. When a referenced code is no longer active, the health tooltip reads 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 you can see exactly which codes to fix. If you see this warning:
- Confirm the discount code still exists and is enabled in Shopify.
- Re-enable the code, or update the campaign to reference an active code.
If the discount code referenced by your trigger is disabled or deleted in Shopify, the campaign can no longer fire. Update the campaign whenever you retire a code.
If the offer does not appear
If a shopper applies the code but the offer does not show, first allow a moment for the server to evaluate the condition. If rules still appear out of sync on the storefront, use the Sync action on the campaign to force a refresh, then test again.
Related
Targeting by schedule, market & customer tags
Overview of the three campaign-level targeting filters — schedule, markets, and customer tags — with links to the in-depth guides.
Promo code triggers — wildcards, privacy & health
How promo-code triggers match under the hood, prefix wildcards, privacy and timing, health warnings, and advanced recipes.
