setTrackDeviceId

The setTrackDeviceId() method turns on or off the fetching of the device ID from the tracker instance. The device ID is the advertising ID (AAID) assigned by Google.

By default, setTrackDeviceId(true) is set.

Syntax

getTracker().setTrackDeviceId(isFetched);
tracker.isTrackDeviceId = isFetched

Parameters

isFetched (boolean, required)

Whether the user ID is fetched automatically from the tracker instance. The user ID is the advertising ID (AAID) assigned by Google. True: is fetched. False: is not fetched.

Examples

To turn off fetching the device ID from the tracker instance:

getTracker().setTrackDeviceId(false);
tracker.isTrackDeviceId = false

Notes

  • The device ID won’t be sent if setAnonymizationState(true) is set.
  • If your app uses the device ID (AAID) and you plan to submit your app to Google Play, you will need to ask each user for permission to share their data.

Related methods