How to add metadata (custom attributes) to Voucherify objects?

In this section:

  1. Create a metadata - schema validation
  2. Create a campaign with schema validation
  3. Invoke redemption
  4. Target specific segments

What is metadata? πŸ€”

Metadata enables you to add custom data to Voucherify, which you can later use for building validation rules and reporting/ tracking.  Every object type like:

  • voucher
  • campaign
  • customer
  • product
  • SKU
  • redemption
  • publication
  • order
can have some attributes that are not built-in by default but you need them to customize promo campaigns. For example, you can add custom attributes to your customers, and segment them accordingly to attributes unique for your business model (e.g. base your customer segment on ice cream flavor preferences of your customers) πŸ¨
Moreover, metadata added to redemption object enables you to create limits for redemptions which are not possible with built-in validation rules. For example, taxi companies very often offer promo codes for rides booked at particular hours, redemption metadata enables them to create redemption rules based on the time when the ride happens (redemption) and time when it was booked (custom metadata attribute) πŸš•
There are plenty of use cases for metadata and each of them is unique. They give you extreme flexibility and freedom in creating rules and limits for promotions and segmentation of your customers. You can see some videos with metadata use cases here.
Let's take a look at Metadata Schema and learn how to create metadata attributes for Voucherify objects.

Add metadata with Metadata Schema βž•

Metadata Schema allows you to take care of the integrity of your metadata. This is achieved by enabling administrators to set a type of each metadata field and to define if it’s optional or not. The schema works for every object type:

  • campaign
  • voucher
  • customer
  • SKU
  • product
  • redemption
  • publication
  • order

⚠️Only Administrator can access and modify the validation scheme 


Create metadata - schema validation 

Let's see an example of the schema validator. We're going to add a custom field `affiliate_ID` to all campaign and redemption objects in the project. This way campaigns can have optional metadata of affiliate_ID and redemptions invoked by them will also have proper metadata assigned. This way you can easily track which affiliates bring in the most redemptions.

1

To start with, go to the project settings and find Metadata - Schema section βž‘️

Metadata Schema Overview

2

First, choose Voucherify objects to assign metadata. You can define properties for campaigns, vouchers, publications, redemptions, products, SKUs, customers, and orders.

Choosing objects which metadata will be assigned to

In order to start, click Add new definition.

Adding a new metadata definition

3
In the next step, define a property name and type. Let's use an  affiliate_ID as a property assigned to the project's campaigns and redemptions. 
You can choose between several different property types:

Property types for metadata

Here, you can add some optional length constraints or even set a condition that the metadata property has to be an exact match to the value (or many custom values).

Creating a metadata constraint

πŸ’‘ You can mark the checkbox to set each property as optional. Otherwise, it'll be treated as required. 

When all campaigns' restrictions are in place, SAVE your schema βœ…

8

Now, let's define all redemptions invoked amongst this project by the same affiliate_ID. Just select Redemption objects and repeat the previous step of the tutorial. 

Adding metadata to redemption object

Run a campaign πŸ—οΈ

As a result, while creating a new campaign (by a user assigned to this project) in the 4th step of a campaign creator, there will be a default metadata field with an affiliate_ID. To create a campaign, the user has to put the required property value, set by a project administrator in the validation schema. 

Adding metadata in campaign

Otherwise, the user won't be able to save and generate campaign πŸ˜₯


Invoke redemption 🧝

Additionally, by adding the same restriction to a redemption invoked in the context of this project, a field with the particular affiliate_ID is required for a redemption request to be valid.

Metadata with manual redemption

πŸ’‘If you add properties (definitions/restrictions) to a campaign and a voucher object at once, in the voucher view you'll see a validation schema from a campaign and a voucher section.

Target specific segments πŸ§‘πŸ§”πŸ§“

You can create metadata validation schema for "customer" objects and use it for a later segmentation. By way of example, you can add a membership field to the schema and collect information about membership levels to offer different incentives for different members.

Adding customer metadata

After adding this field, you'll be able to filter out your clients by using a membership field. Later on, you can easily create a segment with customers who meet the criteria defined by schema properties.

Customer segment based on metadata

Watch this short video to see the metadata in action πŸ“Ή

You can also follow this guide to learn more about customer segments πŸ“”

Still need help? Contact Us Contact Us