---
title: "Konektor Mixpanel"
description: "Panduan integrasi Mixpanel lengkap untuk menyinkronkan event analitik produk, profil pengguna, dan cohort dengan Brevo melalui Tajo."
url: https://tajo.io/in/docs/connectors/custom/mixpanel/
markdown: https://tajo.io/in/docs/connectors/custom/mixpanel.md
lang: id-ID
robots: noindex
---

Ajukan akses awal

Masukkan nama depan dan alamat email kerja Anda. Kami akan mengirim tautan untuk mengonfirmasi permintaan akses Tajo.

# Konektor Mixpanel

Status konektor: Direncanakan Belum dibangun. Tajo belum menjalankan konektor ini.

| Field sumber | Field tujuan | Nilai contoh |
| --- | --- | --- |
| `record.id` | `source_id` | `record_1042` |
| `record.updated_at` | `updated_at` | `2026-10-18T08:00:00Z` |
| `record.value` | `value` | `sample_value` |

Hubungkan Mixpanel ke Brevo melalui Tajo untuk menjembatani analitik produk dengan otomatisasi pemasaran. Sinkronkan profil pengguna, event perilaku, dan cohort untuk membuat kampanye berbasis data dari penggunaan produk yang sebenarnya.

## Ikhtisar

| Properti | Nilai |
| --- | --- |
| **Platform** | Mixpanel |
| **Kategori** | Analitik (Custom) |
| **Kompleksitas setup** | Sedang |
| **Integrasi resmi** | Tidak |
| **Data yang disinkronkan** | Event, profil, cohort, grup |
| **Skill tersedia** | 7 |

## Fitur

- **Ingesti event** - Impor event track melalui Ingestion API Mixpanel ke dalam workflow Brevo
- **Sinkronisasi profil pengguna** - Petakan properti profil pengguna Mixpanel ke atribut kontak Brevo
- **Ekspor cohort** - Sinkronkan cohort Mixpanel ke list kontak Brevo untuk kampanye tertarget
- **Analitik grup** - Sinkronkan data tingkat grup untuk pemasaran berbasis akun B2B
- **Manajemen identitas** - Manfaatkan identity merge Mixpanel untuk profil pelanggan yang terpadu
- **Kueri JQL** - Jalankan kueri JQL kustom untuk mengekstrak kumpulan data tertentu bagi Brevo
- **Lookup table** - Sinkronkan data pengayaan dari lookup table Mixpanel

## Prasyarat

Sebelum memulai, pastikan Anda memiliki:

1. Akun Mixpanel dengan sebuah proyek yang sudah dibuat
2. Project Token Mixpanel Anda untuk pelacakan sisi klien
3. Service Account dengan izin yang sesuai untuk akses API sisi server
4. Akun Brevo dengan akses API
5. Akun Tajo dengan kredensial API

## Autentikasi

### Service Account (direkomendasikan)

Mixpanel menyarankan penggunaan Service Account untuk autentikasi API. Service account memakai HTTP Basic Auth dengan username (username service account) dan password (secret service account).

```bash
# Service Account authentication
curl https://mixpanel.com/api/app/me \
  -u "SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET"
```

### Project Token

Project Token dipakai untuk pelacakan event sisi klien dan aman untuk disertakan dalam kode klien:

```javascript
// Client-side initialization
mixpanel.init("YOUR_PROJECT_TOKEN");
```

### OAuth (untuk integrasi partner)

Untuk integrasi aplikasi yang mengakses banyak proyek:

```bash
curl https://mixpanel.com/api/2.0/engage \
  -H "Authorization: Bearer YOUR_OAUTH_TOKEN"
```

## Konfigurasi

### Setup dasar

```yaml
connectors:
  mixpanel:
    enabled: true
    project_token: "your-project-token"
    service_account:
      username: "your-service-account-username"
      secret: "your-service-account-secret"
    project_id: "12345"
    data_residency: "US"  # or "EU"

    # Data sync options
    sync:
      events: true
      profiles: true
      cohorts: true
      groups: false

    # Brevo list assignment
    lists:
      all_users: 15
      engaged_users: 16
      at_risk: 17
```

