The standard Vouchers (Unique Codes) feature attaches only one code pool to a single message. To send two distinct codes (for example, one for a discount and one for free delivery) to the same user in one notification, store the codes as Tags (personalized user data) instead of using a dynamic voucher pool.
Here is how to set this up:
Step 1: Create Tags
Go to Audience → Tags and create new String tags to hold the code values, for example Campaign_Code_1 and Campaign_Code_2. Only tags that already exist can be filled in by a CSV import.
Step 2: Assign the Codes (CSV Upload)
Prepare a CSV file where you pre-assign the specific codes to your users. The first column must contain the HWIDs of the target devices; every other column must be named exactly as the tag it fills.
"HWID", "Campaign_Code_1", "Campaign_Code_2"
"6e7a0d1e...c94", "FOOD-ABC", "DELIVERY-XYZ"
"1b3f88a2...07d", "FOOD-DEF", "DELIVERY-UVW"
Upload the file via Audience → Import CSV → Update Tag values: press Upload CSV, select the columns to import and press Start import. Rows whose HWID is not registered for the selected project are skipped.
If you work with User IDs rather than HWIDs, set the same tags from your backend with the /setTags method, passing userId instead of hwid.
Step 3: Insert the Tags into the Message
In your push or email content, insert the tags with the Personalization button. Tag placeholders are Liquid objects in double curly braces:
Example: "Here is your surprise! Use code {{Campaign_Code_1}} for the meal and {{Campaign_Code_2}} for free delivery."
When the message is sent, each placeholder is replaced with the value uploaded for that user. Users with an empty tag value receive an empty placeholder, so make sure every targeted user has both codes assigned — or add a fallback with the Liquid default filter, for example {{Campaign_Code_1 | default: "N/A"}}.
Comments
0 comments
Please sign in to leave a comment.