Google Ads Connector

เชื่อมต่อ Google Ads กับ Brevo ผ่าน Tajo เพื่อซิงค์ advertising audiences นำเข้าข้อมูล conversion และสร้างโปรไฟล์ลูกค้าที่รวมกันซึ่งเชื่อมการซื้อโฆษณาแบบ paid กับ lifecycle marketing

ภาพรวม

คุณสมบัติค่า
แพลตฟอร์มGoogle Ads
หมวดหมู่การตลาด
ความซับซ้อนในการตั้งค่าสูง
การผสานรวมอย่างเป็นทางการไม่
ข้อมูลที่ซิงค์แคมเปญ Audiences Conversions ลูกค้า
Skills ที่มี7

ฟีเจอร์

  • การซิงค์ Customer Match - อัปโหลดรายชื่อผู้ติดต่อ Brevo ไปยัง Google Ads เป็น Customer Match audiences
  • การติดตาม Conversion - นำเข้า offline conversions จากเหตุการณ์ Brevo ไปยัง Google Ads
  • การซิงค์ Audience - การซิงค์แบบ bidirectional ระหว่างรายการ Brevo และ Google Ads audiences
  • รายงานแคมเปญ - ดึงข้อมูลประสิทธิภาพแคมเปญไปยัง Tajo dashboards
  • การติดตาม GCLID - บันทึก Google Click IDs สำหรับการระบุแหล่งที่มาของ offline conversion
  • ข้อมูล Smart bidding - ส่งข้อมูลมูลค่า conversion กลับไปยัง Google สำหรับการปรับ bid
  • การซิงค์ Lead form - นำเข้าข้อมูลจาก Google Ads lead form submissions ไปยัง Brevo contacts

ข้อกำหนดเบื้องต้น

ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:

  1. บัญชี Google Ads ที่เปิดใช้งาน API access
  2. Google Cloud project ที่เปิดใช้งาน Google Ads API
  3. OAuth 2.0 credentials (Client ID และ Client Secret)
  4. Google Ads Developer Token (สมัครที่ Google Ads API Center)
  5. บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
  6. บัญชี Tajo ที่มี API credentials

การยืนยันตัวตน

OAuth 2.0

Google Ads API ใช้ OAuth 2.0 สำหรับการยืนยันตัวตน คุณต้องได้รับ refresh token ผ่านกระบวนการ OAuth consent

Terminal window
# Required OAuth scopes
https://www.googleapis.com/auth/adwords

Developer Token

Developer Token จำเป็นสำหรับคำขอ Google Ads API ทั้งหมดและต้องได้รับการอนุมัติจาก Google

Terminal window
# 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"

การกำหนดค่า

การตั้งค่าพื้นฐาน

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"

การกำหนดค่า Customer Match

อัปโหลดผู้ติดต่อ Brevo เป็น Google Ads audiences:

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

การนำเข้า Offline Conversion

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 Endpoints

เมธอดEndpointคำอธิบาย
POST/v18/customers/{id}/googleAds:searchค้นหาแคมเปญและทรัพยากร (GAQL)
POST/v18/customers/{id}/googleAds:searchStreamStream ผลการค้นหา
POST/v18/customers/{id}/offlineUserDataJobs:createสร้าง Customer Match upload job
POST/v18/customers/{id}/conversionUploads:uploadClickConversionsอัปโหลด offline conversions
POST/v18/customers/{id}/conversionUploads:uploadCallConversionsอัปโหลด call conversions
GET/v18/customers/{id}/campaignBudgetsดึง campaign budgets
POST/v18/customers/{id}/customerLists:mutateจัดการ customer lists

ตัวอย่างโค้ด

เริ่มต้น Google Ads Connector

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'
});

อัปโหลด Customer Match Audience

// 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'
});

นำเข้า Offline Conversions

// 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'
}
]
});

Query ประสิทธิภาพแคมเปญ (GAQL)

// 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 });

ขีดจำกัดอัตรา

ทรัพยากรขีดจำกัดรายละเอียด
คำขอ API15,000/วันต่อ developer token
Mutate operations10,000/วันต่อบัญชีลูกค้า
GAQL queries1,500/วันต่อบัญชีลูกค้า
Customer Match uploads10 jobs/วันต่อ customer list
Conversion uploads2,000/คำขอต่อ upload batch
Page size10,000 แถวสูงสุดต่อ search response

การอนุมัติ Developer Token

Google Ads API ต้องการ Developer Token ที่ได้รับการอนุมัติ สมัครผ่าน Google Ads API Center ในบัญชี Manager ของคุณ บัญชีทดสอบมี rate limits ที่ลดลง

การแก้ไขปัญหา

ปัญหาสาเหตุวิธีแก้
DEVELOPER_TOKEN_NOT_APPROVEDToken รอการตรวจสอบรอการอนุมัติจาก Google หรือใช้บัญชีทดสอบ
CUSTOMER_NOT_FOUNDCustomer ID ไม่ถูกต้องลบขีดกลางออกจาก customer ID หรือตรวจสอบบัญชี manager
Customer Match match rate ต่ำข้อมูลไม่เพียงพอรวม identifiers หลายตัว (อีเมล โทรศัพท์ ชื่อ รหัสไปรษณีย์)
Conversions ไม่ปรากฏAttribution windowConversions อาจใช้เวลาสูงสุด 24 ชั่วโมงในการประมวลผล
OAUTH_TOKEN_EXPIREDRefresh token ไม่ถูกต้องยืนยันตัวตนใหม่และขอ refresh token ใหม่
PERMISSION_DENIEDสิทธิ์เข้าถึงไม่เพียงพอตรวจสอบระดับการเข้าถึง API และการเชื่อมบัญชี

แนวทางปฏิบัติที่ดีที่สุด

  1. ใช้บัญชี Manager - จัดการบัญชี Ads หลายบัญชีผ่านบัญชี Manager (MCC) เดียว
  2. Hash ข้อมูล Customer Match - Hash PII ด้วย SHA-256 เสมอก่อนอัปโหลดไปยัง Customer Match
  3. ติดตาม GCLIDs - จัดเก็บ Google Click IDs ใน Brevo attributes สำหรับการติดตาม offline conversion
  4. Batch การอัปโหลด conversion - จัดกลุ่ม conversions เป็น batches รายวันแทนการอัปโหลดแบบ real-time
  5. ใช้ GAQL สำหรับรายงาน - ใช้ Google Ads Query Language สำหรับรายงานแคมเปญที่ยืดหยุ่น
  6. ตรวจสอบ match rates - ติดตาม match rates ของ Customer Match audience และปรับปรุงคุณภาพข้อมูล
  7. ตั้งค่า Enhanced Conversions - ใช้ Enhanced Conversions เพื่อการวัด conversion ที่แม่นยำยิ่งขึ้น

ความปลอดภัย

  • OAuth 2.0 - การยืนยันตัวตนด้วย token แบบปลอดภัยพร้อม refresh tokens
  • SHA-256 hashing - ข้อมูล Customer Match ถูก hash ก่อนอัปโหลด
  • Data minimization - ส่งเฉพาะฟิลด์ที่จำเป็นไปยัง Google
  • Google Cloud compliance - สอดคล้องกับ SOC 2, ISO 27001 และ GDPR
  • Scoped access - สิทธิ์ API กำหนดขอบเขตตามบัญชีลูกค้าเฉพาะ
  • Audit logging - คำขอ API ทั้งหมดบันทึกใน Google Ads change history

แหล่งข้อมูลที่เกี่ยวข้อง

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
ผู้ช่วย AI

สวัสดี! ถามฉันเกี่ยวกับเอกสารได้เลย