Skip to main content
The AAID (Android Advertising ID) provider automatically identifies users by their Android Advertising ID. This is available through the Google Ads add-on library.

Setup

Permissions

Privacy

Issues

Overview

The AaidAliasProvider provides:
  • Automatic AAID capture - No manual ID retrieval needed
  • Persistent identification - User tracking across app sessions
  • Privacy compliant - Respects user opt-out preferences
  • Zero maintenance - Automatically updates when AAID changes

Prerequisites

  1. Google Ads add-on installed
  2. Google Play Services on device
  3. AD_ID permission (Android API 33+)

Installation

The AAID provider is included in the Google Ads add-on:
See Installation Guide for details.

Basic Setup

Add AaidAliasProvider at Initialization

Add the AaidAliasProvider when creating your Permutive instance:
That’s it! The AAID will now be automatically captured and set as a user identity.

Required Permissions (Android API 33+)

Add AD_ID Permission

From Android 13 (API 33) and later, the AD_ID permission is required to access the AAID. Add this to your AndroidManifest.xml:
Important for Android 13+Without the AD_ID permission on Android API 33+, the AAID is returned as all zeros (00000000-0000-0000-0000-000000000000) and the AaidAliasProvider will not capture it.

Checking Permission Status

The permission is automatically granted - no runtime permission request needed. However, users can opt out of ad tracking in their device settings.

How It Works

Automatic ID Capture

When AaidAliasProvider is added:
  1. On initialization - AAID is retrieved from Google Play Services
  2. Async retrieval - ID fetched in background (non-blocking)
  3. Auto-set identity - AAID automatically set as user alias
  4. Tag created - Stored with tag "aaid"
  5. Persisted - AAID saved for future sessions

Alias Details

The AAID is stored as an alias with:
  • Tag: "aaid"
  • Identity: The advertising ID (e.g., "38400000-8cf0-11bd-b23e-10b96e40000d")
  • Priority: 0 (default)
  • Expiry: Never (unless manually cleared)

User Opt-Out Handling

If a user opts out of ad personalization in device settings:
  • The AAID provider will receive a zeroed-out ID
  • This zeroed-out ID will not be set as an alias
  • Permutive will use the default anonymous ID instead

Combining with Other Identities

You can use AAID alongside other identity methods:

AAID + Custom Identity

Now the user has two identities:
  1. Custom identity: "user_12345" (tag: "user_id")
  2. AAID: "38400000-8cf0-11bd-b23e-10b96e40000d" (tag: "aaid")

AAID + Multiple Custom Aliases

See Identity Management for more on multiple identities.

Verification

Verify AAID is Set

Enable debug logging to verify AAID is captured:
Look for logs like:

Check Current Identities

You can programmatically check if AAID is set:
See Verification Guide for complete verification steps.

Use Cases

Anonymous User Tracking

For apps without user login, AAID provides persistent tracking:
User is identified by AAID across app launches and sessions.

Logged-In User + AAID

For apps with user accounts, combine both:

Cross-Device Tracking

AAID is device-specific. For cross-device tracking, combine with email or other identifiers:

Privacy Considerations

GDPR Compliance

AAID is considered personal data under GDPR. Ensure:
  • ✅ User consent obtained before initialization
  • ✅ Privacy policy explains AAID usage
  • ✅ User can opt out via device settings
  • ✅ Data can be deleted on request
Contact your Customer Success Manager for details on GDPR compliance.

User Opt-Out

Users can opt out of ad personalization in:
  • Settings → Google → Ads → Opt out of Ads Personalization
When opted out:
  • AAID is zeroed out (00000000-0000-0000-0000-000000000000)
  • AaidAliasProvider will not set this as an identity
  • Permutive uses anonymous ID instead

Data Deletion

To clear all user data including AAID:
This removes:
  • All identities (including AAID)
  • All event data
  • All cohort information
See Identity Management.

Troubleshooting

Problem: AAID not appearing in events.Causes:
  1. Google Ads add-on not installed
  2. AaidAliasProvider not added to Permutive
  3. Missing AD_ID permission (Android 13+)
  4. Google Play Services not available
  5. User opted out of ad personalization
Solutions:
  1. Verify google-ads:2.2.0 is in dependencies
  2. Add AaidAliasProvider to aliasProviders list
  3. Add AD_ID permission to manifest (Android 13+)
  4. Test on device with Google Play Services
  5. Check user’s ad personalization settings
  6. Enable debug logging to see AAID capture attempts
Problem: Error about AD_ID permission.Cause: AD_ID permission not declared.Solution: Add to AndroidManifest.xml:
Problem: AAID cannot be retrieved.Cause: Device doesn’t have Google Play Services (e.g., some devices in China).Solutions:
  1. Implement fallback identification method
  2. Use custom identity instead
  3. Check Play Services availability:
Problem: AAID changes unexpectedly.Causes:
  1. User reset advertising ID in settings
  2. Factory reset
  3. App reinstalled
This is expected behavior. AAID can change, and your implementation should handle this gracefully.See Common Errors for more troubleshooting.

Best Practices

  • Add AaidAliasProvider at SDK initialization
  • Declare AD_ID permission for Android 13+
  • Obtain user consent before capturing AAID (GDPR)
  • Combine AAID with other identifiers for robustness
  • Handle Google Play Services unavailability
  • Respect user opt-out preferences

Google Ad Manager

Use AAID with GAM

Identity Management

Multiple identities

Initialization

SDK setup

Verification

Verify AAID capture

Issues

Solve common issues

API Reference

For complete API documentation, see the Javadocs.

AaidAliasProvider

  • AaidAliasProvider(context: Context) - Creates AAID alias provider

Usage in Permutive

Kotlin:
Java:

Getting Help

If you encounter issues with AAID:
  1. Check Troubleshooting Guide
  2. Verify Google Ads add-on is installed
  3. Confirm AD_ID permission is declared (Android 13+)
  4. Enable debug logging
  5. Test on device with Google Play Services
  6. Contact your Customer Success Manager
For Google Play Services issues, consult Google’s documentation.