Getting Started with Metadata

Custom attributes can be added to your project as metadata. A metadata attribute is a set of key/value pairs that you can use to customize your campaigns. In this article, you'll learn how to create metadata attributes and use them to track, report, and personalize promotions.
Visit our Developer Hub to learn how to manage metadata via the API.

Contents

  1. How metadata works?
  2. Types of metadata.
  3. How to add metadata?
  4. How to use metadata?
  5. Maintenance


How does metadata work?

Before you use metadata attributes, you need to add them to the Metadata Schema. Go to the Project Settings and choose Metadata Schema.

 By expanding the list of Standard schemas from the menu on the right, you can see that every:

  • Voucher
  • Campaign
  • Customer
  • Product
  • Redemption
  • Publication
  • Order
  • Order line item
  • Loyalty tier
  • Promotion tier
  • Earning rule
  • Reward
can be extended with metadata attributes. Adding metadata to the Schema ensures data consistency across projects. Attributes added to a particular schema are saved and can be reused every time you create a new Voucherify object. For example, if you add new attributes to the Customer schema, you'll be able to use them every time you create a new customer profile or promotion rules. 

Metadata

Thanks to the multiple data types support, your metadata may represent a variety of different values:
  • Text
  • Number
  • Flag
  • Date
  • Date Time
  • Image URL
  • Object (creates nested metadata structure)
  • Geopoint

Text and Numbers

When adding text and number attributes, you can use additional criteria for their values. 

Text:

  • has a minimum length of
  • has a maximum length of
  • has an exact length of
  • is equal to any of

Number:

  • is less than
  • is less than or equal
  • is greater than or equal
  • is equal to any of
  • is not equal to any of
  • is greater than

Flag (Boolean)

Metadata of the flag type can take the value of true or false. 

Date and Date Time

Dates and times in Voucherify comply with ISO 8601 norms. If you would like to add metadata with dates or times using the API, remember to follow the required format. Here is an example of the correct date-time value: 2020-03-11T09:00:00.000Z.

Object

Objects enable you to group attributes and create nested schemas. Each object can gather many single metadata properties. You'll learn how to use objects in the Nested Metadata section. 

Geopoint

Geopoint represents the customer's location. You can use it to build area-specific validation rules and introduce geofencing to your campaigns. This type of metadata stores location using coordinates in order: latitude, longitude, where allowed values for both are as follows:

  • latitude from -90 to 90,
  • longitude from -180 to 180

How to define a metadata attribute?

First, decide if you want to add single metadata properties or create a nested metadata structure.

Standard Metadata

To add a single metadata attribute, choose the Standard list schema and click Add new definition.

Add the Name (key) of your attribute and choose the Type

The  multiple option comes in handy when you want to assign more than one value to the attribute. This will create an array of values for the key.

With the  mandatory option, you can decide whether adding attribute value is required while creating new resources in Voucherify. For example, if a new attribute in the Customer Schema is set to mandatory, you need to add this attribute and define its value every time you pass a new customer record to the application.

Nested Metadata

In addition to standard metadata properties, you can create an object type attribute and use it to nest other attributes inside. For example, you may create a new metadata property, Payment, and add several nested properties, such as payment_method, payment_channel, and payment_tax.

First, add a new custom schema with the Plus.

Add a name and confirm with Create. In the schema, use Add new definition to create attributes you would like to nest.

When ready, you can attach the custom schema to the object type attribute in the Standard schema.

After saving the schema, metadata can nest payment information.


How to use Metadata?

Metadata extends the customization capabilities of Voucherify. Properties added to vouchers and campaigns help you to better track and report your results. Attributes used to build customer segments and validation rules provide custom promotion limits and campaign workflows.

Tracking and reporting 

Metadata can represent properties useful for tracking your results and introducing ongoing boosts. You can export your data from Voucherify to analyze them or build integration with BI tools to provide data sync. All your redemptions, customers, orders, and vouchers can be downloaded from your dashboard in a CSV file. 

Customers

Metadata added to Customer Schema extends basic attributes assigned to each customer in Voucherify. In this way, Voucherify can reflect your CRM data structure. Each metadata attribute can later serve as a redemption limit or filter in segmenting your audience. Go here to learn more.

Products

By using metadata, you can create product-specific promotion rules without uploading your product catalog to Voucherify. Metadata added to cart items is validated while redeeming the code to check if a customer qualifies for a promotion. You can also add your products to Voucherify and use metadata to extend products' characteristics. Likewise, each product metadata can model redemption limits and promotion rules. Go here to read more. 

Validation Rules

You can use metadata schemas to build fine-grained validation rules that determine your desired redemption circumstances. Rules builder creates limits on customer, product, order, and redemption metadata.


Maintenance 

To maintain metadata in your projects easily, we recommend always adding metadata to the schema before using it in your campaigns. As an Administrator, you can enforce such behavior by enabling the option "Allow only defined properties" in each schema. 

Note that only the Administrator of your account can modify metadata in schemas. You can add and remove metadata definitions. All removed properties will be stored in the Removed definitions if you would like to restore them in the schema.

Using the bin icon next to the removed definition forces purging metadata definition from your existing resources. Purging metadata definition is an asynchronous operation and it takes time to be executed. You will be notified once it's done in the notifications center in your dashboard. 
Support for Metadata purging is currently available for:
  • campaigns
  • loyalty tiers
  • order items
  • orders
  • promotion tiers
  • customers
  • products
  • vouchers 

Copy Metadata Schema between Projects

You can quickly copy and re-use metadata properties added throughout different projects. You can perform this action for both Standard and Nested metadata schemas.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us