Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install data-manager-api-setup@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin data-manager-api-setup v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install data-manager-api-setup

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

Download and extract to your repository:

.github/skills/data-manager-api-setup/

Extract the ZIP to .github/skills/ in your repo. The folder name must match data-manager-api-setup for Copilot to auto-discover it.

Skill Files (7)

SKILL.md 5.8 KB
---
name: data-manager-api-setup
description: >-
  Guides developers through client library installation and authentication setup
  steps for the Data Manager API. Use this skill when a user is getting started
  with the Data Manager API and needs to setup their local environment, install
  the client library, or setup access to the API. Don't use for implementing
  audience or event ingestion logic (use the data-manager-api-audience-ingestion
  or data-manager-api-event-ingestion skills instead), or for debugging
  UNAUTHENTICATED, PERMISSION_DENIED, or other errors from requests after setup
  (use the data-manager-api-troubleshooting skill).
metadata:
  version: "1.1.1"
  category: GoogleAds
---
# Data Manager API Setup

## Setup Authentication

Refer to [Set up API access](https://developers.google.com/data-manager/api/devguides/quickstart/set-up-access.md.txt)
for more details.

### 1. Enable the API

**Prerequisites**: A Google Cloud project, the Google Cloud CLI (`gcloud`), and
a Google Account with a project role that can enable APIs, such as **Owner**,
**Editor**, or **Service Usage Admin**. Always tell the user about the required
role. If `gcloud` isn't installed, prompt the user to install it first.

```shell
gcloud services enable datamanager.googleapis.com --project={project_id}
gcloud services list --enabled --project={project_id} --filter="datamanager.googleapis.com"
```

### 2. Generate Application Default Credentials (ADC)

Choose the method that matches the user's scenario:

*   **User account** (API calls are made as the user's own Google Account): The
    Data Manager API scopes are sensitive, so the user must first configure
    their project's Google Auth Platform:
    1.  **Data Access** page: Add the Data Manager API scopes.
    2.  **Audience** page: Set **Publishing status** to **Testing**. Use the
        **Internal** user type for a Google Workspace organization, or
        **External** with the user's account added as a **Test user**.
    3.  Create (or reuse) a **Desktop app** OAuth client and download its JSON
        configuration file.
    4.  The user runs the following command, which opens a browser login:

        ```shell
        gcloud auth application-default login \
          --scopes="https://www.googleapis.com/auth/datamanager,https://www.googleapis.com/auth/cloud-platform" \
          --client-id-file="{client_id_file_path}"
        ```

    **Unverified app screen**: This warning appears because the Data Manager API
    scopes are sensitive. During **Testing**, External test users still see it
    and can continue past it. Before other users can sign in, the app must
    complete
    [OAuth app verification](https://developers.google.com/data-manager/api/devguides/concepts/oauth-verification.md.txt).
    Service accounts don't need verification.
*   **Service account** (API calls are made as an app identity instead of a
    person): For local development, use service account impersonation rather
    than a service account key, since keys are a security risk if not managed
    carefully.
    *   Grant the Service Account the `Service Usage Consumer` IAM role
        (`roles/serviceusage.serviceUsageConsumer`) on the project.
    *   Grant the user executing `gcloud` the Token Creator role
        (`roles/iam.serviceAccountTokenCreator`) on that Service Account.
    *   Run:

        ```shell
        gcloud auth application-default login \
          --impersonate-service-account={service_account_email} \
          --scopes="https://www.googleapis.com/auth/datamanager,https://www.googleapis.com/auth/cloud-platform"
        ```
*   **Data partner creating partner links** in advertiser accounts: Read
    [Partner Links](references/partner-links.md).

**Multiple APIs**: To use the same credentials for other APIs, append their
scopes to the `--scopes` list in the commands above (e.g.,
`https://www.googleapis.com/auth/adwords` for the Google Ads API or
`https://www.googleapis.com/auth/display-video` for the Display & Video 360
API).

**Verify**: `gcloud auth application-default print-access-token` prints an
access token when credentials are set up correctly.

**Troubleshooting `PERMISSION_DENIED` with a valid token**: Add the user or
service account to the destination account (for example, the Google Ads account
or its manager account). For service accounts, also confirm the
`Service Usage Consumer` role on the Cloud project.

**Production**: For production authentication (workloads in or outside Google
Cloud, apps that act on behalf of other users, or partner links), see
[Deploy to production](https://developers.google.com/data-manager/api/devguides/concepts/deploy.md.txt).

## Install Client & Utility Libraries

Refer to [Install a client library](https://developers.google.com/data-manager/api/devguides/quickstart/install-library.md.txt)
for more details.

The companion utility libraries provide pre-built helper classes
and functions to correctly format, hash, and encrypt user identifiers (such as
emails, phone numbers, and physical addresses) prior to API ingestion. Use of
these libraries is highly recommended to ensure that user identifier formatting
matches the API's specifications.

Select the language-specific installation guide below:

*   [Python Setup Reference](references/python.md) (packages: `google-ads-datamanager` and `google-ads-datamanager-util`)
*   [Java Setup Reference](references/java.md) (packages: `com.google.api-ads:data-manager` and `com.google.api-ads:data-manager-util`)
*   [Node Setup Reference](references/node.md) (packages: `@google-ads/datamanager` and `@google-ads/datamanager-util`)
*   [PHP Setup Reference](references/php.md) (packages: `googleads/data-manager` and `googleads/data-manager-util`)
*   [.NET Setup Reference](references/dotnet.md) (packages: `Google.Ads.DataManager.V1` and `Google.Ads.DataManager.Util`)
references/
dotnet.md 0.3 KB
# .NET Client and Utility Library Installation

## Install Client Library

Install the `Google.Ads.DataManager.V1` NuGet package:

```shell
dotnet add package Google.Ads.DataManager.V1
```

## Install Utility Library

Install the `Google.Ads.DataManager.Util` NuGet package:

```shell
dotnet add package Google.Ads.DataManager.Util
```
java.md 1.5 KB
# Java Client and Utility Library Installation

## Install Client Library

Determine the latest version of `com.google.api-ads:data-manager` by running:
```shell
curl -s "https://repo1.maven.org/maven2/com/google/api-ads/data-manager/maven-metadata.xml" \
  | sed -n 's/.*<release>\(.*\)<\/release>.*/\1/p'
```

If using Maven, add the following dependency to your `pom.xml` file.
Replace `{latest_version}` with the version retrieved above:

```xml
<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>data-manager</artifactId>
  <version>{latest_version}</version>
</dependency>
```

If using Gradle, add this to your dependencies.
Replace `{latest_version}` with the version retrieved above:

```groovy
implementation 'com.google.api-ads:data-manager:{latest_version}'
```

## Install Utility Library

Determine the latest version of `com.google.api-ads:data-manager-util` by running:
```shell
curl -s "https://repo1.maven.org/maven2/com/google/api-ads/data-manager-util/maven-metadata.xml" \
  | sed -n 's/.*<release>\(.*\)<\/release>.*/\1/p'
```

If using Maven, add the following dependency to your `pom.xml` file.
Replace `{latest_version}` with the version retrieved above:

```xml
<dependency>
  <groupId>com.google.api-ads</groupId>
  <artifactId>data-manager-util</artifactId>
  <version>{latest_version}</version>
</dependency>
```

If using Gradle, add this to your dependencies.
Replace `{latest_version}` with the version retrieved above:

```groovy
implementation 'com.google.api-ads:data-manager-util:{latest_version}'
```
node.md 0.3 KB
# Node Client and Utility Library Installation

## Install Client Library

Install the Node.js client library:

```shell
npm install @google-ads/datamanager
```

## Install Utility Library

Install the Node.js companion utility library from npm:

```shell
npm install @google-ads/datamanager-util
```
partner-links.md 2.0 KB
# Partner Links

A partner link connects an advertiser account to a data partner account. The
data partner then manages audiences or events in the advertiser's account using
credentials for its **own** data partner account. For the full guide, see
[Partner links](https://developers.google.com/data-manager/api/devguides/accounts/partner-links.md.txt).

## Data partner workflow

Advertisers can also manage partner links in the Google Ads, Display & Video
360, or Google Ad Manager UI. Use `PartnerLinkService` when that isn't available
or when offering linking inside the partner's own application.

1.  **Get short-lived advertiser credentials** for a Google Account that's a
    user in the advertiser account, requesting only this scope:

    `https://www.googleapis.com/auth/datamanager.partnerlink`

    Build an OAuth flow in the partner's app. Use a **Web server** or **Web
    browser** OAuth client (not Desktop), following
    [OAuth 2.0 for Web Server Applications](https://developers.google.com/identity/protocols/oauth2/web-server)
    or
    [OAuth 2.0 for Client-side Web Applications](https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow).
2.  **Create the partner link** with the advertiser credentials. See
    [Create or delete a partner link](https://developers.google.com/data-manager/api/devguides/accounts/partner-links/create-partner-link.md.txt)
    for the request fields and samples.
3.  **Discard the advertiser credentials.** They're no longer needed.
4.  **For all later requests**, use credentials for a Google Account or service
    account with access to the **data partner account**.

## OAuth app verification

The `datamanager.partnerlink` scope is sensitive, so the partner's app must
complete OAuth app verification before advertisers authorize it. Otherwise,
advertisers see the unverified app screen.

For details on the verification process, see
[OAuth app verification](https://developers.google.com/data-manager/api/devguides/concepts/oauth-verification.md.txt).
php.md 0.3 KB
# PHP Client and Utility Library Installation

## Install Client Library

Install the `googleads/data-manager` component using Composer:

```shell
composer require googleads/data-manager
```

## Install Utility Library

Install the `googleads/data-manager-util` component using Composer:

```shell
composer require googleads/data-manager-util
```
python.md 0.3 KB
# Python Client and Utility Library Installation

## Install Client Library

Install the Python client library:

```shell
pip install google-ads-datamanager
```

## Install Utility Library

Install the Python companion utility library from PyPI:

```shell
pip install google-ads-datamanager-util
```

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