Tạo sự kiện
Theo dõi tương tác, đơn mua hàng và hoạt động trong chương trình khách hàng thân thiết của khách hàng để thúc đẩy tương tác cá nhân hóa và phần thưởng.
Bắt đầu nhanh
Theo dõi sự kiện cơ bản
POST https://api.brevo.com/v3/eventsContent-Type: application/jsonapi-key: YOUR_API_KEY
{ "event": "Purchase Completed", "properties": { "order_id": "ORD-2024-001", "amount": 149.99, "currency": "USD", "products": ["Product A", "Product B"], "points_earned": 150, "loyalty_tier": "Gold" }}Phản hồi
{ "success": true, "eventId": "evt_abc123"}Sự kiện chương trình khách hàng thân thiết
Sự kiện mua hàng
Theo dõi đơn mua hàng để cộng điểm và cập nhật trạng thái khách hàng thân thiết:
{ "event": "Purchase Completed", "properties": { "order_id": "ORD-2024-001", "order_total": 299.99, "currency": "USD", "payment_method": "Credit Card", "products": [ { "id": "PROD-001", "name": "Premium Widget", "category": "Electronics", "price": 149.99, "quantity": 2 } ], "points_earned": 300, "bonus_points": 50, "points_multiplier": 1.2, "loyalty_tier_before": "Silver", "loyalty_tier_after": "Gold", "tier_upgraded": true, "shipping_cost": 9.99, "discount_applied": 29.99, "coupon_code": "SAVE10" }, "eventdate": "2024-01-25T14:30:00Z"}Đổi điểm thưởng
Theo dõi thời điểm khách hàng đổi điểm thưởng:
{ "event": "Points Redeemed", "properties": { "points_redeemed": 1000, "reward_type": "Discount", "reward_value": 50.00, "reward_description": "$50 Off Next Purchase", "coupon_generated": "LOYALTY50", "expiry_date": "2024-03-25", "remaining_points": 750, "redemption_source": "Mobile App" }}Hoạt động tài khoản
Theo dõi các hoạt động liên quan đến tài khoản:
{ "event": "Account Created", "properties": { "signup_source": "Website", "referral_code": "REF-12345", "welcome_bonus": 500, "initial_tier": "Bronze", "marketing_consent": true, "sms_consent": false, "preferred_categories": ["Fashion", "Electronics"] }}Sự kiện tương tác
Theo dõi tương tác của khách hàng để cá nhân hóa:
{ "event": "Email Opened", "properties": { "campaign_id": "CAMP-001", "campaign_name": "Weekly Offers", "subject_line": "Exclusive Deals Just for You!", "open_time": "2024-01-25T09:15:00Z", "device": "Mobile", "email_client": "Gmail", "location": "New York, NY" }}Sự kiện thương mại điện tử cho Tajo
Sự kiện giỏ hàng
{ "event": "Product Added to Cart", "properties": { "product_id": "PROD-123", "product_name": "Smart Watch", "category": "Electronics", "price": 299.99, "cart_total": 459.98, "cart_items_count": 2, "potential_points": 460 }}{ "event": "Cart Abandoned", "properties": { "cart_value": 459.98, "items_count": 2, "potential_points_lost": 460, "abandonment_stage": "Checkout", "time_in_cart": "25 minutes" }}Sự kiện duyệt xem
{ "event": "Product Viewed", "properties": { "product_id": "PROD-456", "product_name": "Wireless Headphones", "category": "Electronics", "price": 199.99, "view_duration": "45 seconds", "referrer": "Search Results", "loyalty_discount_shown": true }}Sự kiện riêng của chương trình khách hàng thân thiết
{ "event": "Tier Upgraded", "properties": { "previous_tier": "Silver", "new_tier": "Gold", "points_balance": 2500, "benefits_unlocked": ["Free Shipping", "Priority Support"], "next_tier": "Platinum", "points_to_next_tier": 1500 }}{ "event": "Reward Earned", "properties": { "reward_type": "Birthday Bonus", "points_awarded": 500, "trigger": "Birthday", "total_points": 3000, "tier_progress": 75 }}Hướng dẫn về thuộc tính sự kiện
Thuộc tính bắt buộc
| Thuộc tính | Kiểu | Mô tả |
|---|---|---|
email | String | Email của khách hàng (bắt buộc) |
event | String | Tên sự kiện (bắt buộc) |
properties | Object | Dữ liệu riêng của sự kiện |
Thuộc tính nên dùng cho chương trình khách hàng thân thiết
| Thuộc tính | Kiểu | Mô tả |
|---|---|---|
customer_id | String | ID khách hàng nội bộ |
loyalty_id | String | ID chương trình khách hàng thân thiết |
points_balance | Number | Số điểm hiện tại sau sự kiện |
loyalty_tier | String | Hạng hiện tại |
event_value | Number | Giá trị tiền tệ của sự kiện |
Theo dõi sự kiện nâng cao
Thuộc tính sự kiện tùy chỉnh
{ "event": "Product Review Submitted", "properties": { "product_id": "PROD-789", "rating": 5, "review_length": "detailed", "verified_purchase": true, "points_earned": 25, "review_bonus": true, "helpful_votes": 0 }}Tạo sự kiện theo lô
{ "events": [ { "event": "Purchase Completed", "properties": { "order_id": "ORD-001", "amount": 99.99 } }, { "event": "Points Redeemed", "properties": { "points_used": 500, "reward": "Free Shipping" } } ]}Xử lý lỗi
{ "code": "invalid_event", "message": "Event name must be a non-empty string", "details": { "field": "event", "value": "" }}Thực hành tốt nhất cho Tajo
- Tên sự kiện nhất quán: Dùng quy ước đặt tên chuẩn
- Thuộc tính đầy đủ: Đưa dữ liệu liên quan đến khách hàng thân thiết vào mọi sự kiện
- Theo dõi thời gian thực: Gửi sự kiện ngay khi chúng xảy ra
- Hành trình khách hàng: Theo dõi trọn vẹn phễu mua hàng và tương tác
- Dữ liệu phân khúc: Đưa vào các thuộc tính hỗ trợ nhắm mục tiêu
Bước tiếp theo
- Thiết lập tự động hóa dựa trên sự kiện
- Theo dõi tương tác email
- Cấu hình quy trình khách hàng thân thiết
- Xem phân tích sự kiện