# How to use coupon codes in OptiMonk campaigns

Canonical URL: https://support.optimonk.com/en/articles/how-to-use-coupon-codes-in-optimonk-campaigns

OptiMonk can show a discount code on your popup, so your visitors get their reward the moment they sign up. You can hand out one fixed code to everyone, or a different, unique code to every visitor.

---

## 1. Prepare your store

First make sure the discount itself exists in your store — otherwise your store will not recognise the code your popup shows. Every platform does this differently; here are their own guides for the most common ones:

- [Shopify](https://help.shopify.com/en/manual/promoting-marketing/discount-codes/create-discount-codes)
- [WooCommerce](https://woocommerce.com/posts/coupons-with-woocommerce/)
- [3dcart / Shift4Shop](https://www.shift4shop.com/lp/features/3dcarts-promotion-coupon-features/)
- [BigCommerce](https://support.bigcommerce.com/s/article/Using-Coupon-Codes)
- [CoreCommerce](https://support.corecommerce.com/support/solutions/articles/43000481581-tiered-discounting-on-select-items-coupon-)
- [OpenCart](http://docs.opencart.com/en-gb/marketing/coupon/)
- [Shopware](https://docs.shopware.com/en/shopware-5-en/marketing-and-shopping-worlds/vouchers)

*💡 On a connected Shopify store you can skip this step — OptiMonk can check and even create the discount for you. See Coupon codes in OptiMonk — additional features for Shopify users.*

---

## 2. Ask for a coupon popup

There is no template to pick. Say what you want in the chat — *"a welcome popup with 10% off for first-time visitors"* — and the concepts you get back already contain a coupon box, usually on the thank-you step shown after the signup.

If you did not ask for one, you can add it later in the chat: *"add a coupon code element"*.

---

## 3. Set the code while you create the campaign

After you pick a design, the plan walks you through a few short steps, and one of them is **Coupon** (*shown on step 2, after the signup*).

- The code read from the design is already filled in — change it here and the thank-you step is drafted with your final code.
- Pick the type: **Fixed code** (*Every visitor sees the same code.*), **Unique codes** (*One campaign-level pool (uploadable after create).*) or, on a connected Shopify store, **Shopify coupon** (*A single-use code is generated in Shopify.*)
- If you are running an A/B test with more than one coupon design, you can choose **Same coupon** (the same type and code for every variant) or **Different per variant**.

---

## 4. Change the coupon on a built popup

Once the popup exists, its coupon settings live in the editor:

1. Open the campaign, open the design, and click **Drag & drop editor**.
2. Click **Coupon** in the top bar. The **Coupon code** panel opens (*type, code pool, fallback*).

*💡 The code cannot be typed over directly on the canvas. The editor says why: an emptied or mistyped code would go live unnoticed — so it is set here instead. You can also ask for it in the chat: "change the coupon to XY".*

If your popup hands out more than one coupon, the panel lists them all under **Coupon codes (n elements)**, each with its own field.

---

## 5. Hand out unique codes

Choose **Unique codes** (*Every visitor gets their own code from the uploaded pool.*) and each visitor is served a different code from a list you upload.

1. Under **Code pool**, paste your codes into the box — *separated by commas, spaces or line breaks* — or use **.txt / .csv upload** to load a file.
2. The panel counts them for you: *n codes in the list*.
3. Once saved, the pool shows its live state: **Available**, **Reserved** and **Handed out**.

*💡 The list overwrites the whole available pool; codes currently reserved are kept. And remember: these codes have to exist in your store too.*

### What happens when the codes run out

Under **When the codes run out** you decide:

- **Don't show the campaign** — the popup stops appearing rather than showing an empty box.
- **Show a text instead of the code** — with your own message, for example *The coupons ran out :(*

If you pick Unique codes but upload nothing, the panel warns you: *No codes uploaded — the campaign won't show up at all.*

---

## 6. Save and publish

1. Press **Save** in the coupon panel.
2. Press **Save & Exit** in the editor.
3. If the campaign is not live yet, publish and activate it. If it is already live, saving pushes the new creative to it.

---

## Things the panel will tell you

- *The coupon code can't be empty — with an empty code the visitor sees an empty coupon box and the copy button copies nothing.*
- *No code on: <views>. There the visitor sees an empty coupon box — enter the code and save.* — fill the code in on the other view too.
- *There is no coupon-code element on the popup, so the settings can't be saved.* — ask in the chat to add one.

---

## Additional features for Shopify users

Connected Shopify stores get more: OptiMonk can look up and create the discount for you, generate a unique single-use code per visitor with a prefix and an expiry, and apply the discount automatically at checkout. See Coupon codes in OptiMonk — additional features for Shopify users.
