Skip to main content

Data Collection Consent

Coming Soon

The Data Collection Consent API is currently in development. This page will be updated when the feature is available in the SDK.

The data collection consent API will let you defer or suppress telemetry export until you have explicit user consent. This is planned for use in:

  • Apps that display a consent dialog before collecting analytics
  • GDPR/privacy-compliance flows where data collection must be opt-in
  • Scenarios where you want to initialize the SDK early but hold telemetry until the user grants permission

Planned Behavior

The consent system will support three states:

StateDescription
PENDINGTelemetry signals are buffered in memory. No data is sent.
ALLOWEDBuffered signals are flushed and subsequent signals are exported normally.
DENIEDBuffered data is cleared and the SDK is shut down.

Current Workaround

Until the consent API is available, you can control data collection by deferring SDK initialization until after the user grants consent:

class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
if (userHasGrantedConsent()) {
PulseSDK.INSTANCE.initialize(
application = this,
projectId = "your-project-id"
)
}
}
}

To stop collection after initialization, call PulseSDK.INSTANCE.shutdown(). Note that shutdown is terminal in the current process — the SDK cannot be re-initialized without an app restart.

Next Steps