---
title: TrackingTransparency
description: A library for requesting permission to track the users on devices using iOS 14 and higher.
sourceCodeUrl: https://github.com/expo/expo/tree/sdk-51/packages/expo-tracking-transparency
packageName: expo-tracking-transparency
platforms: ["android", "ios"]
---
import {
ConfigReactNative,
ConfigPluginExample,
ConfigPluginProperties,
} from '~/ui/components/ConfigSection';
A library for requesting permission to track the user or their device. Examples of data used for tracking include email address, device ID, advertising ID, and more. This permission is only necessary on iOS 14 and higher; on iOS 13 and below this permission is always granted. If the "Allow Apps to Request to Track" device-level setting is off, this permission will be denied. Be sure to add `NSUserTrackingUsageDescription` to your [**Info.plist**](../config/app/#infoplist) to explain how the user will be tracked. Otherwise, your app will be rejected by Apple.
For more information on Apple's new App Tracking Transparency framework, see their [documentation](https://developer.apple.com/app-store/user-privacy-and-data-use/).
## Installation
## Configuration in app config
You can configure `expo-tracking-transparency` using its built-in [config plugin](/config-plugins/introduction/) if you use config plugins in your project ([EAS Build](/build/introduction) or `npx expo run:[android|ios]`). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect.
```json app.json
{
"expo": {
"plugins": [
[
"expo-tracking-transparency",
{
"userTrackingPermission": "This identifier will be used to deliver personalized ads to you."
}
]
]
}
}
```
If you're not using Continuous Native Generation ([CNG](/workflow/continuous-native-generation/)) (you're using native **android** and **ios** projects manually), then you need to configure following permissions in your native projects:
- For Android, add `com.google.android.gms.permission.AD_ID` permission to your project's **android/app/src/main/AndroidManifest.xml**.
```xml
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
```
- For iOS, add `NSUserTrackingUsageDescription` key to your project's **ios/[app]/Info.plist**:
```xml
<key>NSUserTrackingUsageDescription</key>
<string>Your custom usage description string here.</string>
```
## Usage
```jsx
useEffect(() => {
(async () => {
const { status } = await requestTrackingPermissionsAsync();
if (status === 'granted') {
console.log('Yay! I have user permission to track data');
}
})();
}, []);
return (
<View style={styles.container}>
<Text>Tracking Transparency Module Example</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
```
## API
```ts
```
## Permissions
### Android
The following permissions are added automatically through the library's **AndroidManifest.xml**.
| Android Permission | Description |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `com.google.android.gms.permission.AD_ID` | Allows access to the Advertising ID for tracking and analytics. Required for apps targeting Android 13 (API level 33) or higher that use Google Play services' Advertising ID. |
### iOS
The following usage description keys are used by this library: