Custom data can be added to feedback requests using the Userback JavaScript API. This allows you to include information about the user, such as their account ID or name, along with their feedback.

To add custom data, you will first need to include the Userback widget code on your website. This code can be found in the Widget Settings section of your Userback account.

Once you have added the widget code, you can use the following method to add custom data:

Userback.setData({ key1: value1, key2: value2 });

For example, if you want to include a user's account ID and name with their feedback, you can use the following code:

<script> Userback.setData({ account_id: 7, name: "John Smith" }); </script>

You can also add this data as an option when initializing the widget:

<script> Userback.init('[your widget token]', { custom_data: { account_id: 7, name: "John Smith" } }); </script>

Please note that the custom_data option can also be used instead of setData() method.

You can add as many key-value pairs as you want to the custom_data object, and they will be included with the feedback in your Userback account.

This data can then be used to filter, search and segment feedback to better understand and address customer feedback.

It's important to use appropriate key name to identify the data and keep data privacy compliance in mind when adding custom data to feedback.

Did this answer your question?