Metadata
Metadata is used to add specificity to an action. When you create a mission, you can add metadata as the name:value pair within the rule to collect information specific to the action the user needs to perform. Using metadata, you can use the same action to complete different tasks of the same type. Show me an example
Metadata Rules
Nitro currently supports up to a total of 10 metadata pairs to be associated with actions logged. However, analytics can only support up to 5 metadata pairs.
If the metadata sent to Nitro does not exactly match what is defined in the rule, the action will not complete the mission. The metadata:
- Name and Value are case-insensitive.
- Name cannot contain a comma or a colon
- Value cannot contain a comma
- Value can contain spaces, but the Name should not
-
Must be UTF-8 encoded
Self-Reporting Rules Metadata
When using self-reporting rules, we recommend that:
-
You create actions only used for self-reporting rules. If a self-reporting rule uses an action that is also used in other missions, then completing a self-reporting rule may make progress on or complete other missions. For example, Mission A uses a self-reporting rule with the TRAINING action. Mission B uses a Number of Actions rule with the TRAINING action and no metadata. When a user marks the self-reporting rule as complete, it logs the TRAINING action which will complete Mission A and Mission B.
-
You MUST add metadata to all self-reporting rules. Metadata ensures that when a user marks a self-reporting task as complete, it will only complete that mission and not all missions that have a self-reporting rule using the same action. Nitro automatically adds metadata to the self-reporting rule when you save it, but you can add additional metadata if necessary.
-
You only edit self-reporting rule metadata during off-peak hours. If you edit the metadata at the same time a user is marking the task as complete, it will put the rule in a bad state. This happens because the user logs the rule with the old metadata, but the mission is looking for the new metadata. The rule will not complete for that user and it will remain in a "Submitted" status until manually remediated by an administrator.
Nitro Metadata
Nitro automatically logs metadata for quizzes, self-reporting rules, On The Spot card redemptions, and recognition events.
Action to Log |
Action Name |
Metadata Name |
Metadata Value |
---|---|---|---|
Nitro Actions and Metadata |
|||
Completion of a quiz. The action is logged when a quiz is completed. In addition to the metadata, the percent correct is returned as the action value. |
QUIZ_COMPLETED |
passed |
true or false |
quiz_id |
the numeric quiz ID (available in the Quizzes view Quiz ID column) |
||
totalCorrect |
the total number of questions the user answered correctly |
||
totalQuestions |
the total number of questions in the quiz |
||
percentCorrect |
the user's completion score for the quiz rounded to the nearest integer |
||
Redemption of an On The Spot card. |
OTS_REDEMPTION |
card_number |
the 16-digit card number |
value |
the point value redeemed |
||
Completion of a self-reporting rule. The selfReporting and ruleUrl pairs are added/updated when you save the self-reporting rule in the mission builder. The rule URL is only added if a URL exists for the rule, it does not add metadata for subtask URLs.
|
Any action within your program
|
nitro-self-reporting |
true |
selfReporting |
{missionId_ruleId} |
||
ruleUrl |
{ruleUrl} |
||
Recognition given or received. |
Name is configurable within your program |
category |
the category name (available in the Recognitions view Exchange Categories column) |
exchange |
the recognition exchange name |
View Action Metadata
You can view the metadata sent with an action in the User Management view or with GET /users/{userId}/actions. Use this to verify that the information sent to Nitro matches the metadata defined in the mission.
See also
Example: Reward users that receive a specific type of recognition