Client-SideUnity SDK

Configuration

How to configure the AudienceLab Unity SDK

Version:

Initial Setup

  1. Navigate to AudienceLab SDK from the Unity menu to open the settings window
  2. Enter your authentication token provided by AudienceLab
  3. Click Verify to link your Unity project with your application
  4. Save the project and restart Unity to ensure proper initialization

SDK Settings Window

The SDK settings window is organized into three tabs:

Main Tab

SettingDescription
isSDKEnabledMaster toggle for SDK functionality
SendStatisticsEnable/disable data collection
ShowDebugLogEnable console logging for troubleshooting

Privacy Tab

Configure device identifier collection for improved attribution:

ModeDescription
Auto GAIDSDK automatically collects Google Advertising ID (recommended)
Manual/DisabledYou provide GAID via SetAdvertisingId(), or disable GAID collection to rely on probabilistic matching

Additional options:

  • Auto-collect App Set ID: Collects Android App Set ID (does not require user permission)

Dependency Behavior:

SettingPlay Services Dependencies
Auto GAID enabled✅ Automatically added
Disabled + App Set ID auto✅ Automatically added
Disabled + App Set ID disabled❌ Not added

Debug Tab

Configure the debug overlay for development and testing:

SettingDescription
Enable Debug OverlayShow/hide the debug overlay (Editor and Development builds only)
Max EventsNumber of recent events to display in the overlay (default: 20)
Show Raw IdentifiersDisplay full device identifiers instead of truncated values
Toggle KeyKeyboard shortcut to toggle the overlay (default: F8)

The debug overlay is only available in Unity Editor and Development builds. It will not appear in release builds.

Android Dependencies

The SDK requires Google Play Services dependencies for Android identity collection. These are managed automatically based on your SDK settings.

Automatic Mode (Default)

When Auto GAID or App Set ID Auto-collection is enabled:

  • Dependencies are automatically generated at build time
  • No manual configuration required
  • The SDK creates Assets/Plugins/Android/AudienceLabIdentity.gradle before each Android build

Disabled Mode

When GAID is disabled and App Set ID auto-collection is disabled:

  • No Play Services dependencies are added
  • Reduces app size and avoids unnecessary permissions
  • Ideal for apps that don't need advertising identifiers
  • You can still provide GAID and App Set ID by calling SetAdvertisingId() and SetAppSetId()

Manual Dependency Management

If you prefer to manage dependencies manually or need to customize versions:

  1. Go to AudienceLab SDK > Android > Regenerate Android Dependencies to generate the gradle file
  2. Or add dependencies to your mainTemplate.gradle:
dependencies {
    implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
    implementation 'com.google.android.gms:play-services-appset:16.0.2'
}

Checking Dependency Status

Use AudienceLab SDK > Android > Check Android Dependencies to see:

  • Current GAID mode
  • Whether Play Services dependencies are required
  • Whether the gradle file is present

ProGuard Configuration (Android)

For release builds with code obfuscation, add this ProGuard rule:

-keep class com.Geeklab.plugin.** { *; }

Add this to your existing ProGuard configuration or create proguard-user.txt in Assets/Plugins/Android.