# SkillPatch skill: google-mobile-ads-get-started

This skill guides an agent through integrating the Google Mobile Ads (GMA) SDK across Android, iOS, and Unity platforms. It provides a structured workflow covering dependency setup, application identifier configuration, SDK initialization, and integration verification. After installation, it prompts the user to select an ad format for further integration.

You (the agent) were given this URL and asked to use this skill. This is a **public** skill — no SkillPatch account, API key, or prior setup is required. Two ways to use it:

**1. Use it right now** — the skill's complete file tree (SKILL.md + all reference files) is inlined below; read `SKILL.md` first, then follow it, consulting the other files as it directs.

**2. Install the exact package onto disk** (recommended if you can run a shell — this reproduces the skill byte-for-byte, including any binary assets that can't be inlined):

```bash
mkdir -p .claude/skills/google-mobile-ads-get-started
curl -sSL https://skillpatch.dev/install_skill/google-mobile-ads-get-started | tar -xz -C .claude/skills/
```

(`.claude/skills/` is Claude Code's convention; use whatever directory your agent loads skills from.)


---

## Skill files (5)

- `SKILL.md`
- `assets/skadnetwork-identifiers.xml`
- `references/android-get-started.md`
- `references/ios-get-started.md`
- `references/unity-get-started.md`


### `SKILL.md`

```markdown
---
name: google-mobile-ads-get-started
description: Provides instructions for integrating the Google Mobile Ads (GMA)
  SDK. Use this skill when the user wants to get started with, install,
  integrate, set up, or configure the SDK for AdMob or Ad Manager, GMA Next-Gen
  SDK or mobile ads framework in an Android, iOS, or Unity application.
metadata:
  version: 1.1.0
  category: GoogleAds
---
# Google Mobile Ads SDK - Install

## Workflow

1.  **Determine the user's platform**: Identify if the project is Android, iOS,
    or Unity. If unclear, ask before proceeding.

2. **Read the platform guide** for implementation details:
    - Android: `references/android-get-started.md`
    - iOS: `references/ios-get-started.md`
    - Unity: `references/unity-get-started.md`

3. **Follow these steps in order**:
   - [ ] Add the SDK dependency
   - [ ] Set the application identifier
   - [ ] Initialize the SDK
   - [ ] Verify the integration

4. After the SDK is successfully installed, ask the user to select an ad format
   to continue the integration.

```


### `assets/skadnetwork-identifiers.xml`

```
<key>SKAdNetworkItems</key>
<array>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>cstr6suwn9.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4fzdc2evr5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>2fnua5tdw4.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ydx93a7ass.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>p78axxw29g.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v72qych5uu.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ludvb6z3bs.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>cp8zw746q7.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3sh42y64q3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>c6k4g5qg8m.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>s39g8k73mm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>wg4vff78zm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3qy4746246.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>f38h382jlk.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>hs6bdukanm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>mlmmfzh3r3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v4nxqhlyqp.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>wzmmz9fp6w.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>su67r6k2v3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>yclnxrl5pm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>t38b2kh725.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>7ug5zh24hu.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>gta9lk7p23.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>vutu7akeur.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>y5ghdn5j9k.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v9wttpbfk9.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>n38lu8286q.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>47vhws6wlr.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>kbd757ywx3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>9t245vhmpl.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>a2p9lx4jpn.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>22mmun2rn5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>44jx6755aq.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>k674qkevps.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4468km3ulz.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>2u9pt9hc89.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>8s468mfl3y.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>klf5c3l5u5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ppxm28t8ap.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>kbmxgpxpgc.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>uw77j35x4d.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>578prtvx9j.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4dzt52r2t5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>tl55sbb4fm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>c3frkrj4fj.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>e5fvkxwrpn.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>8c4e2ghe7u.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3rd42ekr43.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>97r2b46745.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3qcr597p9d.skadnetwork</string>
  </dict>
</array>

```


### `references/android-get-started.md`

````markdown
# AI Integration Agent Instructions for the Android GMA Next-Gen SDK

## Required Imports

Use the following imports to initialize the GMA Next-Gen SDK:

```
import com.google.android.libraries.ads.mobile.sdk.MobileAds
import com.google.android.libraries.ads.mobile.sdk.initialization.InitializationConfig
import com.google.android.libraries.ads.mobile.sdk.initialization.InitializationStatus
import com.google.android.libraries.ads.mobile.sdk.initialization.OnAdapterInitializationCompleteListener
```

## Method Signatures

Use the following method signature to initialize the GMA Next-Gen SDK:

```
fun initialize(
    context: Context,
    initializationConfig: InitializationConfig,
    listener: OnAdapterInitializationCompleteListener?
): Unit
```

The `InitializationConfig` object takes the AdMob App ID:

```
InitializationConfig.Builder("ca-app-pub-3940256099942544~3347511713").build()
```

The `OnAdapterInitializationCompleteListener` interface is defined as:

```
fun interface OnAdapterInitializationCompleteListener {
    fun onAdapterInitializationComplete(status: InitializationStatus): Unit
}
```

## SDK Integration Workflow

1.  **Add the SDK dependency**:
    -   [ ] **ALWAYS** Add the latest stable version of
        `com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk` to
        dependencies. If you cannot access Maven directly, run the following
        command to fetch the latest version. The version returned in the
        `latest` tag is the latest version of the Google Mobile Ads SDK:

        ```bash
        curl -sS https://dl.google.com/dl/android/maven2/com/google/android/libraries/ads/mobile/sdk/ads-mobile-sdk/maven-metadata.xml | sed -n 's/.*<latest>\(.*\)<\/latest>.*/\1/p'
        ```

    -   [ ] Configure `minSdk` (24+) and `compileSdk` (34+).
    -   [ ] Exclude `play-services-ads` and `play-services-ads-lite` from all
        dependencies globally in the app-level build file to avoid duplicate
        symbol errors.
    -   [ ] Sync Gradle before moving on to the next step.

2.  **Set the application identifier**:
    -   [ ] Pass the `applicationId` parameter programmatically in the
        `InitializationConfig.Builder` with a sample AdMob App ID of
        `ca-app-pub-3940256099942544~3347511713`. Remind the user to replace it
        with their actual AdMob App ID before publishing.

3.  **Initialize the SDK**:
    -   [ ] **ALWAYS** initialize the SDK on a background thread.

4.  **Verify the integration**:
    -   [ ] Run `gradle build -x test` to confirm a successful clean build.
        Resolve any GMA SDK related compile errors.

#### Troubleshooting

**ONLY** if you exhaust your internal knowledge and not able to complete the
workflow steps, read
https://developers.google.com/admob/android/next-gen/quick-start.md.txt and try
again.

````


### `references/ios-get-started.md`

````markdown
# AI Integration Agent Instructions for the iOS Google Mobile Ads SDK

## Gotchas

Google Mobile Ads SDK uses `NS_SWIFT_NAME` macros to provide idiomatic Swift
names.

## SDK Integration Workflow

1.  **Add the SDK dependency**:

    -   [ ] Run the following command to fetch the latest version. The tag
        returned is the latest version of the Google Mobile Ads SDK:

        ```bash
        curl -sS https://api.github.com/repos/googleads/swift-package-manager-google-mobile-ads/releases/latest | jq -r '.tag_name'
        ```

    -   [ ] Check if Ruby is installed and the `xcodeproj` Ruby gem is available
        by running `ruby -e "require 'xcodeproj'"`.

        -   **If Ruby and `xcodeproj` are available**: Locate the `.xcodeproj`
            directory and primary app target, then write a temporary Ruby script
            to programmatically add the
            `GoogleMobileAds` Swift Package
            (`https://github.com/googleads/swift-package-manager-google-mobile-ads.git`)
            using the **Up to Next Major Version** dependency rule starting with
            the fetched version as a target dependency.

        -   **Fallback / Manual Installation**: If Ruby or `xcodeproj` is not
            available, or if the script execution fails, do **NOT** attempt to
            troubleshoot, retry, or install Ruby or `xcodeproj`. You MUST
            default to outputting instructions directing the user to manually
            add the `GoogleMobileAds` Swift package in Xcode.

2.  **Set the application identifier**:

    -   [ ] If there is no `GADApplicationIdentifier` already present, add the
        `GADApplicationIdentier` to the `Info.plist` file with a sample AdMob
        App ID of `ca-app-pub-3940256099942544~1458002511`. Remind the user to
        replace it with their actual AdMob App ID before publishing.
    -   [ ] Add the `SKAdNetwork` identifiers from
        `assets/skadnetwork-identifiers.xml` to the `Info.plist` file.

3.  **Initialize the SDK**:

    -   [ ] Initialize the SDK in the appropriate entry point of the
        application. You **MUST** use the following code snippet when working
        with Swift:

        ```
        MobileAds.shared.start { status in
            print("SDK initialized.")
        }
        ```

4.  **Verify the integration**:

    -   [ ] Verify the build to ensure there are no compile errors:
        -   **When `xcodebuild` is available**: Run `xcodebuild` to
            programmatically verify that the iOS project compiles properly with
            the GMA SDK. Resolve any GMA SDK related compile errors.
        -   **When `xcodebuild` is NOT available**: Output instructions
            directing the user to build the project in Xcode and manually verify
            there are no compile errors.

#### Troubleshooting

**ONLY** if you exhaust your internal knowledge and not able to complete the
workflow steps, read
https://developers.google.com/admob/ios/quick-start.md.txt and try again.

````


### `references/unity-get-started.md`

````markdown
# AI Integration Agent Instructions for the Unity Google Mobile Ads Plugin

## SDK Integration Workflow

1.  **Add the SDK dependency**:

    Install via `Packages/manifest.json`:

    -   Run the following command to fetch the latest version. The tag returned
        (excluding the 'v' prefix) is the latest version of the Google Mobile
        Ads SDK:

        ```bash
        curl -sS https://api.github.com/repos/googleads/googleads-mobile-unity/releases/latest | jq -r '.tag_name'
        ```

    -   Modify `Packages/manifest.json` with the "OpenUPM" scoped registry,
        using the latest version.

        ```json
        {
          "scopedRegistries": [
            {
              "name": "OpenUPM",
              "url": "https://package.openupm.com",
              "scopes": [
                "com.google"
              ]
            }
          ],
          "dependencies": {
            // Replace 11.2.0 with the latest stable version.
            "com.google.ads.mobile": "11.2.0"
          }
        }
        ```

2.  **Set the application identifier**:

    Modify `Assets/GoogleMobileAds/Resources/GoogleMobileAdsSettings.asset`. Set
    `adMobAndroidAppId` and `adMobIOSAppId` to the sample App IDs:

    -   Android: `ca-app-pub-3940256099942544~3347511713`
    -   iOS: `ca-app-pub-3940256099942544~1458002511`

    Remind the user to replace it with their actual AdMob App ID before
    publishing.

3.  **Initialize the SDK**:

    Write a script to handle initialization. Ensure background ad callbacks
    interacting with Unity objects (`UnityEngine`) are explicitly scheduled on
    the main thread using `ExecuteInUpdate()`.

    Do not set `MobileAds.RaiseAdEventsOnUnityMainThread` to `true`, it is
    obsolete.

    ```c#
    using GoogleMobileAds.Api;
    using GoogleMobileAds.Common;
    using UnityEngine;

    public class GoogleMobileAdsController : MonoBehaviour
    {
        public void Start()
        {
            // Initialize the Google Mobile Ads SDK exactly once.
            MobileAds.Initialize((InitializationStatus initStatus) =>
            {
                Debug.Log("Google Mobile Ads SDK initialized.");

                MobileAdsEventExecutor.ExecuteInUpdate(() =>
                {
                    // Interact with UnityEngine objects on the main thread here.
                });
            });
        }
    }
    ```

4.  **Verify the integration**:

    Compile the Unity csproj file by running `dotnet build`. Resolve any GMA SDK
    related compile errors.

### Links

Additional documentation and guides:

-   Quick Start Guide:
    https://developers.google.com/admob/unity/quick-start.md.txt
-   Global Settings Guide:
    https://developers.google.com/admob/unity/global-settings.md.txt
-   OpenUPM Package: https://openupm.com/packages/com.google.ads.mobile/

````
