Skip to main content
Custom Metadata

Inject custom metadata in your issues to help developers better understand feedback

Joe Scanlon avatar
Written by Joe Scanlon
Updated over a week ago

Enhance your developers' understanding of feedback by injecting custom metadata into your reported issues using Marker.io. This guide explains how to implement and benefit from custom metadata to provide detailed context and improve debugging efficiency.


Benefits of Custom Metadata

Injecting custom metadata into your issues allows:

  • Better Context: Understand the exact conditions under which an issue was reported.

  • Improved Debugging: Quickly identify and resolve issues with detailed information.

  • Customized Feedback: Collect data tailored to your application's needs.


Types of Custom Metadata

Marker.io supports various custom metadata types:

  • Number: Numeric data.

  • Boolean: True/false values.

  • String: Textual information.

  • Array: Lists of values.

  • Objects: Structured data.


Implementing Custom Metadata

Method 1: Embedding Custom Metadata in the JavaScript snippet

To integrate custom metadata when the widget loads, include a customData object in your Marker.io widget configuration.

<script>
window.markerConfig = {
project: 'your_project_id',
source: 'snippet',
customData: {
storeID: getStoreID(),
storeName: getStoreName(),
customerId: getCustomerId(),
customerStatus: getCustomerStatus(),
customerCountry: getCustomerCountry(),
paymentMethod: getPaymentMethod(),
orderStatus: getOrderStatus(),
}
};
</script>

Example: Suppose you want to incorporate the user ID of an authenticated user and your application's version into Marker.io's custom metadata. Assuming 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', // Replace with your project ID
source: 'snippet',
customData: {
userId: user_ID,
appVersion: app_ver,
},
};
</script>

This snippet ensures that custom metadata appears on your feedback page, providing developers with detailed context for each issue.

Additionally, if you use 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 with Dynamic User Data:

Marker.setCustomData({
userId: newUserID,
appVersion: newAppVersion,
});

This approach allows you to update metadata dynamically based on changing user information and application states, giving developers the detailed context needed to efficiently troubleshoot and resolve issues.


Viewing Custom Metadata

Both members and admins can view the injected metadata in Marker.io. This feature is invaluable for providing developers with the necessary context to debug effectively.

By integrating custom metadata, you ensure a smoother and more efficient troubleshooting process, making it easier for developers to understand and resolve issues.

Did this answer your question?