setUserAnonymisation static method

Future<void> setUserAnonymisation(
  1. bool userAnonymisation, {
  2. required String tracker,
})

Sets whether client-side user anonymisation is enabled for the tracker namespace.

This toggles the userAnonymisation flag at runtime, without having to recreate the tracker. Changing it starts a new session but preserves the tracker instance. Not supported on Web.

Implementation

static Future<void> setUserAnonymisation(bool userAnonymisation,
    {required String tracker}) async {
  await _channel.invokeMethod('setUserAnonymisation',
      {'tracker': tracker, 'userAnonymisation': userAnonymisation});
}