Privacy and data collection

  • Latest Dynatrace
  • Explanation
  • 1-min read
  • Published Jan 12, 2026

Dynatrace provides privacy settings that allow you to control the amount of data collected from your users. These settings help ensure compliance with data protection regulations such as GDPR while still providing valuable insights into application performance. For more information on configuring data privacy in mobile applications, see Configure data privacy settings for mobile applications.

While Dynatrace offers numerous data privacy settings, it is your responsibility to properly configure these settings and implement appropriate consent mechanisms to protect your users' personal data.

Data collection levels

The Dynatrace .NET MAUI NuGet package supports three data collection levels that determine what information is captured and sent to Dynatrace.

The possible values for the data collection level are as follows:

  • Off
  • Performance
  • UserBehavior

User opt-in mode

User opt-in mode requires explicit user consent before collecting monitoring data. When enabled, the agent starts with minimal data collection until the user grants consent.

Default behavior

When user opt-in mode is enabled, the following defaults apply until the user sets their preferences:

  • Data collection level—Off (no monitoring data is sent).
  • Crash reporting—false (crash reports are not sent).

Enable user opt-in mode

To enable user opt-in mode, update your dynatrace.config.json file:

{
"android": {
"userOptIn": true
},
"ios": {
"DTXUserOptIn": true
}
}

Retrieve user's data privacy preferences

You can retrieve the data privacy preferences of a particular user.

To get the current UserPrivacyOptions configuration, use the following API call:

using Dynatrace.MAUI;
// Get the UserPrivacyOptions object
UserPrivacyOptions currentOptions = Agent.Instance.GetUserPrivacyOptions();
// Get the individual settings for DataCollectionLevel and crash reporting
bool crashOptedIn = Agent.Instance.GetUserPrivacyOptions().CrashReportingOptedIn;
DataCollectionLevel dataCollectionLevel = Agent.Instance.GetUserPrivacyOptions().DataCollectionLevel;

Change user's data privacy preferences

You can adjust the data privacy preferences based on the decision of a particular user.

To set new options on a UserPrivacyOptions object, use the following code:

using Dynatrace.MAUI;
// Creating a new UserPrivacyOptions object requires setting the two parameters of DataCollectionLevel and crash reporting
UserPrivacyOptions options = new UserPrivacyOptions(DataCollectionLevel.Performance, false);
// Update the options with the setter
// Set a data collection level (user allowed you to capture performance and personal data)
options.DataCollectionLevel = DataCollectionLevel.UserBehavior;
// Allow crash reporting (user allowed you to collect information on crashes)
options.CrashReportingOptedIn = true;
// Get the values of the configuration with the getter
options.DataCollectionLevel;
options.CrashReportingOptedIn;
// Get the UserPrivacyOptions object
UserPrivacyOptions currentOptions = Agent.Instance.GetUserPrivacyOptions();

To apply the new UserPrivacyOptions configuration, use this code:

using Dynatrace.MAUI;
UserPrivacyOptions options = new UserPrivacyOptions(DataCollectionLevel.UserBehavior, true);
Agent.Instance.ApplyUserPrivacyOptions(options);

When you apply new privacy options, a new session is created with the specified settings. The settings are stored and automatically applied to future sessions.

App store privacy questionnaire

When submitting your app to the App Store or Google Play, you may need to complete a privacy questionnaire. For information on what data OneAgent captures, see:

Related tags
Digital Experience