Skip to main content
Use the APIs below to control what the MoEngage SDK tracks, based on the consent a user has given.

Enable or Disable Data Tracking

To stop the SDK from tracking custom events and user attributes, call disableDataTracking().
The SDK rejects all events and user attributes until you call enableDataTracking(). Data tracking is enabled by default.

Enable or Disable the SDK

To stop the SDK from tracking any user information or sending any data to MoEngage, call disableSdk().
All SDK APIs are non-operational until you call enableSdk(). The SDK is enabled by default, so call enableSdk() only if you disabled it earlier.

Delete User Data

deleteUser() is deprecated. Client-side user deletion will be removed in moengage_flutter 12.0.0. To delete a user, use the following flow:
  1. Register an onLogoutComplete listener using _moengagePlugin.setLogoutCompleteCallbackHandler(listener).
  2. Log the user out on the device by calling _moengagePlugin.logout().
  3. Invoke the MoEngage server-to-server Delete User API from your backend within the onLogoutComplete callback.
The server-to-server deletion must be initiated only after the onLogoutComplete callback is received. If a user is deleted while the SDK still retains their identity, the SDK may continue to send data for that user.
To delete the current user’s profile from the MoEngage server, refer to Delete User From MoEngage Server.