One of the biggest leakage points for promotional offers is the gap between “user saw the coupon” and “user actually entered the code at checkout.” Auto-Apply removes that gap entirely: when a visitor was shown a coupon by a Personyze campaign (or any other source), Personyze can drop the code into the checkout coupon field automatically — no copy/paste required.
Built in: coupons that apply themselves
The AI Promotion Coupon designs of a Promotions campaign — Coupon Card, Coupon Bar, the scratch card and the others — have Apply It by Itself, under Customize Look & Feel → Coupon Code. It is on (Yes) by default. When the visitor copies or reveals the code:
- On a Shopify store the code goes into their cart at once, through the store’s own discount link, fetched in the background so they stay on the page. Under the code: Once Applied (“Applied to your cart”).
- On any other store the code is kept for 7 days and put into the coupon field the first time they reach a page that has one — the cart, the checkout, or a cart drawer that opens later — and the store’s Apply button is pressed. Under the code: Applied at Checkout (“It will be applied at checkout”).
Only a field whose name or label says coupon, discount, promo or voucher is filled — never a gift card, email or search box — and only an empty one: a code the visitor typed is left alone. Choose No – they paste it to turn it off.

A redeem link
A promotion or a coupon can carry a Redeem link: your store’s link that applies the code, such as Shopify’s /discount/CODE. The coupon designs show it as an Apply code button (Apply Button in Customize Look & Feel). See Promotions.
A protected code
A store with one real code it does not want published can make it a Protected code: each visitor gets a personal key, and on your cart page Apply my discount appears beside the coupon field and puts the code in without showing it. See Coupon Codes.
When to use this
- Site-wide promotional campaigns where the campaign itself displays the offer (“15% off your first order — applied at checkout”).
- Cart abandonment recovery where you returned a visitor with a discount and want to ensure it actually applies.
- Personalized welcome offers for new visitors or specific audience segments.
- Loyalty / VIP discounts applied silently for known returning customers.
Your own action: HTML or JavaScript
For a coupon shown some other way, or a checkout the built-in way does not reach, build it yourself. The flow has two halves:
- Targeting — Use Personyze audiences to identify visitors who should receive the auto-apply (e.g., “saw the 15% banner in this session,” “is a returning customer,” “abandoned cart in last 7 days”).
- Action — On the checkout page, fire an action that places the coupon code into your checkout’s coupon input. Two implementation options:
Option 1 — HTML Action (placeholder swap)
The simplest approach when your checkout’s coupon input has a stable selector. Use a Personyze HTML Action to target the coupon field’s value attribute (or its surrounding wrapper) and insert the code. This works well for standard checkout templates where the coupon field is in the page from the start.
Option 2 — JavaScript Action
For dynamic checkouts (Shopify-style multi-step flows, React/Vue checkouts that mount the coupon field late), use a JavaScript Action. The script can wait for the field to appear, set the value, and trigger a “change” event so your checkout’s framework sees the update:
// Example: wait for the coupon field, then insert code + trigger validation
var couponCode = 'WELCOME15';
var observer = new MutationObserver(function() {
var input = document.querySelector('input[name="discount"], input[id*="coupon"]');
if (input && !input.value) {
input.value = couponCode;
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
// Optionally click the apply button
var btn = document.querySelector('button[name="apply-discount"]');
if (btn) btn.click();
observer.disconnect();
}
});
observer.observe(document.body, { childList: true, subtree: true });
If you need help adapting this to your specific platform (Shopify, BigCommerce, Magento, custom), reach out to support@personyze.com — we can provide platform-specific snippets.
Best practices
- Always show the coupon visibly first. Auto-applying a code the user never saw can feel weird. Display the offer in a campaign banner or popup, then auto-apply at checkout.
- Confirm visually after applying. Have the action also display a small “Code WELCOME15 applied — you saved $X” message so the user understands what happened.
- Tell the visitor. The coupon designs say so under the code (Once Applied, Applied at Checkout); an action of your own should too.
- Test in a real checkout flow. The visual preview won’t catch issues with the actual form behavior. Use Test Mode in Console with a real product in cart.
- Don’t stack incompatible discounts. If your store doesn’t allow multiple coupons, the auto-apply may silently fail or override an existing one. Audience-target carefully.
Related
- Promotions Campaign — the coupon designs, and Apply It by Itself
- Coupon Codes — the protected code’s Apply my discount
- Promotions — a promotion’s redeem link
- JavaScript Action