# Create Report — Google Ad Manager

> Create a report in Google Ad Manager. See the documentation

- Key: `google_ad_manager-create-report`
- Type: Action (Write)
- Version: 0.0.2
- App: Google Ad Manager (`google_ad_manager`) — https://pipedream.com/apps/google-ad-manager.md
- This page (HTML): https://pipedream.com/apps/google-ad-manager/actions/create-report
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/google_ad_manager/actions/create-report/create-report.mjs

## Description

Create a report in Google Ad Manager. [See the documentation](https://developers.google.com/ad-manager/api/beta/reference/rest/v1/networks.reports/create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `parent` | `string` | Yes | The parent resource where this Report will be created. Format: networks/{networkCode}. Options are loaded from the connected account. |
| `name` | `string` | Yes | Identifier. The resource name of the report. Report resource names have the form: networks/{networkCode}/reports/{reportId}. |
| `visibility` | `string` | Yes | The visibility of the report. |
| `displayName` | `string` | No | The display name of the report. |
| `scheduleOptions` | `object` | No | The options for a scheduled report. See the documentation. |
| `dimensions` | `string[]` | Yes | The list of dimensions to report on. If empty, the report will have no dimensions, and any metrics will be totals. |
| `metrics` | `string[]` | Yes | The list of metrics to report on. If empty, the report will have no metrics. |
| `filters` | `string[]` | No | The filters for this report. Each row must be formatted as a JSON object. See the documentation. |
| `timeZone` | `string` | No | The time zone the date range is defined in for this report. Defaults to publisher's time zone if not specified. Time zone in IANA format. Acceptable values depend on the report type. Publisher time zone is always accepted. Use America/Los_Angeles for pacific time, or Etc/UTC for UTC. |
| `currencyCode` | `string` | No | The ISO 4217 currency code for this report. Defaults to publisher currency code if not specified. |
| `customDimensionKeyIds` | `string[]` | No | Custom Dimension keys that represent CUSTOM_DIMENSION_* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, customDimensionKeyIds[0] describes CUSTOM_DIMENSION_0_VALUE_ID and CUSTOM_DIMENSION_0_VALUE. |
| `lineItemCustomFieldIds` | `string[]` | No | Custom field IDs that represent LINE_ITEM_CUSTOM_FIELD_* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, lineItemCustomFieldIds[0] describes LINE_ITEM_CUSTOM_FIELD_0_OPTION_ID and LINE_ITEM_CUSTOM_FIELD_0_VALUE. |
| `orderCustomFieldIds` | `string[]` | No | Custom field IDs that represent ORDER_CUSTOM_FIELD_* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, orderCustomFieldIds[0] describes ORDER_CUSTOM_FIELD_0_OPTION_ID and ORDER_CUSTOM_FIELD_0_VALUE. |
| `creativeCustomFieldIds` | `string[]` | No | Custom field IDs that represent CREATIVE_CUSTOM_FIELD_* dimensions. The index of this repeated field corresponds to the index on each dimension. For example, creativeCustomFieldIds[0] describes CREATIVE_CUSTOM_FIELD_0_OPTION_ID and CREATIVE_CUSTOM_FIELD_0_VALUE. |
| `reportType` | `string` | Yes | The type of this report. |
| `timePeriodColumn` | `string` | No | Include a time period column to introduce comparison columns in the report for each generated period. For example, set to QUARTERS here to have a column for each quarter present in the primary date range. If PREVIOUS PERIOD is specified in Comparison Date Range, then each quarter column will also include comparison values for its relative previous quarter. |
| `flags` | `string[]` | No | List of flags for this report. Used to flag rows in a result set based on a set of defined filters. Each row must be formatted as a JSON object. See the documentation. |
| `sorts` | `string[]` | No | Default sorts to apply to this report. Each row must be formatted as a JSON object. See the documentation. |
| `dateRange` | `string` | Yes | The date range of this report. |
| `comparisonDateRange` | `string` | No | The comparison date range of this report. If unspecified, the report will not have any comparison metrics. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "google_ad_manager",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "google_ad_manager-create-report",
  arguments: {
    parent: "Parent Network",
    name: "Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "google_ad_manager-create-report",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    google_ad_manager: { authProvisionId: "apn_xxxxxxx" },
    parent: "Parent Network",
    name: "Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "google_ad_manager-create-report",
    "configured_props": {
      "google_ad_manager": { "authProvisionId": "apn_xxxxxxx" },
      "parent": "Parent Network",
      "name": "Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/google-ad-manager.md · All apps: https://pipedream.com/apps
