Getting Started with Metadata
Contents
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:
|
|
Metadata
- 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:
|
Number:
|
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.
- 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.