---
title: "Google Ads 连接器"
description: "完整的 Google Ads 集成指南，通过 Tajo 将广告系列数据、受众群体和转化跟踪与 Brevo 同步。"
url: https://tajo.io/zh-cn/docs/connectors/marketing/google-ads/
markdown: https://tajo.io/zh-cn/docs/connectors/marketing/google-ads.md
lang: zh-CN
robots: noindex
---

申请抢先体验

请输入您的名字和公司电子邮箱地址。我们会发送确认 Tajo 访问申请的链接。

# Google Ads 连接器

连接器状态: 计划中 尚未构建。Tajo 目前不运行此连接器。

| 来源字段 | 目标字段 | 示例值 |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

通过 Tajo 将 Google Ads 连接到 Brevo，同步广告受众群体、导入转化数据，并创建统一的客户档案，将付费获客与生命周期营销相衔接。

## 概览

| 属性 | 值 |
| --- | --- |
| **平台** | Google Ads |
| **类别** | 营销 |
| **设置复杂度** | 高级 |
| **官方集成** | 否 |
| **同步数据** | 广告系列、受众群体、转化、客户 |
| **可用技能** | 7 |

## 功能

- **客户匹配同步** - 将 Brevo 联系人列表上传为 Google Ads 客户匹配受众群体
- **转化跟踪** - 将 Brevo 事件中的线下转化导入 Google Ads
- **受众群体同步** - Brevo 列表和 Google Ads 受众群体的双向同步
- **广告系列报告** - 将广告系列绩效数据拉取到 Tajo 仪表板
- **GCLID 跟踪** - 捕获 Google 点击 ID，用于线下转化归因
- **智能出价数据** - 将转化价值数据回传给 Google 进行出价优化
- **潜在客户表单同步** - 将 Google Ads 潜在客户表单提交内容导入 Brevo 联系人

## 前提条件

开始之前，请确保您已具备：

