---
title: "Amplitude Connector"
description: "คู่มือการผสานรวม Amplitude ฉบับสมบูรณ์สำหรับการซิงค์เหตุการณ์ product analytics คุณสมบัติผู้ใช้ และ behavioral cohorts กับ Brevo ผ่าน Tajo"
url: https://tajo.io/th/docs/connectors/custom/amplitude/
markdown: https://tajo.io/th/docs/connectors/custom/amplitude.md
lang: th-TH
robots: noindex
---

ขอสิทธิ์ใช้งานล่วงหน้า

กรอกชื่อและที่อยู่อีเมลที่ทำงานของคุณ เราจะส่งลิงก์เพื่อยืนยันคำขอเข้าใช้งาน Tajo ทางอีเมล

# Amplitude Connector

สถานะตัวเชื่อม: วางแผนไว้ ยังไม่ได้สร้าง ปัจจุบัน Tajo ยังไม่ได้ใช้งานตัวเชื่อมนี้

| ฟิลด์ต้นทาง | ฟิลด์ปลายทาง | ค่าตัวอย่าง |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

เชื่อมต่อ Amplitude กับ Brevo ผ่าน Tajo เพื่อใช้ประโยชน์จากข้อมูล product analytics สำหรับระบบอัตโนมัติทางการตลาด ซิงค์ behavioral cohorts คุณสมบัติผู้ใช้ และเหตุการณ์ผลิตภัณฑ์เพื่อขับเคลื่อนแคมเปญที่กำหนดเป้าหมาย

## ภาพรวม

| คุณสมบัติ | ค่า |
| --- | --- |
| **แพลตฟอร์ม** | Amplitude |
| **หมวดหมู่** | Analytics (แบบกำหนดเอง) |
| **ความซับซ้อนในการตั้งค่า** | ปานกลาง |
| **การผสานรวมอย่างเป็นทางการ** | ไม่ |
| **ข้อมูลที่ซิงค์** | เหตุการณ์ ผู้ใช้ Cohorts คุณสมบัติ |
| **ทักษะที่มีอยู่** | 6 |

## ฟีเจอร์

- **การส่งต่อเหตุการณ์** - ส่งเหตุการณ์ track ของ Amplitude ไปยัง Brevo สำหรับทริกเกอร์ระบบอัตโนมัติทางการตลาด
- **การซิงค์ cohort** - ส่งออก behavioral cohorts ของ Amplitude เป็นรายการผู้ติดต่อ Brevo
- **การซิงค์คุณสมบัติผู้ใช้** - แมปคุณสมบัติผู้ใช้ Amplitude กับแอตทริบิวต์ผู้ติดต่อ Brevo
- **การติดตามรายได้** - ซิงค์เหตุการณ์รายได้สำหรับการวิเคราะห์มูลค่าตลอดอายุลูกค้า
- **การแบ่งกลุ่มตามพฤติกรรม** - ใช้ข้อมูลการมีส่วนร่วม Amplitude ใน Brevo segments
- **การผสานรวม HTTP V2 API** - การผสานรวมโดยตรงกับ HTTP V2 ingestion API ของ Amplitude

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

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

1. บัญชี Amplitude ที่มีโปรเจกต์ที่สร้างแล้ว
2. Amplitude API Key และ Secret Key ของคุณ
3. บัญชี Brevo ที่มีสิทธิ์เข้าถึง API
4. บัญชี Tajo ที่มีข้อมูลรับรอง API

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

### Amplitude API Keys

Amplitude ใช้คู่ API Key และ Secret Key สำหรับการยืนยันตัวตน API Key ระบุโปรเจกต์ของคุณ ในขณะที่ Secret Key ยืนยันคำขอฝั่งเซิร์ฟเวอร์

```bash
# Find your keys in Amplitude:
# Settings > Projects > [Your Project] > General
```

### การยืนยันตัวตน HTTP V2 API

HTTP V2 API ใช้ API key ในเนื้อหาคำขอ:

```bash
curl -X POST https://api2.amplitude.com/2/httpapi \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_AMPLITUDE_API_KEY",
    "events": [...]
  }'
```

## การกำหนดค่า

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

