Tajo-Brevo 연동 가이드
이 가이드는 Tajo 로열티 플랫폼과 Brevo를 연동해 강력한 자동화 고객 인게이지먼트 캠페인을 구성하는 전 과정을 안내합니다.
개요
Tajo-Brevo 연동으로 다음을 수행할 수 있습니다.
- 두 플랫폼 간에 고객 데이터를 실시간으로 동기화합니다
- 고객 행동을 기반으로 로열티 캠페인을 자동화합니다
- 이메일, SMS, WhatsApp 전반의 인게이지먼트를 추적합니다
- 로열티 등급과 구매 행동으로 고객을 세그먼트합니다
- 주요 로열티 이벤트에 맞춰 개인화된 메시지를 발송합니다
사전 준비 사항
연동을 시작하기 전에 다음을 준비하십시오.
- 로열티 프로그램이 구성된 Tajo 계정
- API 접근 권한이 있는 Brevo 계정
- 두 플랫폼의 유효한 API 키
- 실시간 동기화를 위해 설정된 웹훅 엔드포인트
- 안전한 데이터 전송을 위한 SSL 인증서
1단계: 인증 설정
Brevo API 키 생성
- Brevo 계정에 로그인합니다
- Account & Plan > API Keys(계정 및 요금제 > API 키)로 이동합니다
- Generate a new API key(새 API 키 생성)를 클릭합니다
- 이름을 “Tajo Integration”으로 지정합니다
- 키를 복사해 안전하게 보관합니다
# Store in environment variablesexport BREVO_API_KEY="xkeysib-your-api-key-here"export TAJO_WEBHOOK_SECRET="your-webhook-secret"Tajo 연동 구성
Tajo 대시보드에서 다음을 수행합니다.
- Settings > Integrations(설정 > 연동)으로 이동합니다
- 목록에서 Brevo를 선택합니다
- Brevo API 키를 입력합니다
- 동기화 설정을 구성합니다
{ "brevo_api_key": "xkeysib-your-api-key-here", "sync_frequency": "real-time", "sync_contacts": true, "sync_orders": true, "sync_events": true, "loyalty_attributes": [ "LOYALTY_POINTS", "LOYALTY_TIER", "TOTAL_SPENT", "LAST_PURCHASE" ]}2단계: 고객 데이터 동기화
연락처 동기화 구성
고객 데이터를 항상 최신으로 유지하도록 자동 연락처 동기화를 설정합니다.
// Sync customer on registrationasync function syncCustomerToBrevo(customer) { const brevoData = { email: customer.email, attributes: { FIRSTNAME: customer.firstName, LASTNAME: customer.lastName, PHONE: customer.phone, LOYALTY_ID: customer.loyaltyId, LOYALTY_POINTS: customer.points, LOYALTY_TIER: customer.tier, SIGNUP_DATE: customer.createdAt, TOTAL_SPENT: customer.totalSpent, PREFERRED_CATEGORIES: customer.categories, BIRTHDAY: customer.birthday }, listIds: [getListForTier(customer.tier)] };
const response = await fetch('https://api.brevo.com/v3/contacts', { method: 'POST', headers: { 'Content-Type': 'application/json', 'api-key': process.env.BREVO_API_KEY }, body: JSON.stringify(brevoData) });
return response.json();}구매 이벤트 동기화
로열티 캠페인이 실행되도록 구매 내역을 자동으로 동기화합니다.
// Sync order completionasync function syncOrderToBrevo(order, customer) { // Create order in Brevo const orderData = { id: order.id, email: customer.email, products: order.items.map(item => ({ id: item.productId, name: item.name, quantity: item.quantity, price: item.price, category: item.category })), revenue: order.total, date: order.createdAt };
await fetch('https://api.brevo.com/v3/ecommerce/orders', { method: 'POST', headers: { 'Content-Type': 'application/json', 'api-key': process.env.BREVO_API_KEY }, body: JSON.stringify(orderData) });
// Create loyalty event const eventData = { email: customer.email, event: 'Purchase Completed', properties: { order_id: order.id, amount: order.total, points_earned: order.pointsEarned, loyalty_tier: customer.tier, tier_upgraded: order.tierUpgraded, products: order.items.map(i => i.name).join(', ') } };
await fetch('https://api.brevo.com/v3/events', { method: 'POST', headers: { 'Content-Type': 'application/json', 'api-key': process.env.BREVO_API_KEY }, body: JSON.stringify(eventData) });}3단계: 자동 캠페인 설정
신규 고객 환영 캠페인
신규 로열티 회원을 위한 자동 환영 시리즈를 만듭니다.
{ "campaign_name": "Tajo Loyalty Welcome Series", "trigger": { "event": "Contact Created", "conditions": { "LOYALTY_ID": "exists", "SIGNUP_DATE": "today" } }, "emails": [ { "delay": "immediate", "template_id": 101, "subject": "Welcome to Tajo Loyalty! Here's your {{params.welcome_bonus}} points bonus", "params": { "welcome_bonus": "500", "loyalty_tier": "Bronze", "next_tier_points": "1000" } }, { "delay": "3 days", "template_id": 102, "subject": "Don't forget to use your {{params.welcome_bonus}} bonus points!" }, { "delay": "1 week", "template_id": 103, "subject": "Here's how to earn points faster with Tajo" } ]}등급 상승 캠페인
등급 상승을 자동으로 축하합니다.
// Webhook handler for tier upgradesapp.post('/webhook/tier-upgrade', (req, res) => { const { customer, previousTier, newTier } = req.body;
const campaignData = { email: customer.email, template_id: getTierUpgradeTemplate(newTier), params: { customer_name: customer.firstName, new_tier: newTier, previous_tier: previousTier, new_benefits: getTierBenefits(newTier), points_balance: customer.points } };
// Send congratulations email sendBrevoEmail(campaignData);
// Add to tier-specific list addToBrevoList(customer.email, getTierListId(newTier));
res.status(200).json({ success: true });});4단계: 로열티 이벤트 추적
추적해야 할 주요 이벤트
다음의 핵심 로열티 이벤트에 대한 추적을 설정합니다.
const loyaltyEvents = { // Account Events 'Account Created': { properties: ['signup_source', 'referral_code', 'welcome_bonus'] }, 'Profile Updated': { properties: ['updated_fields', 'marketing_consent'] },
// Purchase Events 'Purchase Completed': { properties: ['order_total', 'points_earned', 'loyalty_tier', 'products'] }, 'Product Returned': { properties: ['return_reason', 'points_deducted', 'refund_amount'] },
// Loyalty Events 'Points Earned': { properties: ['points_amount', 'earning_reason', 'total_balance'] }, 'Points Redeemed': { properties: ['points_used', 'reward_type', 'remaining_balance'] }, 'Tier Upgraded': { properties: ['previous_tier', 'new_tier', 'upgrade_benefits'] },
// Engagement Events 'Email Opened': { properties: ['campaign_type', 'subject_line', 'device'] }, 'Reward Browsed': { properties: ['reward_category', 'reward_name', 'points_required'] }, 'Referral Made': { properties: ['referral_method', 'referee_email', 'referral_bonus'] }};이벤트 추적 구현
class TajoBrevoEventTracker { constructor(apiKey) { this.apiKey = apiKey; this.baseUrl = 'https://api.brevo.com/v3'; }
async trackEvent(customerEmail, eventName, properties = {}) { const eventData = { email: customerEmail, event: eventName, properties: { timestamp: new Date().toISOString(), source: 'tajo_platform', ...properties } };
try { const response = await fetch(`${this.baseUrl}/events`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'api-key': this.apiKey }, body: JSON.stringify(eventData) });
if (!response.ok) { throw new Error(`Event tracking failed: ${response.statusText}`); }
return await response.json(); } catch (error) { console.error('Brevo event tracking error:', error); throw error; } }
// Convenience methods for common events async trackPurchase(customer, order) { return this.trackEvent(customer.email, 'Purchase Completed', { order_id: order.id, order_total: order.total, currency: order.currency, points_earned: order.pointsEarned, loyalty_tier: customer.tier, items_count: order.items.length, first_purchase: customer.orderCount === 1 }); }
async trackTierUpgrade(customer, previousTier) { return this.trackEvent(customer.email, 'Tier Upgraded', { previous_tier: previousTier, new_tier: customer.tier, points_balance: customer.points, benefits_unlocked: getTierBenefits(customer.tier), upgrade_date: new Date().toISOString() }); }}5단계: 세그먼트 전략
고객 세그먼트
개인화된 캠페인을 위해 Brevo에 타깃 세그먼트를 만듭니다.
const loyaltySegments = [ // Tier-based segments { name: "Bronze Members", conditions: { LOYALTY_TIER: "Bronze" }, campaigns: ["tier_upgrade_promotion", "engagement_boost"] }, { name: "Silver Members", conditions: { LOYALTY_TIER: "Silver" }, campaigns: ["premium_offers", "early_access"] }, { name: "Gold Members", conditions: { LOYALTY_TIER: "Gold" }, campaigns: ["vip_treatment", "exclusive_rewards"] }, { name: "Platinum Members", conditions: { LOYALTY_TIER: "Platinum" }, campaigns: ["luxury_experiences", "personal_offers"] },
// Behavior-based segments { name: "High Spenders", conditions: { TOTAL_SPENT: ">1000" }, campaigns: ["luxury_catalog", "big_spender_rewards"] }, { name: "Frequent Shoppers", conditions: { PURCHASE_FREQUENCY: "weekly" }, campaigns: ["convenience_offers", "bulk_discounts"] }, { name: "At-Risk Customers", conditions: { LAST_PURCHASE: ">90 days" }, campaigns: ["win_back", "special_incentives"] }, { name: "Birthday Month", conditions: { BIRTHDAY: "this_month" }, campaigns: ["birthday_specials", "bonus_points"] }];6단계: 테스트와 모니터링
연동 테스트 체크리스트
- 연락처 동기화: 신규 고객이 Brevo에 표시됩니다
- 주문 동기화: 구매가 이벤트를 정확히 발생시킵니다
- 이벤트 추적: 모든 로열티 이벤트가 기록됩니다
- 캠페인 실행: 자동 이메일이 정상적으로 발송됩니다
- 세그먼트: 고객이 리스트 사이를 정확히 이동합니다
- 웹훅 전송: 실시간 동기화가 안정적으로 동작합니다
모니터링 설정
// Health check endpointapp.get('/integration/health', async (req, res) => { const checks = { brevo_api: await checkBrevoConnection(), webhook_delivery: await checkWebhookDelivery(), event_tracking: await checkEventTracking(), campaign_triggers: await checkCampaignTriggers() };
const allHealthy = Object.values(checks).every(check => check.status === 'ok');
res.status(allHealthy ? 200 : 503).json({ status: allHealthy ? 'healthy' : 'degraded', checks, timestamp: new Date().toISOString() });});자주 발생하는 문제 해결
API 요청 한도
Brevo에는 요청 한도가 있으므로 재시도 로직을 구현하십시오.
async function makeBrevoRequest(url, options, retries = 3) { try { const response = await fetch(url, options);
if (response.status === 429) { const retryAfter = response.headers.get('Retry-After') || 60; await new Promise(resolve => setTimeout(resolve, retryAfter * 1000)); return makeBrevoRequest(url, options, retries - 1); }
return response; } catch (error) { if (retries > 0) { await new Promise(resolve => setTimeout(resolve, 5000)); return makeBrevoRequest(url, options, retries - 1); } throw error; }}데이터 동기화 문제
동기화 충돌을 모니터링하고 해결합니다.
// Sync conflict resolutionasync function resolveSyncConflict(tajoData, brevoData) { // Use most recent timestamp as source of truth const tajoUpdated = new Date(tajoData.updatedAt); const brevoUpdated = new Date(brevoData.modifiedAt);
if (tajoUpdated > brevoUpdated) { // Update Brevo with Tajo data await updateBrevoContact(brevoData.id, tajoData); } else { // Update Tajo with Brevo data await updateTajoCustomer(tajoData.id, brevoData); }}다음 단계
- 실시간 동기화를 위해 웹훅 설정하기
- 로열티 캠페인용 이메일 템플릿 만들기
- 긴급 알림을 위한 SMS 자동화 구성하기
- 성과 추적을 위한 분석 설정하기
지원 및 자료
- 연동 지원: [email protected]
- Brevo API 문서: api.brevo.com
- 샘플 코드 저장소: github.com/tajo/brevo-integration
- 지원 문의하기: /kr/contact