Introduction to Custom Metadata
Marker.io is designed to automatically gather essential metadata related to reported issues, such as the page URL, browser details, console logs, and network requests. However, for a more comprehensive understanding of feedback, our platform also offers the ability to integrate custom metadata through the snippet code. This feature is invaluable for developers, providing additional context about the application's current state and aiding in efficient debugging.
Note: You may also like to identify your reporters automatically.
Types of Custom Metadata
We support various custom metadata types to cater to diverse application needs.
number
boolean
strings
array
objects
Methods to Implement Custom Metadata
Method 1: Embedding Custom Metadata in the JavaScript snippet
To seamlessly integrate custom metadata during widget loading, include a customData
object in your Marker.io widget configuration.
<script>
window.markerConfig = {
project: "<PROJECT ID>",
customData: {
storeId: 123,
storeName: 'Organic Fruits',
}
};
</script>
Example: Suppose you wish to incorporate the user ID of an authenticated user and your application's version into Marker.io's custom metadata. Let's say that the JavaScript variables user_ID
and app_ver
represent the user and application version respectively, your JavaScript snippet would look like:
<script>
window.markerConfig = {
project: '650d9785e9819c0f22aabbcc', //place your proeject id here
source: 'snippet',
// Collect custom information
customData: {
userId: user_ID,
appVersion: app_ver,
},
};
</script>
When anyone reports feedback on my website, the custom metadata will appear on your feedback page as shown below:
Additionally, if you utilize any of our third-party integrations, the custom metadata will be seamlessly integrated, as demonstrated in the Jira example here:
Method 2. Dynamic Custom Metadata Assignment with Marker.setCustomData() and the Marker.io SDK
For dynamic applications, you may need to update custom metadata on the fly. Use the Marker.setCustomData()
within our Marker.io SDK to achieve this.
Marker.setCustomData({
product: 'Banana',
available: true,
price: 1.23,
stock: 131,
brands: [
'The Organic Corp',
'ACME Fruits Inc',
],
});
Example:
Marker.setCustomData({
userId: newUserID,
appVersion: newAppVersion,
});
Note: only member and admin roles can see the injected metadata in Marker.io
You may also like to identify your reporters automatically.