Trình Kết Nối Mailchimp

Kết nối tài khoản Mailchimp của bạn với Brevo qua Tajo để migration audience liền mạch, đồng bộ dữ liệu campaign và marketing automation hợp nhất trên cả hai nền tảng.

Tổng Quan

Thuộc TínhGiá Trị
Nền TảngMailchimp
Danh MụcMarketing
Độ Phức Tạp Thiết LậpDễ
Tích Hợp Chính Thức
Dữ Liệu Đồng BộContacts, Campaigns, Automations, Sự Kiện
URL API Cơ Sởhttps://{dc}.api.mailchimp.com/3.0

Tính Năng

  • Đồng bộ audience - Migrate và đồng bộ Mailchimp audiences với danh sách contacts Brevo
  • Dữ liệu campaign - Đồng bộ dữ liệu hiệu suất campaign cho báo cáo hợp nhất
  • Migration automation - Ánh xạ Mailchimp automations sang Brevo workflows
  • Số liệu tương tác - Đồng bộ opens, clicks và bounce data sang thuộc tính Brevo
  • Ánh xạ segment - Sao chép Mailchimp segments như Brevo lists hoặc segments
  • Dữ liệu E-commerce - Đồng bộ store, product và order data từ Mailchimp e-commerce
  • Đồng bộ tag - Ánh xạ Mailchimp tags sang thuộc tính liên hệ Brevo hoặc lists
  • Migration template - Xuất Mailchimp templates để dùng trong Brevo campaigns

Yêu Cầu

Trước khi bắt đầu, hãy đảm bảo bạn có:

  1. Tài khoản Mailchimp (Free, Essentials, Standard, hoặc Premium)
  2. Mailchimp API key hoặc OAuth app
  3. Tài khoản Brevo với quyền truy cập API
  4. Tài khoản Tajo

Xác Thực

Xác Thực API Key

Tạo API key trong Mailchimp Account > Extras > API Keys.

Terminal window
curl https://{dc}.api.mailchimp.com/3.0/ping \
--user "anystring:{api_key}" \
-H "Content-Type: application/json"

Tiền tố data center {dc} là phần cuối của API key (ví dụ: us21).

OAuth 2.0

Cho tích hợp đa tài khoản:

Terminal window
# Authorization URL
https://login.mailchimp.com/oauth2/authorize?
response_type=code&
client_id={client_id}&
redirect_uri={redirect_uri}
# Đổi token
curl -X POST https://login.mailchimp.com/oauth2/token \
-d "grant_type=authorization_code" \
-d "client_id={client_id}" \
-d "client_secret={client_secret}" \
-d "redirect_uri={redirect_uri}" \
-d "code={auth_code}"

Data Center

Luôn trích xuất data center từ API key hoặc OAuth metadata endpoint. Sử dụng sai data center sẽ dẫn đến lỗi xác thực.

Cấu Hình

Thiết Lập Cơ Bản

connectors:
mailchimp:
enabled: true
api_key: "${MAILCHIMP_API_KEY}"
data_center: "us21"
# Tùy chọn đồng bộ dữ liệu
sync:
audiences: true
campaigns: true
automations: true
ecommerce: true
# Ánh xạ audience sang danh sách Brevo
audience_mapping:
"Main Audience": 40
"Newsletter": 41
"Customers": 42

Ánh Xạ Trường

Ánh xạ Mailchimp merge fields sang thuộc tính liên hệ Brevo:

Ánh Xạ Mặc Định

Parameter Type Description
email_address required
string

Email subscriber (định danh duy nhất)

FNAME optional
string

Merge field tên, ánh xạ sang FIRSTNAME

LNAME optional
string

Merge field họ, ánh xạ sang LASTNAME

PHONE optional
string

Merge field điện thoại, ánh xạ sang SMS

status optional
string

Trạng thái subscription (subscribed, unsubscribed, cleaned, pending)

tags optional
array

Tags subscriber để phân đoạn

stats.avg_open_rate optional
number

Tỷ lệ mở email trung bình

stats.avg_click_rate optional
number

Tỷ lệ click email trung bình

Ánh Xạ Custom Merge Field

field_mapping:
# Trường tiêu chuẩn
email_address: email
FNAME: FIRSTNAME
LNAME: LASTNAME
PHONE: SMS
# Số liệu tương tác
stats.avg_open_rate: AVG_OPEN_RATE
stats.avg_click_rate: AVG_CLICK_RATE
member_rating: ENGAGEMENT_SCORE
# Trường E-commerce
ecommerce_data.total_revenue: TOTAL_REVENUE
ecommerce_data.number_of_orders: ORDER_COUNT
# Custom merge fields
MMERGE5: COMPANY_NAME
MMERGE6: CUSTOMER_TYPE

API Endpoints

Audiences (Lists)

Phương ThứcEndpointMô Tả
GET/3.0/listsLiệt kê tất cả audiences
GET/3.0/lists/{list_id}Lấy chi tiết audience
GET/3.0/lists/{list_id}/membersLiệt kê audience members
POST/3.0/lists/{list_id}/membersThêm member
PUT/3.0/lists/{list_id}/members/{hash}Cập nhật member
POST/3.0/lists/{list_id}Batch subscribe/unsubscribe

Campaigns

Phương ThứcEndpointMô Tả
GET/3.0/campaignsLiệt kê campaigns
GET/3.0/campaigns/{id}Lấy chi tiết campaign
GET/3.0/reports/{id}Lấy báo cáo campaign
GET/3.0/reports/{id}/email-activityLấy email activity

Automations

Phương ThứcEndpointMô Tả
GET/3.0/automationsLiệt kê automations
GET/3.0/automations/{id}Lấy chi tiết automation
GET/3.0/automations/{id}/emailsLiệt kê automation emails

