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

# 広告識別子トラッキングの有効化

> 正確なデバイス分析のために、React Native アプリで広告識別子のトラッキングを有効にします。

デバイスに関する正確な分析や再インストールのトラッキングを行うには、広告識別子（Advertising Identifier）をトラッキングすることが不可欠です。

## 広告識別子ライブラリの追加

アプリケーションレベルの ***build.gradle*** ファイルに以下の依存関係を追加します。

```groovy Groovy theme={null}
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
```

広告識別子のトラッキングを有効にするには、以下のように *enableAdIdTracking()* メソッドを使用します。

```javascript Javascript theme={null}
import ReactMoE from 'react-native-moengage'
ReactMoE.enableAdIdTracking();
```

広告 ID のトラッキングを有効にする前に、アプリケーションが広告 ID のトラッキングに関する [Google Play ポリシー](https://support.google.com/googleplay/android-developer/answer/10144311)に準拠していることを確認してください。ポリシーの詳細については、[ヘルプドキュメント](https://www.moengage.com/docs/user-guide/data/privacy/android-advertising-id-tracking)を参照してください。

トラッキングを有効にした後に広告 ID を無効にする必要がある場合は、次のメソッドを使用します。

```javascript Javascript theme={null}
import ReactMoE from 'react-native-moengage'
ReactMoE.disableAdIdTracking();
```

> [!NOTE]
>
> 上記の API は、プラグインバージョン 7.4.1 以降でのみ利用可能です。それより古いバージョンでは、広告識別子のトラッキングはデフォルトで有効になっています。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.