1. 已启用 API 访问权限的 Google Ads 账户
2. 已启用 Google Ads API 的 Google Cloud 项目
3. OAuth 2.0 凭据（客户端 ID 和客户端密钥）
4. Google Ads 开发者令牌（在 [Google Ads API 中心](https://ads.google.com/aw/apicenter)申请）
5. 具有 API 访问权限的 Brevo 账户
6. 具有 API 凭据的 Tajo 账户

## 认证

### OAuth 2.0

Google Ads API 使用 OAuth 2.0 进行认证。您需要通过 OAuth 授权流程获取刷新令牌。

```bash
# Required OAuth scopes
https://www.googleapis.com/auth/adwords
```

### 开发者令牌

所有 Google Ads API 请求都需要开发者令牌，且必须经过 Google 批准。

```bash
# Set up authentication headers
curl -X POST https://googleads.googleapis.com/v18/customers/1234567890/googleAds:search \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "developer-token: DEVELOPER_TOKEN" \
  -H "login-customer-id: MANAGER_ACCOUNT_ID"
```

## 配置

### 基础设置

```yaml
connectors:
  google_ads:
    enabled: true
    developer_token: "your-developer-token"
    oauth:
      client_id: "your-client-id"
      client_secret: "your-client-secret"
      refresh_token: "your-refresh-token"
    customer_id: "123-456-7890"
    login_customer_id: "111-222-3333"  # Manager account (optional)

    # Data sync options
    sync:
      customer_match: true
      conversions: true
      campaigns: true
      lead_forms: true

    # Conversion tracking
    conversions:
      action_id: "123456789"
      default_currency: "USD"
```

### 客户匹配配置

将 Brevo 联系人上传为 Google Ads 受众群体：

```yaml
customer_match:
  enabled: true
  lists:
    - brevo_list_id: 5
      audience_name: "All Customers"
      match_type: "CONTACT_INFO"
    - brevo_list_id: 7
      audience_name: "High Value Customers"
      match_type: "CONTACT_INFO"

  # Data fields to match
  match_fields:
    - email
    - phone
    - first_name
    - last_name
    - country_code
    - zip_code

  # Sync schedule
  schedule: "daily"
  sync_mode: "mirror"  # mirror, append, or remove
```

### 线下转化导入

```yaml
conversion_import:
  enabled: true
  conversion_action: "purchase"
  gclid_attribute: "GCLID"  # Brevo attribute storing GCLID
  conversion_events:
    - brevo_event: "order_completed"
      conversion_name: "Purchase"
      value_field: "revenue"
    - brevo_event: "subscription_created"
      conversion_name: "Subscription"
      value_field: "plan_value"
```

## API 端点

| 方法 | 端点 | 描述 |
| --- | --- | --- |
| `POST` | `/v18/customers/{id}/googleAds:search` | 搜索广告系列和资源（GAQL） |
| `POST` | `/v18/customers/{id}/googleAds:searchStream` | 流式传输搜索结果 |
| `POST` | `/v18/customers/{id}/offlineUserDataJobs:create` | 创建客户匹配上传任务 |
| `POST` | `/v18/customers/{id}/conversionUploads:uploadClickConversions` | 上传线下转化 |
| `POST` | `/v18/customers/{id}/conversionUploads:uploadCallConversions` | 上传通话转化 |
| `GET` | `/v18/customers/{id}/campaignBudgets` | 获取广告系列预算 |
| `POST` | `/v18/customers/{id}/customerLists:mutate` | 管理客户列表 |

## 代码示例

### 初始化 Google Ads 连接器

```javascript
import { TajoClient } from '@tajo/sdk';

const tajo = new TajoClient({
  apiKey: process.env.TAJO_API_KEY,
  brevoApiKey: process.env.BREVO_API_KEY
});

// Connect Google Ads account
await tajo.connectors.connect('google-ads', {
  developerToken: process.env.GOOGLE_ADS_DEV_TOKEN,
  clientId: process.env.GOOGLE_OAUTH_CLIENT_ID,
  clientSecret: process.env.GOOGLE_OAUTH_CLIENT_SECRET,
  refreshToken: process.env.GOOGLE_OAUTH_REFRESH_TOKEN,
  customerId: '123-456-7890'
});
```

### 上传客户匹配受众群体

```javascript
// Sync a Brevo list to Google Ads Customer Match
await tajo.connectors.syncAudience('google-ads', {
  brevoListId: 5,
  audienceName: 'High Value Customers',
  matchType: 'CONTACT_INFO',
  syncMode: 'mirror'
});
```

### 导入线下转化

```javascript
// Upload offline conversions from Brevo order events
await tajo.connectors.uploadConversions('google-ads', {
  conversionAction: 'customers/123456/conversionActions/789',
  conversions: [
    {
      gclid: 'CjwKCAiA...',
      conversionDateTime: '2024-01-15 10:30:00-05:00',
      conversionValue: 89.99,
      currencyCode: 'USD'
    }
  ]
});
```

### 查询广告系列效果（GAQL）

```javascript
// Query campaign metrics using Google Ads Query Language
const query = `
  SELECT
    campaign.name,
    campaign.status,
    metrics.impressions,
    metrics.clicks,
    metrics.cost_micros,
    metrics.conversions
  FROM campaign
  WHERE segments.date DURING LAST_30_DAYS
  ORDER BY metrics.impressions DESC
  LIMIT 20
`;

const results = await tajo.connectors.query('google-ads', { gaql: query });
```

## 速率限制

| 资源 | 限制 | 详情 |
| --- | --- | --- |
| **API 请求** | 15,000/天 | 每个开发者令牌 |
| **变更操作** | 10,000/天 | 每个客户账户 |
| **GAQL 查询** | 1,500/天 | 每个客户账户 |
| **客户匹配上传** | 10 个任务/天 | 每个客户列表 |
| **转化上传** | 2,000/请求 | 每个上传批次 |
| **页面大小** | 10,000 行 | 每次搜索响应最大值 |

开发者令牌审批

Google Ads API 需要经过批准的开发者令牌。通过您的管理账户在 Google Ads API 中心申请。测试账户的速率限制较低。

## 故障排除

| 问题 | 原因 | 解决方案 |
| --- | --- | --- |
| `DEVELOPER_TOKEN_NOT_APPROVED` | 令牌待审核 | 等待 Google 批准或使用测试账户 |
| `CUSTOMER_NOT_FOUND` | 客户 ID 错误 | 从客户 ID 中删除连字符或检查管理账户 |
| 客户匹配率低 | 数据不足 | 包含多个标识符（邮箱、电话、姓名、邮编） |
| 转化未显示 | 归因窗口 | 转化最多需要 24 小时才能处理 |
| `OAUTH_TOKEN_EXPIRED` | 刷新令牌无效 | 重新认证并获取新的刷新令牌 |
| `PERMISSION_DENIED` | 访问权限不足 | 检查 API 访问级别和账户关联 |

## 最佳实践

1. **使用管理账户** - 通过单个管理账户（MCC）管理多个 Ads 账户
2. **哈希客户匹配数据** - 上传到客户匹配前始终使用 SHA-256 哈希个人身份信息
3. **跟踪 GCLID** - 在 Brevo 属性中存储 Google 点击 ID，用于线下转化跟踪
4. **批量上传转化** - 将转化分组为每日批次，而非实时上传
5. **使用 GAQL 进行报告** - 利用 Google Ads 查询语言进行灵活的广告系列报告
6. **监控匹配率** - 跟踪客户匹配受众群体的匹配率并提高数据质量
7. **设置增强型转化** - 使用增强型转化实现更准确的转化衡量

## 安全

- **OAuth 2.0** - 使用刷新令牌的安全基于令牌的认证
- **SHA-256 哈希** - 客户匹配数据在上传前进行哈希处理
- **数据最小化** - 仅向 Google 传输所需字段
- **Google Cloud 合规** - 符合 SOC 2、ISO 27001 和 GDPR
- **限定访问** - API 权限限定在特定客户账户范围内
- **审计日志** - 所有 API 请求记录在 Google Ads 变更历史中

## 相关资源

- [Meta Ads 连接器](https://tajo.io/zh-cn/docs/connectors/marketing/meta-ads)
- [Klaviyo 连接器](https://tajo.io/zh-cn/docs/connectors/marketing/klaviyo)
- [Brevo 连接器](https://tajo.io/zh-cn/docs/connectors/marketing/brevo)
- [客户同步技能](https://tajo.io/zh-cn/docs/skills/data-sync/customer-sync)