E-commerce

Phương ThứcEndpointMô Tả
GET/3.0/ecommerce/storesLiệt kê connected stores
GET/3.0/ecommerce/stores/{id}/customersLiệt kê store customers
GET/3.0/ecommerce/stores/{id}/ordersLiệt kê store orders
GET/3.0/ecommerce/stores/{id}/productsLiệt kê store products

Sự Kiện

Sự Kiện Campaign

Sự KiệnKích HoạtTrường Hợp Sử Dụng
campaign.sentCampaign được gửiTheo dõi hiệu suất
campaign.openedEmail được mởĐánh giá tương tác
campaign.clickedLink được nhấpTheo dõi sở thích
campaign.bouncedEmail bounceVệ sinh danh sách

Sự Kiện Subscriber

Sự KiệnKích HoạtTrường Hợp Sử Dụng
subscribeSubscriber mới được thêmLuồng chào mừng
unsubscribeSubscriber hủy đăng kýQuản lý tùy chọn
profileProfile được cập nhậtĐồng bộ thuộc tính
cleanedEmail được làm sạch (bounce)Bảo trì danh sách

Sự Kiện E-commerce

Sự KiệnKích HoạtTrường Hợp Sử Dụng
ecommerce.orderOrder được đặtLuồng sau mua hàng
ecommerce.cartCart được cập nhậtRecovery giỏ hàng bị bỏ

Ví Dụ Code

Khởi Tạo Trình Kết Nối

import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({
apiKey: process.env.TAJO_API_KEY,
brevoApiKey: process.env.BREVO_API_KEY
});
// Kết nối Mailchimp
await tajo.connectors.connect('mailchimp', {
apiKey: process.env.MAILCHIMP_API_KEY
});

Migrate Audiences Sang Brevo

// Migration audience đầy đủ từ Mailchimp sang Brevo
await tajo.connectors.sync('mailchimp', {
type: 'full',
resources: ['audiences', 'campaigns', 'ecommerce'],
options: {
preserveTags: true,
migrateSegments: true,
includeUnsubscribed: false
}
});
// Kiểm tra trạng thái migration
const status = await tajo.connectors.status('mailchimp');
console.log(status);
// {
// connected: true,
// lastSync: '2024-01-15T10:30:00Z',
// contactsMigrated: 52000,
// campaignsSynced: 245,
// segmentsMapped: 18
// }

Đồng Bộ Dữ Liệu Campaign Engagement

// Đồng bộ hiệu suất campaign sang thuộc tính Brevo
await tajo.connectors.sync('mailchimp', {
type: 'incremental',
resources: ['campaigns'],
options: {
syncEngagement: true,
updateContactMetrics: true,
since: '2024-01-01'
}
});

Giới Hạn Tốc Độ

Giới hạn tốc độ Mailchimp Marketing API:

LoạiGiới HạnChi Tiết
Tiêu chuẩn10 yêu cầu đồng thờiMỗi API key
Batch operations500 thao tác mỗi batchMỗi request
Export limit1 export đồng thờiMỗi tài khoản
Transactional25 yêu cầu/giâyMỗi API key

Chiến Lược Giới Hạn Tốc Độ

Mailchimp giới hạn connections đồng thời thay vì requests mỗi giây. Sử dụng batch endpoints và triển khai retry logic với exponential backoff khi nhận phản hồi 429.

Khắc Phục Sự Cố

Sự Cố Phổ Biến

Sự CốNguyên NhânGiải Pháp
401 UnauthorizedAPI key không hợp lệ hoặc sai data centerXác minh API key và trích xuất tiền tố dc đúng
Member đã tồn tạiEmail đã có trong audienceSử dụng PUT thay vì POST để cập nhật members hiện có
Compliance stateXóa GDPR ngăn re-addContact phải tự đăng ký lại qua signup form
Batch timeoutThao tác batch lớnChia thành batches nhỏ hơn 500 thao tác
Thiếu merge fieldsCustom fields chưa được tạoTạo merge fields trong Mailchimp trước khi ánh xạ

Chế Độ Debug

Bật verbose logging:

connectors:
mailchimp:
debug: true
log_level: verbose
log_api_calls: true

Kiểm Tra Kết Nối

Terminal window
tajo connectors test mailchimp
# ✓ API connection successful
# ✓ Audiences readable
# ✓ Campaigns readable
# ✓ E-commerce data accessible
# ✓ Webhook configured

Thực Hành Tốt Nhất

  1. Sử dụng batch operations - Sử dụng batch subscribe/unsubscribe cho cập nhật hàng loạt
  2. Bảo toàn subscriber status - Tôn trọng subscriber consent trong quá trình migration
  3. Ánh xạ merge fields trước - Tạo thuộc tính Brevo tương ứng trước khi đồng bộ
  4. Đồng bộ engagement data - Nhập open/click rates cho phân đoạn lịch sử
  5. Xử lý compliance states - Tôn trọng trạng thái GDPR và permanent deletion
  6. Sử dụng incremental sync - Chỉ đồng bộ thay đổi kể từ lần đồng bộ cuối để giảm tải API

Bảo Mật

  • Xác thực API Key - Secret key được truyền qua HTTP Basic Auth password
  • OAuth 2.0 - Ủy quyền dựa trên token cho truy cập đa tài khoản
  • Mã hóa TLS - Tất cả giao tiếp API được mã hóa qua HTTPS
  • Xác minh Webhook - Xác thực nguồn gốc webhook với shared secret
  • Cô lập data center - Dữ liệu được lưu trữ trong data centers theo khu vực

Tài Nguyên Liên Quan

Subscribe to updates

developer-docs

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

auto-detect
Trợ lý AI

Xin chào! Hãy hỏi tôi về tài liệu.