### Pemetaan event

Petakan event Mixpanel ke tipe event Brevo:

```yaml
event_mapping:
  # Mixpanel event -> Brevo event
  "Purchase": "order_completed"
  "Sign Up": "customer_created"
  "Add to Cart": "cart_updated"
  "Page View": "page_viewed"
  "$experiment_started": "experiment_started"

  # Custom events
  "Feature Activated": "feature_used"
  "Subscription Renewed": "subscription_renewed"
```

### Pemetaan properti profil

Petakan properti pengguna Mixpanel ke atribut kontak Brevo:

```yaml
property_mapping:
  $email: email
  $first_name: FIRSTNAME
  $last_name: LASTNAME
  $phone: SMS
  $city: CITY
  $region: REGION
  $country_code: COUNTRY
  plan: PLAN_TYPE
  company: COMPANY
  signup_date: SIGNUP_DATE
  total_revenue: LTV
```

## Endpoint API

| Metode | Endpoint | Deskripsi |
| --- | --- | --- |
| `POST` | `/import` | Mengimpor event (Ingestion API) |
| `POST` | `/track` | Melacak event (sisi klien) |
| `POST` | `/engage#$set` | Menetapkan properti profil pengguna |
| `POST` | `/engage#$set_once` | Menetapkan properti hanya jika belum diisi |
| `POST` | `/engage#$delete` | Menghapus profil pengguna |
| `POST` | `/engage#$union` | Menggabungkan ke properti berbentuk list |
| `POST` | `/groups` | Menetapkan properti profil grup |
| `GET` | `/export` | Mengekspor data event mentah |
| `POST` | `/cohorts/list` | Menampilkan cohort tersimpan |
| `POST` | `/engage/query` | Mengkueri profil pengguna |
| `POST` | `/jql` | Menjalankan kueri JQL kustom |
| `GET` | `/segmentation` | Mengkueri laporan segmentasi |
| `GET` | `/retention` | Mengkueri laporan retensi |
| `GET` | `/funnels` | Mengkueri laporan funnel |

## Contoh kode

### Inisialisasi konektor Mixpanel

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

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

// Connect Mixpanel project
await tajo.connectors.connect('mixpanel', {
  projectToken: process.env.MIXPANEL_TOKEN,
  serviceAccountUser: process.env.MIXPANEL_SA_USER,
  serviceAccountSecret: process.env.MIXPANEL_SA_SECRET,
  projectId: process.env.MIXPANEL_PROJECT_ID
});
```

### Mengimpor event melalui Ingestion API

```javascript
// Import events to Mixpanel (automatically forwarded to Brevo)
const response = await fetch('https://api.mixpanel.com/import', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Basic ' + btoa(
      `${process.env.MIXPANEL_SA_USER}:${process.env.MIXPANEL_SA_SECRET}`
    )
  },
  body: JSON.stringify([
    {
      event: "Purchase",
      properties: {
        distinct_id: "user_123",
        $insert_id: "evt_abc123",
        time: Math.floor(Date.now() / 1000),
        revenue: 89.99,
        product_id: "SKU-001",
        product_name: "Widget Pro"
      }
    }
  ])
});

// Expected response: { "code": 200, "status": "OK", "num_records_imported": 1 }
```

### Menyinkronkan cohort ke Brevo

```javascript
// Export a Mixpanel cohort and sync to a Brevo list
const cohort = await tajo.connectors.syncCohort('mixpanel', {
  cohortId: 12345,
  targetList: 16,
  syncMode: 'mirror'
});

