App Tracking Transparency (ATT)
This guide provides comprehensive instructions for implementing Apple's App Tracking Transparency (ATT) framework with the Trackier Cordova SDK. ATT is required for iOS 14.5+ apps that want to access the Identifier for Advertisers (IDFA) for accurate attribution and tracking.
Overview
App Tracking Transparency (ATT) is Apple's privacy framework that requires apps to request user permission before accessing the IDFA. This is crucial for accurate attribution and tracking on iOS 14.5 and later.
Prerequisites
- iOS 14.5 or later
- Xcode 12.0 or later
- Trackier Cordova SDK installed
- Access to your app's
Info.plistfile (located inios/App/App/Info.plistfor Capacitor projects) - Cordova IDFA plugin installed (e.g.,
cordova-plugin-idfaor@sparkfabrik/cordova-plugin-app-tracking-transparency)
Implementation
Step 1: Add Permission Description
Add the following key-value pair to your Info.plist to describe why your app needs tracking permission:
<key>NSUserTrackingUsageDescription</key>
<string>We use tracking to personalize your experience and improve our services.</string>
Step 2: Configure ATT Timeout
Important: Always include waitForATTUserAuthorization(timeoutInterval) before initializing the SDK. This ensures the SDK waits for the user's ATT decision before starting tracking, which is required for accurate attribution on iOS 14.5+. You can adjust the timeout value (20 seconds) according to your use case or logic.
Update your app component to configure ATT timeout before SDK initialization:
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { TrackierCordovaPlugin, TrackierConfig } from '@awesome-cordova-plugins/trackier/ngx';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(
private platform: Platform,
private trackierCordovaPlugin: TrackierCordovaPlugin
) {
this.initializeApp();
}
async initializeApp() {
await this.platform.ready();
await this.initializeTrackierSDK();
}
async initializeTrackierSDK() {
try {
// iOS: Configure ATT timeout (should be called before initialization)
if (this.platform.is('ios')) {
this.trackierCordovaPlugin.waitForATTUserAuthorization(20);
}
const trackierConfig: TrackierConfig = {
appToken: 'YOUR_SDK_KEY',
environment: 'production'
};
await this.trackierCordovaPlugin.initializeSDK(trackierConfig);
console.log('Trackier SDK initialized successfully');
} catch (error) {
console.error('Error initializing Trackier SDK:', error);
}
}
}
Step 3: Request ATT Permission
Important: You must manually request ATT permission from the user. The waitForATTUserAuthorization method only configures the SDK to wait for the user's decision. Once the user grants permission, the Trackier SDK will automatically fetch the IDFA and send it to the panel.
Create a service to handle ATT permission requests using a Cordova IDFA plugin:
import { Injectable } from '@angular/core';
import { Platform } from '@ionic/angular';
declare var cordova: any;
@Injectable({
providedIn: 'root'
})
export class AttService {
constructor(private platform: Platform) {}
async requestTrackingPermission(): Promise<void> {
if (!this.platform.is('ios')) {
console.log('ATT is only required on iOS platform');
return;
}
try {
// Check if the AppTrackingTransparency plugin is available
if (typeof cordova !== 'undefined' && cordova.plugins && cordova.plugins.idfa) {
const result = await cordova.plugins.idfa.getInfo();
if (result.trackingPermission === 'notDetermined') {
// Request permission from user
const permissionResult = await cordova.plugins.idfa.requestPermission();
this.handlePermissionResult(permissionResult);
} else {
console.log('ATT permission already determined:', result.trackingPermission);
}
}
} catch (error) {
console.error('Error requesting ATT permission:', error);
}
}
private handlePermissionResult(result: any): void {
console.log('ATT Permission Status:', result.trackingPermission);
switch (result.trackingPermission) {
case 'authorized':
console.log('App Tracking Permission: Authorized');
console.log('IDFA:', result.idfa);
// The Trackier SDK will automatically fetch and send IDFA to the panel
break;
case 'denied':
console.log('App Tracking Permission: Denied');
// The SDK will continue tracking without IDFA
break;
case 'restricted':
console.log('App Tracking Permission: Restricted');
break;
case 'notDetermined':
console.log('App Tracking Permission: Not Determined');
break;
}
}
}
Step 4: Request Permission After App Launch
Call the ATT permission request after the app is fully loaded:
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { TrackierCordovaPlugin, TrackierConfig } from '@awesome-cordova-plugins/trackier/ngx';
import { AttService } from './services/att.service';
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss'],
})
export class AppComponent {
constructor(
private platform: Platform,
private trackierCordovaPlugin: TrackierCordovaPlugin,
private attService: AttService
) {
this.initializeApp();
}
async initializeApp() {
await this.platform.ready();
await this.initializeTrackierSDK();
// Request ATT permission after a short delay
if (this.platform.is('ios')) {
setTimeout(() => {
this.attService.requestTrackingPermission();
}, 1000);
}
}
async initializeTrackierSDK() {
try {
// iOS: Configure ATT timeout (should be called before initialization)
if (this.platform.is('ios')) {
this.trackierCordovaPlugin.waitForATTUserAuthorization(20);
}
const trackierConfig: TrackierConfig = {
appToken: 'YOUR_SDK_KEY',
environment: 'production'
};
await this.trackierCordovaPlugin.initializeSDK(trackierConfig);
console.log('Trackier SDK initialized successfully');
} catch (error) {
console.error('Error initializing Trackier SDK:', error);
}
}
}
How It Works
- Configure Timeout: Call
waitForATTUserAuthorization(timeoutInterval)before SDK initialization to configure how long the SDK should wait for user permission - Initialize SDK: The SDK initializes and waits for ATT permission decision
- Request Permission: You manually request ATT permission from the user (using Cordova IDFA plugin)
- User Allows: When user grants permission, the Trackier SDK automatically fetches the IDFA and sends it to the panel
- Automatic Tracking: The SDK uses the IDFA for accurate attribution tracking
Key Features
waitForATTUserAuthorization(timeoutInterval): Configures the SDK to wait for user's ATT decision before starting tracking. The timeout can be adjusted based on your app's needs.- Automatic IDFA Handling: Once permission is granted, the SDK automatically fetches and sends IDFA to the panel.
- Manual Permission Request: You control when to show the ATT permission dialog to users.
- Platform-Specific: Only runs on iOS, gracefully skips on other platforms.
Always replace "YOUR_SDK_KEY" with your actual SDK token from the Trackier Panel. Using an incorrect token will cause attribution issues.
Visual Examples
ATT Permission Dialog:
IDFA Console Logs:

IDFA Panel in Trackier Dashboard: When tracking is properly configured with ATT, you can see the IDFA details in the Trackier panel for installs and events:

This panel shows the IDFA information when users grant tracking permission, allowing for accurate attribution and detailed tracking analytics.
ATT Status Values
| Status | Description | SDK Behavior |
|---|---|---|
authorized | User granted permission | Full tracking enabled, IDFA available |
denied | User denied permission | Limited tracking, no IDFA |
restricted | System restricted (parental controls) | Limited tracking, no IDFA |
notDetermined | Permission not requested yet | Wait for user decision |
Best Practices
- Timing: Request permission after app launch (1-2 second delay)
- User Experience: Explain why tracking is needed before requesting permission
- Timeout Configuration: Adjust timeout based on your app's flow (default 20 seconds)
- Platform Check: Always check if running on iOS before calling ATT methods
- Check Status First: Always check if permission has already been determined before requesting
- Handle All Cases: Implement proper handling for all ATT status values
Troubleshooting
Common Issues
ATT Permission Not Requested
- Ensure
NSUserTrackingUsageDescriptionis added toInfo.plist - Check that the app targets iOS 14.5 or later
- Verify the permission request is called after app launch
IDFA Not Available
- Check if user granted permission (status should be
authorized) - Ensure the device supports IDFA (not available on simulator)
- Verify the app is not restricted by parental controls
SDK Initialization Issues
- Make sure
waitForATTUserAuthorizationis called before SDK initialization - Check that the timeout value is appropriate for your app flow
- Verify the SDK token is correct
Platform Check Not Working
- Ensure
this.platform.is('ios')is correctly implemented - Verify the Platform service is properly imported from
@ionic/angular
Support
For technical support and questions:
- Support Email: support@trackier.com
- Documentation: Trackier Documentation Portal
This guide provides comprehensive implementation of App Tracking Transparency with the Trackier Cordova SDK, ensuring compliance with Apple's privacy requirements while maintaining accurate attribution and tracking capabilities.