> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Device Identifier Tracking

## Android Id Tracking

From SDK version **11.5.00**, SDK optionally tracks Android-id for the devices(by default Android-id is not tracked). To enable Android-id tracking use the [enableAndroidIdTracking()](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]enable-android-id-tracking.html) method as shown below.

<CodeGroup>
  ```Kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import com.moengage.core.enableAndroidIdTracking
  enableAndroidIdTracking(context)
  ```

  ```Java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoESdkStateHelper.enableAndroidIdTracking(context);
  ```
</CodeGroup>

Before enabling the Android-id tracking application should take consent from the user as per the [Google Policy](https://support.google.com/googleplay/android-developer/answer/10144311).Once tracking is enabled SDK would continue tracking the Android-id until explicitly opted-out. Use the [disableAndroidIdTracking()](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]disable-android-id-tracking.html) method to opt-out of Android-id tracking.

<CodeGroup>
  ```Kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import com.moengage.core.disableAndroidIdTracking
  disableAndroidIdTracking(context)
  ```

  ```Java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoESdkStateHelper.disableAndroidIdTracking(context);
  ```
</CodeGroup>

For the SDK version below **11.5.00** use the *TrackingOptoutConfig* while initializing the MoEngage SDK.

## Advertising Identifier Tracking

From SDK version **12.1.00**, SDK optionally tracks Advertising Identifier for the devices(by default Advertising Identifier is not tracked). To enable Advertising Identifier tracking use the [enableAdIdTracking()](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]enable-ad-id-tracking.html) method as shown below.

<CodeGroup>
  ```Kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import com.moengage.core.enableAdIdTracking
  enableAdIdTracking(context)
  ```

  ```Java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoESdkStateHelper.enableAdIdTracking(context);
  ```
</CodeGroup>

Before enabling the Advertising Identifier tracking application should take consent from the user as per the [Google Policy](https://support.google.com/googleplay/android-developer/answer/10144311).

Once tracking is enabled SDK would continue tracking the Advertising Identifier until explicitly opted-out. Use the [disableAdIdTracking()](https://moengage.github.io/android-api-reference/core/com.moengage.core/\[android-jvm]disable-ad-id-tracking.html) method to opt-out of Advertising Identifier tracking.

<CodeGroup>
  ```Kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import com.moengage.core.disableAdIdTracking
  disableAdIdTracking(context)
  ```

  ```Java Java theme={"theme":{"light":"github-light","dark":"github-dark"}}
  MoESdkStateHelper.disableAdIdTracking(context);
  ```
</CodeGroup>

For the SDK version below **12.1.00** use the *TrackingOptoutConfig* while initializing the MoEngage SDK.