console.log(cohort);
// {
//   cohortName: "Engaged Users (Last 7 Days)",
//   membersCount: 3200,
//   syncedToBrevo: 3200,
//   listId: 16
// }
```

### Menetapkan properti profil pengguna

```javascript
// Set user properties via the Engage API
const response = await fetch('https://api.mixpanel.com/engage#$set', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify([{
    $token: process.env.MIXPANEL_TOKEN,
    $distinct_id: "user_123",
    $set: {
      $email: "jane@example.com",
      $first_name: "Jane",
      $last_name: "Kim",
      plan: "premium",
      total_orders: 12,
      lifetime_value: 1250.00
    }
  }])
});
```

## Batas rate

| API | Batas | Detail |
| --- | --- | --- |
| **Ingestion API** | 2 GB/menit | Per proyek |
| **Track API** | Tanpa batas keras | Pengiriman best-effort |
| **Engage API** | 2.000 pembaruan/batch | Maksimum 2 GB/menit per proyek |
| **Query API** | 60 permintaan/jam | Per proyek (Service Account) |
| **Export API** | 60 permintaan/jam | Maksimum 100 hari per kueri |
| **JQL API** | 60 permintaan/jam | Per proyek |
| **Ekspor cohort** | 60 permintaan/jam | Per proyek |

Deduplikasi event

Mixpanel melakukan deduplikasi event menggunakan properti `$insert_id`. Selalu sertakan `$insert_id` yang unik untuk mencegah event ganda saat mengulang impor yang gagal.

## Pemecahan masalah

| Masalah | Penyebab | Solusi |
| --- | --- | --- |
| Event tidak muncul | Project token salah | Pastikan token cocok dengan proyek tujuan |
| Properti profil hilang | Menggunakan API yang salah | Gunakan `/engage#$set` untuk properti profil, bukan `/track` |
| Ekspor cohort gagal | Izin tidak mencukupi | Pastikan Service Account memiliki peran Admin atau Analyst |
| Event ganda | `$insert_id` tidak ada | Sertakan `$insert_id` unik pada setiap event |
| 402 Payment Required | Melebihi batas data | Periksa batas paket Mixpanel dan tingkatkan bila perlu |
| Data EU tidak dirutekan | Data residency salah | Gunakan `api-eu.mixpanel.com` untuk proyek EU |
| Masalah identity merge | distinct\_id keliru | Ikuti praktik terbaik manajemen identitas Mixpanel |

## Praktik terbaik

1. **Gunakan Service Account** - Utamakan Service Account dibanding Project Secret untuk autentikasi sisi server
2. **Sertakan `$insert_id`** - Selalu tetapkan insert ID unik untuk deduplikasi event
3. **Kelompokkan pembaruan profil** - Kirim hingga 2.000 pembaruan profil per permintaan agar efisien
4. **Gunakan endpoint EU** - Untuk data residency EU, pakai `api-eu.mixpanel.com` pada seluruh panggilan API
5. **Sinkronkan cohort terjadwal** - Siapkan sinkronisasi cohort harian atau mingguan alih-alih polling terus-menerus
6. **Petakan properti bawaan** - Gunakan properti bawaan Mixpanel (`$email`, `$first_name`) untuk data profil
7. **Pantau ingesti** - Gunakan halaman Events Mixpanel untuk memastikan event diterima dengan benar

## Keamanan

- **Hanya HTTPS** - Seluruh komunikasi API mensyaratkan enkripsi TLS
- **Isolasi Service Account** - Akses dibatasi per proyek dengan izin berbasis peran
- **Deduplikasi event** - Dedup bawaan via `$insert_id` mencegah masalah integritas data
- **SOC 2 Type II** - Mixpanel bersertifikat SOC 2 Type II
- **GDPR/CCPA** - Mendukung penghapusan data pengguna melalui GDPR API
- **Data residency EU** - Pusat data EU tersedia untuk kepatuhan Eropa

## Sumber daya terkait

- [Konektor Segment](https://tajo.io/in/docs/connectors/custom/segment)
- [Konektor Amplitude](https://tajo.io/in/docs/connectors/custom/amplitude)
- [Skill Customer Sync](https://tajo.io/in/docs/skills/data-sync/customer-sync)
- [Brevo Events API](https://tajo.io/in/docs/events-engagement/create-event)
