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
ข้อกำหนดเบื้องต้น
ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:
- บัญชี Google Ads ที่เปิดใช้งาน API access
- Google Cloud project ที่เปิดใช้งาน Google Ads API
- OAuth 2.0 credentials (Client ID และ Client Secret)
- Google Ads Developer Token (สมัครที่ Google Ads API Center)
- บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
- บัญชี Tajo ที่มี API credentials
การยืนยันตัวตน
OAuth 2.0
Google Ads API ใช้ OAuth 2.0 สำหรับการยืนยันตัวตน คุณต้องได้รับ refresh token ผ่านกระบวนการ OAuth consent
# Required OAuth scopeshttps://www.googleapis.com/auth/adwordsDeveloper Token
Developer Token จำเป็นสำหรับคำขอ Google Ads API ทั้งหมดและต้องได้รับการอนุมัติจาก Google
# Set up authentication headerscurl -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:searchStream | Stream ผลการค้นหา |
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 accountawait 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 Matchawait tajo.connectors.syncAudience('google-ads', { brevoListId: 5, audienceName: 'High Value Customers', matchType: 'CONTACT_INFO', syncMode: 'mirror'});นำเข้า Offline Conversions
// Upload offline conversions from Brevo order eventsawait 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 Languageconst 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/วัน | ต่อ developer token |
| Mutate operations | 10,000/วัน | ต่อบัญชีลูกค้า |
| GAQL queries | 1,500/วัน | ต่อบัญชีลูกค้า |
| Customer Match uploads | 10 jobs/วัน | ต่อ customer list |
| Conversion uploads | 2,000/คำขอ | ต่อ upload batch |
| Page size | 10,000 แถว | สูงสุดต่อ search response |
การอนุมัติ Developer Token
Google Ads API ต้องการ Developer Token ที่ได้รับการอนุมัติ สมัครผ่าน Google Ads API Center ในบัญชี Manager ของคุณ บัญชีทดสอบมี rate limits ที่ลดลง
การแก้ไขปัญหา
| ปัญหา | สาเหตุ | วิธีแก้ |
|---|---|---|
DEVELOPER_TOKEN_NOT_APPROVED | Token รอการตรวจสอบ | รอการอนุมัติจาก Google หรือใช้บัญชีทดสอบ |
CUSTOMER_NOT_FOUND | Customer ID ไม่ถูกต้อง | ลบขีดกลางออกจาก customer ID หรือตรวจสอบบัญชี manager |
| Customer Match match rate ต่ำ | ข้อมูลไม่เพียงพอ | รวม identifiers หลายตัว (อีเมล โทรศัพท์ ชื่อ รหัสไปรษณีย์) |
| Conversions ไม่ปรากฏ | Attribution window | Conversions อาจใช้เวลาสูงสุด 24 ชั่วโมงในการประมวลผล |
OAUTH_TOKEN_EXPIRED | Refresh token ไม่ถูกต้อง | ยืนยันตัวตนใหม่และขอ refresh token ใหม่ |
PERMISSION_DENIED | สิทธิ์เข้าถึงไม่เพียงพอ | ตรวจสอบระดับการเข้าถึง API และการเชื่อมบัญชี |
แนวทางปฏิบัติที่ดีที่สุด
- ใช้บัญชี Manager - จัดการบัญชี Ads หลายบัญชีผ่านบัญชี Manager (MCC) เดียว
- Hash ข้อมูล Customer Match - Hash PII ด้วย SHA-256 เสมอก่อนอัปโหลดไปยัง Customer Match
- ติดตาม GCLIDs - จัดเก็บ Google Click IDs ใน Brevo attributes สำหรับการติดตาม offline conversion
- Batch การอัปโหลด conversion - จัดกลุ่ม conversions เป็น batches รายวันแทนการอัปโหลดแบบ real-time
- ใช้ GAQL สำหรับรายงาน - ใช้ Google Ads Query Language สำหรับรายงานแคมเปญที่ยืดหยุ่น
- ตรวจสอบ match rates - ติดตาม match rates ของ Customer Match audience และปรับปรุงคุณภาพข้อมูล
- ตั้งค่า 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