> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Add the Kotlin SDK to your Android project and configure GAID.

<Note>
  You'll need a [publisher account](/publishers#getting-started-is-easy) to obtain your `publisherToken` and placement codes.
</Note>

## 1. Add the SDK

The SDK is published to Maven Central as `so.kontext:ads`. Make sure `mavenCentral()` is listed in your project's repository configuration:

```kotlin theme={null}
// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}
```

Then add the dependency to your app-level `build.gradle.kts`:

```kotlin theme={null}
dependencies {
    implementation("so.kontext:ads:4.0.3") // replace with the latest 4.x
}
```

The SDK targets Android API 26+ and is JVM 17. If your app sets a lower target/JVM, bump those before integrating.

## 2. Google Advertising ID (GAID)

The SDK automatically reads and forwards the Google Advertising ID with each ad request.

The `com.google.android.gms.permission.AD_ID` permission is automatically merged into your `AndroidManifest.xml` via the SDK's manifest contribution — no changes to your manifest are required. GAID is an install-time permission, so there is no runtime prompt.

<Note>
  If your app targets Android 13+ (API 33+) and you have explicitly set `tools:node="remove"` on the `AD_ID` permission anywhere in your manifest, remove that override or the advertising identifier will not be accessible at runtime.
</Note>

If you collect GAID yourself, you can pass it directly via `SessionOptions.advertisingId` — that value takes priority over the SDK's automatic collection.
