Privacy and data collection

  • Latest Dynatrace
  • Explanation
  • 1-min read
  • Published Dec 24, 2025

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 Flutter plugin 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
  • USER_BEHAVIOR

User opt-in mode

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

Default behavior

When user opt-in mode is activated, 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).

Activate user opt-in mode

To activate user opt-in mode, update your dynatrace.config.yaml file:

Android:

android:
config:
"dynatrace {
configurations {
defaultConfig {
userOptIn true
}
}
}"

iOS:

ios:
config:
"<key>DTXUserOptIn</key>
<true/>"

After updating the configuration, run dart run dynatrace_flutter_plugin to apply the changes.

Dynatrace does not provide a consent dialog UI. You must implement your own consent banner or dialog within your application. The dialog should:

  1. Explain what data will be collected.
  2. Allow users to choose their preferred data collection level.
  3. Allow users to activate or disable crash reporting.
  4. Provide a way for users to change their preferences later.

Privacy API

Use the privacy API to get and apply user privacy preferences.

Get current privacy options

Retrieve the current privacy settings:

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';
Future<void> checkPrivacySettings() async {
final options = await Dynatrace().getUserPrivacyOptions();
print('Data collection level: ${options.dataCollectionLevel}');
print('Crash reporting enabled: ${options.crashReportingOptedIn}');
}

Apply privacy options

Set the user's privacy preferences:

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';
// Grant full consent
Dynatrace().applyUserPrivacyOptions(
UserPrivacyOptions(DataCollectionLevel.UserBehavior, true)
);
// Grant performance monitoring only, no crash reporting
Dynatrace().applyUserPrivacyOptions(
UserPrivacyOptions(DataCollectionLevel.Performance, false)
);
// Revoke all consent
Dynatrace().applyUserPrivacyOptions(
UserPrivacyOptions(DataCollectionLevel.Off, false)
);

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