Ability to add a coupon/code to a form



Just wondering if there’s a way to add an option for customers to insert a code/coupon to be able to enter a competition?


First Name:
Last Name:
Code: e.g. promo (you must enter the correct code to enter)



Hi Bruce,

In your example, would the Code/Coupon always be the same value or each visitor would have their own, unique code?



Hi Hristian

Yes is would be the same value for everyone e.g. “promo”



Hi Bruce,

Thank you for the clarification.

You have a couple of options:

  1. Write a bit of JS code that would check if the entered coupon matches. If it matches, it would validate the field and allow you to submit the form. If it doesn’t match, it can display an error/warning informing you that you’ve entered an invalid code or something along those lines.
  • This solution is easier to implement but since it’s a front-end solution, it’s not the most secure one. Visitors with enough technical background can check the source code of the page and figure out what the code needs to be.
  1. Back-end script that you would ping each time the coupon field is filled in. Again either allowing the form submission or not.
  • Harder to implement but offers greater security.

It all comes down to how important security it is for you and your campaign. If your campaign won’t be affected negatively by a few people looking up the code in the source code of the page, then my suggestion is to go with option 1.

Either way, both of these options would need to be custom coded to your specifications so I’m afraid I don’t have a ready-made solution I can share.
However, my agency has developed dozens of custom solutions for Unbounce so if you need a quote DM me.