Vouchers are simple text codes that customers can use in your online store to redeem discounts or other special offers. You can communicate these codes to your customers through your campaigns.

The simplest way to insert a voucher into a campaign would be to use the same code for every customer. However, it is often desirable to send a unique code to every customer. The Vouchers feature allows you to load a pool of vouchers into Exponea, insert them into any campaign, and track their usage.

This guide will explain how to do so, and help you understand the extent of the possibilities offered by this feature.


Please note that this feature is only for showing personalized vouchers to your customers through campaigns and for tracking their use. It does not substitute your voucher system which applies the appropriate reductions when a voucher is used.

Importing Voucher Codes

Importing vouchers is very easy, and similar to importing other kinds of data. A number of data sources can be used - for more information, see Imports . The only thing you need is a pre-generated list of voucher codes, in a single column, with a header. The codes need to be unique. If you try to import a code that is in the pool already, it will be ignored. Once you have the codes:

a. Navigate to Data & Assets -> Imports.

b. Click on the + New Import button in the top-right corner of your screen.

c. Click on the Vouchers button.

d. Select a pre-existing voucher pool to which you wish to add new vouchers codes, or create a new one by typing its name.


It's good practice to group vouchers and name your voucher pools in a manner that's meaningful and easy to identify, such as 10% Discount, 100 EUR off, or by campaign name.

e. Select the data source you wish to use.

f. Click on Preview to double-check the Delimiter and Encoding settings of your import. The preview windows will show you the header and the first five rows.

g. Click on the Next button.

h. Assign the code ID to the column by dragging the blue box. For vouchers, you can only import one column containing the codes. Exponea doesn't support additional features such as voucher expiration, etc.

i. If you are importing from a URL, database or an Exponea analysis, you can schedule a repeated import in the next step.

j. Click on the Run Import button in the bottom-right corner of your screen.

k. Return to Data & Assets -> Imports to view the import and make sure all rows (vouchers) were imported correctly.

You can see all your imported voucher pools in Data & Assets > Vouchers.


Same voucher pools

You cannot import the same voucher code into multiple voucher pools

Using Vouchers

Before using vouchers for the first time, make sure that the use of a voucher for making a purchase - including the voucher code itself - is being tracked.

Go to Project Settings > Mapping > Vouchers and indicate where the voucher code is tracked once used. This will allow Exponea to know when a specific voucher was redeemed. If you, for example, track voucher codes as an attribute of event purchase named "voucher_code", the mapping should look like this:

Vouchers can be accessed via Jinja. The Personalization wizard (see the Personalization in Jinja guide for further details) can help you generate the correct syntax to:

Action Type


Assign available code

This will select an available voucher code from the pool, change its status from available to assigned and display the voucher code in the campaign. The codes are assigned at the time of campaign execution e.g. weblayer being displayed to a customer or email campaign with the code is sent (including test campaigns). There is no limitation to the number of vouchers a customer can be assigned.

Count available codes

This will return the count of currently available codes within a voucher pool.

Count total codes

This will return the overall count of all codes within a voucher pool.

The latter two are useful for reporting purposes, such as sending automation notices through email or webhook when the number of available codes becomes too small.


Assigning available voucher codes

Every time you use the code vouchers['voucher_xy'].assign_available(), it will pull out a new voucher code from the pool, even within an email to the same customer.
In case you need to use the same voucher code twice in the email, you have to use a definition for a variable first: {% set voucher = vouchers['voucher_xy'].assign_available() %} and then you may use the code several times in the email by using {{voucher}}.

To check if and when a voucher was assigned or redeemed, go to Data & Assets > Vouchers and select the Voucher pool.

What happens if you run out of assignable vouchers

Email campaigns

The rest of the campaigns will fail to be sent, generating campaign events with status = enqueue_failed

Web layers

If there are no codes to assign, web layers will not be displayed at all, and will not generate any events.

Updated 10 months ago


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.

We rely on cookies

to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

Manage cookies
Accept & close

Cookies preferences

Accept & close