HomeDocumentationAPI Reference
Getting StartedAPI ReferenceHelp CenterVideo Tours

Setting Custom Data

Discussed here is setting user attributes, tags, as well as logging user events and their relevant APIs.

User Attributes

You can assign custom attributes to your users and they will show up on your Instabug dashboard with each report. Those attributes can later be used to filter the reports on the dashboard.

User Attributes - DashboardUser Attributes - Dashboard

User Attributes - Dashboard

To add a new user attribute use the following method.

Instabug.SetUserAttribute("18", "Age");
Instabug.SetUserAttribute("True", "LoggedIn");

Instabug.SetUserAttribute("Age", "18");
Instabug.SetUserAttribute("LoggedIn", "True");

You can also retrieve the current value of a certain user attribute, or retrieve all user attributes.

//Get all the created user attributes
//Get the value of a ceratin user attribute

//Get the value of a ceratin user attribute
String value = Instabug.GetUserAttribute("Age");

Then remove the current value of a certain user attribute.

//Remove a user attribute

//Remove a user attribute
//Remote all user attributes 

User Events

You can log custom user events throughout your application. Events are automatically going to be included with each report.

Instabug.LogUserEventWithName("User Event");

Instabug.LogUserEvent("My Event");


You can add custom tags to the reports sent by the SDK. Those tags can later be used to filter reports or set custom rules on the Instabug dashboard.

Tags - DashboardTags - Dashboard

Tags - Dashboard

The example below demonstrates how to add tags to a report.

string[] tags = { "tag1", "tag2" };
NSArray nsArray = NSArray.FromObjects(tags);        


You can also get all the currently set tags as follows.

NSArray tags = Instabug.GetTags();

IList<string> tags = Instabug.Tags;


Adding tags before sending reports

Sometimes it's useful to be able to add a tag to a bug report before it's been sent. In these cases, the perfect solution would be use the event handlers of the bug reporting class. You can find more details here.

Last, you can reset all the tags.



Managing Tags

If you'd like to remove a particular tag from your dashboard to prevent it from appearing again when entering a new tag manually, you can do so by navigating to the tags page under the settings options and remove the tag. You can also edit and rename the tag.

What’s Next

You now have more information than ever about each bug report, so we suggest you read up more on bug reporting. Also, did you know that you can use custom user attributes and events to target surveys?