Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install google-mobile-ads-get-started@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin google-mobile-ads-get-started v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install google-mobile-ads-get-started

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/google-mobile-ads-get-started/

Extract the ZIP to .github/skills/ in your repo. The folder name must match google-mobile-ads-get-started for Copilot to auto-discover it.

Skill Files (4)

SKILL.md 1.0 KB
---
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.2.1"
  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.
references/
android-get-started.md 2.8 KB
# 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` (35+).
    -   [ ] 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.

### Links

Additional documentation:

-   https://developers.google.com/admob/android/next-gen/quick-start.md.txt?utm_source=agent-skills&utm_medium=content&utm_campaign=adr-ss-ai&utm_content=google-mobile-ads-get-started
ios-get-started.md 9.5 KB
# AI Integration Agent Instructions for the iOS Google Mobile Ads SDK

## Gotchas

-   Use Swift Package Manager to install the Google Mobile Ads SDK.
-   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, install Ruby or `xcodeproj`, or suggest
            CocoaPods. 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
        `GADApplicationIdentifier` 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 following `SKAdNetwork` identifiers to the `Info.plist`
        file:

        ```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>
        ```

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.

### Links

Additional documentation:

-   https://developers.google.com/admob/ios/quick-start.md.txt?utm_source=agent-skills&utm_medium=content&utm_campaign=adr-ss-ai&utm_content=google-mobile-ads-get-started
unity-get-started.md 2.9 KB
# 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,
        replacing the placeholder version (`"11.6.0"` below) with the latest
        stable version returned above.

        ```json
        {
          "scopedRegistries": [
            {
              "name": "OpenUPM",
              "url": "https://package.openupm.com",
              "scopes": [
                "com.google"
              ]
            }
          ],
          "dependencies": {
            "com.google.ads.mobile": "11.6.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`, because ad
    events triggered while the app is paused or backgrounded can be delayed or
    dropped.

    ```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/

License (Apache-2.0)

View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/google/skills/blob/main/LICENSE