Use Dynatrace Android gradle plugin to adjust OneAgent configuration

The following configuration options can be used to modify the default configuration of the OneAgent. They are especially useful when used along with the auto-start injection feature.

They can also be used to adjust the OneAgent configuration when the manual startup approach is approached. In this case, you have to be careful because these settings might get overridden with the ConfigurationBuilder.

Data privacy

OneAgent allows you to dynamically adjust data-privacy settings so that you can build your apps in compliance with GDPR data-privacy regulations. To activate this feature (when you use the auto-start injection feature), enable the userOptIn property.

dynatrace {
    configurations {
        sampleConfig {
            userOptIn true
        }
    }
}

Use the OneAgent SDK to adjust the privacy level based on user discretion. The details are available in the data privacy section of the OneAgent SDK for Android documentation.

Hybrid apps that use the RUM JavaScript tag inside a WebView

For hybrid apps that use the RUM JavaScript tag, cookies must be set for each instrumented domain or server the app communicates with. When the hybrid app monitoring feature is enabled, OneAgent generates these cookies for every specified domain and stores them into the CookieManager.

All hybrid app monitoring related properties are part of HybridWebView DSL and must be configured via the hybridWebView block:

dynatrace {
    configurations {
        sampleConfig {
            hybridWebView {
                enabled true
                domains '<domain1>', '<domain2>'
                domains '<anotherDomain>'
            }
        }
    }
}

You can activate the hybrid app monitoring feature with the enabled property. All used domains, hosts, and IP addresses must be specified via the domains property. Domains and sub-domains must start with a dot.