Metadata
Use metadata to save any custom data to Participants and Rewards to make your advocate program even more dynamic.
Certain LoyaltySurf objects, such as Participants
and Rewards
can have a special metadata
parameter, which is useful for storing any custom information.
Use Cases
Here are some examples of how you could use metadata
:
Issue different reward values to participants based on their different
metadata
properties. Learn more here.If you need to save custom data to a participant to display or use later in your own application.
Attach custom key/value data to rewards in your campaign to retrieve later via the REST API when automating a reward via Webhooks or Zapier.
Overview
Participant metadata
Can be set via the campaign editor, admin dashboard, and REST API
Can be retrieved via REST API and is available via Webhooks
Can be viewed from your admin dashboard and when you download your participants list
Reward metadata
Can be set via the campaign editor
Can be retrieved via REST API and is available via Webhooks
Can be used within LoyaltySurf emails
Participant metadata
Setting participant metadata
There are several different ways to save metadata to a participant.
Campaign Editor
From Campaign Editor > 2. Design, you can update the Signup/Login Form with custom fields. When a participant submits a new task from your advocate portal, they will need to submit the custom fields as well, which will be saved as participant metadata.
Admin Dashboard
When you are viewing a participant from the LoyaltySurf admin dashboard, you can add or update their metadata.
REST API
You can use these REST API endpoints to add or update a participant's metadata:
For adding new participants:
For updating existing participants:
Using participant metadata
REST API
You can use these REST API endpoints to retrieve a participant's metadata:
Webhooks
Participant metadata is returned on all participant payloads in Webhook events.
Reward metadata
Setting reward metadata
There is only one way to update reward metadata, from Campaign Editor > 1. Rewards.
Using reward metadata
You can then reference this reward metadata in different places of the Campaign Editor for UI purposes. For example, metadata will be available as an option by clicking the "+ Personalize" dropdown in emails.
Policies
The following are the policies when creating or updating metadata.
Policy
Limit
Metadata Key
40 characters
Metadata Value
500 characters
Total Metadata Keys
50 keys / object
Key Characters
Alphanumeric
Note the following:
All metadata keys will be converted to camelCase. For example, if you provide a key "My Metadata Key" that key will be converted to
myMetadataKey
.Important: Do not store any sensitive information (personally identifiable information, such as credit cards and social security numbers) as metadata within LoyaltySurf, as metadata rewards are accessible from the JavaScript SDK.
Last updated