Mixpanel कनेक्टर
product analytics को marketing automation के साथ जोड़ने के लिए Tajo के माध्यम से Mixpanel को Brevo से कनेक्ट करें। वास्तविक product usage के आधार पर data-driven campaigns बनाने के लिए user profiles, behavioral events, और cohorts sync करें।
अवलोकन
| Property | Value |
|---|---|
| Platform | Mixpanel |
| Category | Analytics (Custom) |
| Setup Complexity | Medium |
| Official Integration | No |
| Data Synced | Events, Profiles, Cohorts, Groups |
| Available Skills | 7 |
विशेषताएं
- Event ingestion - Mixpanel के Ingestion API के माध्यम से track events को Brevo workflows में import करें
- User profile sync - Mixpanel user profile properties को Brevo contact attributes से map करें
- Cohort export - targeted campaigns के लिए Mixpanel cohorts को Brevo contact lists में sync करें
- Group analytics - B2B account-based marketing के लिए group-level data sync करें
- Identity management - एकीकृत customer profiles के लिए Mixpanel के identity merge का लाभ उठाएं
- JQL queries - Brevo के लिए विशिष्ट data sets निकालने हेतु custom JQL queries चलाएं
- Lookup tables - Mixpanel lookup tables से enrichment data sync करें
पूर्वावश्यकताएं
शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:
- एक project के साथ एक Mixpanel account
- client-side tracking के लिए आपका Mixpanel Project Token
- server-side API access के लिए उपयुक्त permissions वाला एक Service Account
- API access वाला एक Brevo account
- API credentials के साथ एक Tajo account
प्रमाणीकरण
Service Accounts (अनुशंसित)
Mixpanel API authentication के लिए Service Accounts का उपयोग करने की अनुशंसा करता है। Service accounts username (service account username) और password (service account secret) के साथ HTTP Basic Auth का उपयोग करते हैं।
# Service Account authenticationcurl https://mixpanel.com/api/app/me \ -u "SERVICE_ACCOUNT_USERNAME:SERVICE_ACCOUNT_SECRET"Project Token
Project Token का उपयोग client-side event tracking के लिए किया जाता है और इसे client code में शामिल करना सुरक्षित है:
// Client-side initializationmixpanel.init("YOUR_PROJECT_TOKEN");OAuth (Partner Integrations के लिए)
कई projects तक पहुंचने वाले app integrations के लिए:
curl https://mixpanel.com/api/2.0/engage \ -H "Authorization: Bearer YOUR_OAUTH_TOKEN"कॉन्फ़िगरेशन
बेसिक सेटअप
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: 17Event Mapping
Mixpanel events को Brevo event types से map करें:
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"Profile Property Mapping
Mixpanel user properties को Brevo contact attributes से map करें:
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: LTVAPI Endpoints
| Method | Endpoint | विवरण |
|---|---|---|
POST | /import | Events import करें (Ingestion API) |
POST | /track | Events ट्रैक करें (client-side) |
POST | /engage#$set | user profile properties सेट करें |
POST | /engage#$set_once | properties केवल तभी सेट करें जब पहले से सेट न हो |
POST | /engage#$delete | एक user profile हटाएं |
POST | /engage#$union | list properties में Union |
POST | /groups | group profile properties सेट करें |
GET | /export | raw event data export करें |
POST | /cohorts/list | saved cohorts list करें |
POST | /engage/query | user profiles क्वेरी करें |
POST | /jql | custom JQL queries चलाएं |
GET | /segmentation | segmentation reports क्वेरी करें |
GET | /retention | retention reports क्वेरी करें |
GET | /funnels | funnel reports क्वेरी करें |
कोड उदाहरण
Mixpanel कनेक्टर शुरू करें
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
// 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});Ingestion API के माध्यम से Events Import करें
// Mixpanel में events import करें (स्वचालित रूप से Brevo को forward होते हैं)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" } } ])});
// अपेक्षित response: { "code": 200, "status": "OK", "num_records_imported": 1 }Cohort को Brevo से Sync करें
// एक Mixpanel cohort export करें और Brevo list से sync करें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// }User Profile Properties सेट करें
// Engage API के माध्यम से user properties सेट करें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: { $first_name: "Jane", $last_name: "Kim", plan: "premium", total_orders: 12, lifetime_value: 1250.00 } }])});Rate Limits
| API | Limit | विवरण |
|---|---|---|
| Ingestion API | 2 GB/min | प्रति project |
| Track API | कोई hard limit नहीं | Best-effort delivery |
| Engage API | 2,000 updates/batch | प्रति project अधिकतम 2 GB/min |
| Query API | 60 requests/hour | प्रति project (Service Account) |
| Export API | 60 requests/hour | प्रति query अधिकतम 100 दिन |
| JQL API | 60 requests/hour | प्रति project |
| Cohort Export | 60 requests/hour | प्रति project |
Event Deduplication
Mixpanel $insert_id property का उपयोग करके events को deduplicate करता है। failed imports को retry करते समय duplicate events को रोकने के लिए हमेशा एक unique $insert_id शामिल करें।
समस्या निवारण
| समस्या | कारण | समाधान |
|---|---|---|
| Events दिखाई नहीं दे रहे | गलत project token | सत्यापित करें कि token target project से मेल खाता है |
| Profile properties गायब | गलत API का उपयोग | profile properties के लिए /track के बजाय /engage#$set का उपयोग करें |
| Cohort export fail | अपर्याप्त permissions | सुनिश्चित करें कि Service Account की Admin या Analyst role है |
| Duplicate events | गायब $insert_id | हर event पर unique $insert_id शामिल करें |
| 402 Payment Required | data limits से अधिक | Mixpanel plan limits जांचें और आवश्यकता होने पर upgrade करें |
| EU data route नहीं हो रहा | गलत data residency | EU projects के लिए api-eu.mixpanel.com का उपयोग करें |
| Identity merge समस्याएं | गलत distinct_id | Mixpanel की identity management सर्वोत्तम प्रथाओं का पालन करें |
सर्वोत्तम प्रथाएं
- Service Accounts का उपयोग करें - server-side authentication के लिए Project Secret की तुलना में Service Accounts को प्राथमिकता दें
$insert_idशामिल करें - event deduplication के लिए हमेशा एक unique insert ID सेट करें- Profile updates batch करें - efficiency के लिए प्रति request 2,000 तक profile updates भेजें
- EU endpoints का उपयोग करें - EU data residency के लिए, सभी API calls के लिए
api-eu.mixpanel.comका उपयोग करें - Schedule पर cohorts sync करें - continuous polling के बजाय daily या weekly cohort sync सेट करें
- Reserved properties को map करें - profile data के लिए Mixpanel की reserved properties (
$email,$first_name) का उपयोग करें - Ingestion monitor करें - यह सत्यापित करने के लिए कि events सही ढंग से प्राप्त हो रहे हैं, Mixpanel के Events page का उपयोग करें
सुरक्षा
- HTTPS only - सभी API communication के लिए TLS encryption आवश्यक
- Service Account isolation - role-based permissions के साथ प्रति project scoped access
- Event deduplication -
$insert_idके माध्यम से built-in dedup data integrity समस्याओं को रोकता है - SOC 2 Type II - Mixpanel SOC 2 Type II certified है
- GDPR/CCPA - GDPR API के माध्यम से user data deletion को support करता है
- EU data residency - European compliance के लिए EU data center उपलब्ध