---
title: "创建事件 | Tajo"
description: "追踪客户事件，用于会员计划互动与个性化"
url: https://tajo.io/zh-cn/docs/events-engagement/create-event/
markdown: https://tajo.io/zh-cn/docs/events-engagement/create-event.md
lang: zh-CN
author: "Set Noa"
author_url: https://tajo.io/zh-cn/set-noa/
robots: noindex
---

申请抢先体验

请输入您的名字和公司电子邮箱地址。我们会发送确认 Tajo 访问申请的链接。

# 创建事件

[Set Noa](https://tajo.io/zh-cn/set-noa/)

追踪客户互动、购买行为以及会员计划中的各类活动，驱动个性化的互动体验和奖励发放。

## 快速开始

### 基础事件追踪

```http
POST https://api.brevo.com/v3/events
Content-Type: application/json
api-key: YOUR_API_KEY

{
  "email": "customer@example.com",
  "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"
  }
}
```

### 响应

```json
{
  "success": true,
  "eventId": "evt_abc123"
}
```

## 会员计划事件

### 购买事件

追踪客户的购买行为，用于发放积分并更新其会员状态：

```json
{
  "email": "customer@example.com",
  "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"
}
```

### 积分兑换

追踪客户兑换会员积分时产生的事件：

```json
{
  "email": "customer@example.com",
  "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"
  }
}
```

### 账号活动

追踪与客户账号相关的各类活动：

```json
{
  "email": "customer@example.com",
  "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"]
  }
}
```

### 互动事件

追踪客户的互动行为，作为个性化的依据：

```json
{
  "email": "customer@example.com",
  "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"
  }
}
```

## Tajo 的电商事件

### 购物车事件

```json
{
  "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
  }
}
```

```json
{
  "event": "Cart Abandoned",
  "properties": {
    "cart_value": 459.98,
    "items_count": 2,
    "potential_points_lost": 460,
    "abandonment_stage": "Checkout",
    "time_in_cart": "25 minutes"
  }
}
```

### 浏览事件

```json
{
  "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
  }
}
```

### 会员专属事件

```json
{
  "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
  }
}
```

```json
{
  "event": "Reward Earned",
  "properties": {
    "reward_type": "Birthday Bonus",
    "points_awarded": 500,
    "trigger": "Birthday",
    "total_points": 3000,
    "tier_progress": 75
  }
}
```

## 事件属性规范

### 必填属性

| 属性 | 类型 | 说明 |
| --- | --- | --- |
| `email` | String | 客户邮箱（必填） |
| `event` | String | 事件名称（必填） |
| `properties` | Object | 事件专属数据 |

### 会员场景推荐属性

| 属性 | 类型 | 说明 |
| --- | --- | --- |
| `customer_id` | String | 内部客户 ID |
| `loyalty_id` | String | 会员计划 ID |
| `points_balance` | Number | 事件发生后的当前积分 |
| `loyalty_tier` | String | 当前等级 |
| `event_value` | Number | 事件的金额价值 |

## 进阶事件追踪

### 自定义事件属性

```json
{
  "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
  }
}
```

### 批量创建事件

```json
{
  "events": [
    {
      "email": "customer1@example.com",
      "event": "Purchase Completed",
      "properties": { "order_id": "ORD-001", "amount": 99.99 }
    },
    {
      "email": "customer2@example.com",
      "event": "Points Redeemed",
      "properties": { "points_used": 500, "reward": "Free Shipping" }
    }
  ]
}
```

## 错误处理

```json
{
  "code": "invalid_event",
  "message": "Event name must be a non-empty string",
  "details": {
    "field": "event",
    "value": ""
  }
}
```

## Tajo 最佳实践

1. **统一的事件命名**：全站沿用同一套标准命名规范
2. **丰富的属性**：每个事件都要带上与会员计划相关的数据
3. **实时追踪**：事件发生后立即发送，不要批量延迟上报
4. **客户旅程**：完整追踪从购买到互动的整条转化漏斗
5. **细分数据**：带上有助于精准定向的客户属性

## 下一步

- [配置基于事件的自动化](https://tajo.io/zh-cn/docs/automation/)
- 追踪邮件互动
- 配置会员工作流
- 查看事件分析