```yaml
connectors:
  amplitude:
    enabled: true
    api_key: "your-amplitude-api-key"
    secret_key: "your-amplitude-secret-key"
    data_center: "US"  # or "EU"

    # Data sync options
    sync:
      events: true
      user_properties: true
      cohorts: true
      revenue: true

    # Brevo list assignment
    lists:
      active_users: 10
      power_users: 11
      churning_users: 12
```

### การแมปเหตุการณ์

แมปเหตุการณ์ Amplitude กับทริกเกอร์ระบบอัตโนมัติ Brevo:

```yaml
event_mapping:
  # Amplitude event -> Brevo event
  "Purchase": "order_completed"
  "Sign Up": "customer_created"
  "Add to Cart": "cart_updated"
  "Page View": "page_viewed"
  "Feature Click": "feature_used"

  # Revenue events
  "Revenue": "revenue_event"
  "Subscription Started": "subscription_created"
```

### การแมปคุณสมบัติผู้ใช้

แมปคุณสมบัติผู้ใช้ Amplitude กับแอตทริบิวต์ผู้ติดต่อ Brevo:

```yaml
property_mapping:
  # Amplitude property -> Brevo attribute
  email: email
  first_name: FIRSTNAME
  last_name: LASTNAME
  phone: SMS
  plan_type: PLAN
  signup_date: SIGNUP_DATE
  total_purchases: ORDER_COUNT
  lifetime_revenue: LTV
  last_active: LAST_ACTIVE
  device_type: DEVICE
```

## API Endpoints

| เมธอด | Endpoint | คำอธิบาย |
| --- | --- | --- |
| `POST` | `/2/httpapi` | อัปโหลดเหตุการณ์ (HTTP V2 API) |
| `POST` | `/batch` | อัปโหลดเหตุการณ์แบบ Bulk (Batch API) |
| `POST` | `/identify` | ตั้งค่าคุณสมบัติผู้ใช้ |
| `POST` | `/groupidentify` | ตั้งค่าคุณสมบัติกลุ่ม |
| `GET` | `/2/export` | ส่งออกข้อมูลเหตุการณ์ดิบ |
| `GET` | `/2/usersearch` | ค้นหาผู้ใช้ |
| `GET` | `/2/useractivity` | ดูไทม์ไลน์กิจกรรมผู้ใช้ |
| `POST` | `/api/3/cohort/export` | ส่งออกสมาชิก cohort |
| `GET` | `/api/3/chart/{chart_id}/query` | Query ข้อมูลแผนภูมิที่บันทึกไว้ |

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

### เริ่มต้น Amplitude Connector

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

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

// Connect Amplitude project
await tajo.connectors.connect('amplitude', {
  apiKey: process.env.AMPLITUDE_API_KEY,
  secretKey: process.env.AMPLITUDE_SECRET_KEY,
  dataCenter: 'US'
});
```

### ส่งเหตุการณ์ผ่าน HTTP V2 API

```javascript
// Send events to Amplitude (automatically forwarded to Brevo)
const response = await fetch('https://api2.amplitude.com/2/httpapi', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    api_key: process.env.AMPLITUDE_API_KEY,
    events: [
      {
        user_id: "user_123",
        event_type: "Purchase",
        event_properties: {
          revenue: 89.99,
          product_id: "SKU-001",
          product_name: "Widget Pro"
        },
        user_properties: {
          $set: {
            email: "jane@example.com",
            plan_type: "premium"
          }
        },
        time: Date.now()
      }
    ]
  })
});

// Expected response: { "code": 200, "events_ingested": 1 }
```

### ซิงค์ Cohort กับรายการ Brevo

```javascript
// Export an Amplitude cohort and sync to Brevo
const cohort = await tajo.connectors.syncCohort('amplitude', {
  cohortId: 'abc123',
  targetList: 11,  // Brevo list ID
  syncMode: 'mirror'  // mirror, append, or remove
});

