Skip to main content

cordova-plugin-tracking-transparency Alternative for Capacitor

cordova-plugin-tracking-transparency alternative for Capacitor: request and read iOS App Tracking Transparency status with @capgo/capacitor-app-tracking-transparency.

Illustration of migrating a Cordova app to Capacitor, used for an App Tracking Transparency plugin guide

The practical cordova-plugin-tracking-transparency alternative for a Capacitor app is @capgo/capacitor-app-tracking-transparency. It replaces window.plugins.impacTracking callbacks with AppTrackingTransparency.getStatus() and requestPermission(), returns typed status strings, and fits Capacitor permission flows before you enable ad or attribution SDKs. This guide lists npm facts, install steps, usage, and a Cordova to Capacitor API map.

Why leave cordova-plugin-tracking-transparency in Capacitor

cordova-plugin-tracking-transparency on npm is version 1.0.4. The last numbered release on the npm time object is 11 June 2021. The registry modified timestamp is 27 April 2022 (metadata only, not a new plugin version). The npm repository URL points to ImpacGroup/Cordova-Plugin-Tracking-Transparency.

The published www/tracking.js bridge registers window.plugins.impacTracking with:

  • canRequestTracking(successCallback)
  • trackingAvailable(successCallback)
  • requestTracking(info, successCallback, errorCallback)

All three use cordova.exec without promises. The Cordova plugin targets iOS 14.5+ for the ATT framework.

@capgo/capacitor-app-tracking-transparency latest on npm is 8.1.23 with a modified date of 12 November 2026. src/definitions.ts documents getStatus(), requestPermission(), and getPluginVersion() with authorized, denied, restricted, and notDetermined status values. Capgo ships fixes on an open source cadence where a human still reviews, tests and merges 50+ pull requests daily.

Install

The command below installs the npm 8.x line for Capacitor 8 (@capacitor/core >= 8). @capgo/capacitor-app-tracking-transparency has no 7.x release on npm; it requires Capacitor 8 or later.

bun add @capgo/capacitor-app-tracking-transparency
bunx cap sync

Add NSUserTrackingUsageDescription to Info.plist before calling requestPermission(). See the App Tracking Transparency plugin docs.

Usage example

import { AppTrackingTransparency } from '@capgo/capacitor-app-tracking-transparency';

// iOS ATT status only. Android and web return 'authorized' without a prompt.
// This is not user consent. Gate non-iOS trackers on a separate consent flow.
export async function ensureTrackingConsent() {
  const { status: current } = await AppTrackingTransparency.getStatus();
  if (current === 'authorized') return current;
  if (current !== 'notDetermined') return current;

  const { status } = await AppTrackingTransparency.requestPermission();
  return status;
}

ensureTrackingConsent() reflects Apple’s ATT choice on iOS only. On Android and web the same calls report authorized without asking the user.

Migrating from Cordova to Capacitor

// Before (Cordova)
window.plugins.impacTracking.canRequestTracking((can) => {
  if (can) {
    const info = JSON.stringify({
      title: 'Allow tracking?',
      text: 'Used for relevant ads.',
      subText: 'You can change this later in Settings.',
      buttonTitle: 'Continue',
      primaryColor: '#FFFFFF',
      secondaryColor: '#007AFF',
      onPrimaryColor: '#000000',
      onSecondaryColor: '#FFFFFF',
      reasons: [{ text: 'Fewer irrelevant ads', image: 'star.fill', tintImage: true }],
    });
    window.plugins.impacTracking.requestTracking(
      info,
      (result) => console.log(result),
      (err) => console.error(err),
    );
  }
});
// After (Capacitor)
import { AppTrackingTransparency } from '@capgo/capacitor-app-tracking-transparency';

const { status } = await AppTrackingTransparency.getStatus();
if (status === 'notDetermined') {
  await AppTrackingTransparency.requestPermission();
}

Cordova requestTracking accepts an info argument for a pre-prompt screen. Pass a JSON string of a TrackingRequestInfo object, for example JSON.stringify(info). Passing a plain object skips the pre-prompt and requests ATT directly. Capgo has no equivalent argument: show your explainer in app UI, then call requestPermission().

API mapping table

cordova-plugin-tracking-transparency (window.plugins.impacTracking) @capgo/capacitor-app-tracking-transparency
canRequestTracking(success) getStatus() then check status === 'notDetermined'
trackingAvailable(success) On iOS, getStatus() then status === 'authorized' before enabling trackers; on Android and web use a separate consent flow (status is always authorized)
requestTracking(info, success, error) requestPermission() returns { status }; build the pre-prompt screen yourself (no info payload)
Callback result payloads authorized, denied, restricted, notDetermined
cordova.addConstructor install Standard Capacitor import
Not in Cordova getPluginVersion()
Cordova plugin install bun add @capgo/capacitor-app-tracking-transparency plus bunx cap sync

ATT strings ship in the native binary. Use Capgo Build for App Store releases, then adjust consent gating in Capgo live updates where JavaScript alone can change flows. For the full platform move, read the Cordova to Capacitor migration guide.

Live updates for Capacitor apps

When a web-layer bug is live, ship the fix through Capgo instead of waiting days for app store approval. Users get the update in the background while native changes stay in the normal review path.

Latest from our Blog

Capgo gives you the best insights you need to create a truly professional mobile app.