console.log(cohort);
// {
//   cohortName: "Power Users",
//   membersCount: 2450,
//   syncedToBrevo: 2450,
//   listId: 11
// }
```

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

| API | ขีดจำกัด | รายละเอียด |
| --- | --- | --- |
| **HTTP V2 API** | 1,000 เหตุการณ์/วินาที | ต่อโปรเจกต์ burst ได้ถึง 2,000/วินาที |
| **Batch API** | 1,000 เหตุการณ์/batch | สูงสุด 20 batches/วินาที |
| **Identify API** | 1,000 req/วินาที | ต่อโปรเจกต์ |
| **Export API** | 360 คำขอ/ชั่วโมง | ต่อโปรเจกต์ |
| **Cohort Export** | 1 concurrent export | ต่อ cohort |
| **Dashboard REST API** | 360 คำขอ/ชั่วโมง | ต่อโปรเจกต์ |

ขีดจำกัดขนาดเหตุการณ์

payload เหตุการณ์แต่ละรายการต้องไม่เกิน 1 MB HTTP V2 API รับได้สูงสุด 2,000 เหตุการณ์ต่อคำขอพร้อมขนาด body สูงสุด 20 MB

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

| ปัญหา | สาเหตุ | วิธีแก้ |
| --- | --- | --- |
| เหตุการณ์ส่งคืนสถานะ `invalid` | ฟิลด์ที่จำเป็นหายไป | ตรวจสอบให้แน่ใจว่า `user_id` หรือ `device_id` ถูกตั้งค่าในทุกเหตุการณ์ |
| คุณสมบัติผู้ใช้ไม่ซิงค์ | ตัวดำเนินการคุณสมบัติไม่ถูกต้อง | ใช้ `$set` สำหรับการตั้งค่า `$setOnce` สำหรับค่า first-touch |
| ส่งออก cohort ว่างเปล่า | Cohort ยังคำนวณอยู่ | รอให้การคำนวณ cohort เสร็จสมบูรณ์ก่อนส่งออก |
| 429 Too Many Requests | เกินขีดจำกัดอัตรา | ใช้ exponential backoff และ batch API |
| ไม่ติดตามรายได้ | ฟิลด์รายได้หายไป | ใส่ `price`, `quantity` และ `revenue` ในคุณสมบัติเหตุการณ์ |
| ข้อมูล EU ไม่ถูกกำหนดเส้นทาง | data center ไม่ถูกต้อง | ตั้งค่า `data_center: "EU"` และใช้ `api.eu.amplitude.com` |

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

1. **ใช้ HTTP V2 API** - ใช้ V2 API แทน legacy HTTP API สำหรับการตรวจสอบและการตอบสนองข้อผิดพลาดที่ดีกว่า
2. **Batch เหตุการณ์** - ส่งเหตุการณ์ในกลุ่มละสูงสุด 1,000 เพื่อปริมาณงานที่เหมาะสม
3. **ตั้งค่าคุณสมบัติผู้ใช้บนเหตุการณ์** - รวม `user_properties` บน track events เพื่อลดการเรียก identify
4. **ใช้ cohorts สำหรับการแบ่งกลุ่ม** - ซิงค์ behavioral cohorts แทนที่จะทำซ้ำตรรกะการแบ่งกลุ่มที่ซับซ้อน
5. **ติดตามเหตุการณ์รายได้อย่างถูกต้อง** - ใช้ฟิลด์ `revenue`, `price` และ `productId` สำหรับการติดตามรายได้ที่แม่นยำ
6. **ตรวจสอบสุขภาพ ingestion** - ตรวจสอบ Ingestion Debugger ของ Amplitude สำหรับข้อผิดพลาดการตรวจสอบเหตุการณ์
7. **ใช้การติดตามฝั่งเซิร์ฟเวอร์** - ใช้ server-side SDKs สำหรับการส่งเหตุการณ์ที่เชื่อถือได้

## ความปลอดภัย

- **HTTPS เท่านั้น** - การสื่อสาร API ทั้งหมดต้องการ TLS 1.2+
- **การหมุนเวียน API key** - หมุนเวียน Secret Keys เป็นระยะผ่านการตั้งค่า Amplitude
- **IP allowlisting** - มีในแผน Enterprise
- **SOC 2 Type II** - Amplitude ได้รับการรับรอง SOC 2 Type II
- **GDPR/CCPA** - รองรับการลบและส่งออกข้อมูลผู้ใช้
- **EU data residency** - มีตัวเลือก EU data center

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

- [Segment Connector](https://tajo.io/th/docs/connectors/custom/segment)
- [Mixpanel Connector](https://tajo.io/th/docs/connectors/custom/mixpanel)
- [Customer Sync Skill](https://tajo.io/th/docs/skills/data-sync/customer-sync)
- [Brevo Events API](https://tajo.io/th/docs/events-engagement/create-event)
