kapa.ai ๋ฏน์คํจ๋ ์ ์ ํ๋กํผํฐ ์ํฌํธ ํ๋ ๋ฐฉ๋ฒ ์๋ ค์ค
Please stand by DONGHYO L. as I search the knowledge base. I normally take about 15 seconds or so. ๐
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
๋ฏน์คํจ๋(Mixpanel)์์ ์ ์ ํ๋กํผํฐ(์ฌ์ฉ์ ํ๋กํ)๋ฅผ ์ํฌํธํ๋ ๋ฐฉ๋ฒ์ ์ฌ๋ฌ ๊ฐ์ง๊ฐ ์์ต๋๋ค. ์๋์ ๋ํ์ ์ธ ๋ฐฉ๋ฒ๋ค์ ์ ๋ฆฌํด ๋๋ฆฝ๋๋ค.---
1. CSV ํ์ผ๋ก ๋๋ ์ํฌํธ (UI ์ฌ์ฉ)
1. CSV ํ์ผ ์ค๋น
- ์ฒซ ๋ฒ์งธ ์ด์ $distinct_id(์ ์ ๊ณ ์ ์๋ณ์)๋ฅผ ํฌํจํ์ธ์.
- ์ถ๊ฐ๋ก ์ํฌํธํ ํ๋กํผํฐ(์: $name, $email, department ๋ฑ)๋ฅผ ์ด๋ก ์ถ๊ฐํ์ธ์.
- CSV์๋ ์ปฌ๋ผ ํค๋๋ฅผ ํฌํจํ์ง ๋ง์ธ์. ํค๋๋ ์
๋ก๋ ๊ณผ์ ์์ UI์์ ์ง์ ์ง์ ํฉ๋๋ค.2. Mixpanel UI์์ ์ํฌํธ
- Users ํ์ด์ง๋ก ์ด๋ ํ Add/Edit Profile ํด๋ฆญ
- Import from CSV ํญ ์ ํ
- CSV ํ์ผ ์
๋ก๋
- ๊ฐ ์ด์ด ์ด๋ค ํ๋กํผํฐ์ ๋งคํ๋ ์ง ์ง์
- ์ํฌํธํ ์ด๋ง ์ ํํ๊ณ , ํ์ ์๋ ์ด์ ์ฒดํฌ ํด์
- Import profiles ๋ฒํผ ํด๋ฆญ> โ ๏ธ ์ด๋ฏธ ์กด์ฌํ๋ $distinct_id๊ฐ ์์ผ๋ฉด ํด๋น ํ๋กํ์ด ์
๋ฐ์ดํธ๋๊ณ , ์๋ก์ด ๊ฐ์ด๋ฉด ์ ํ๋กํ์ด ์์ฑ๋ฉ๋๋ค.
CSV ์ต๋ ํฌ๊ธฐ๋ 1๋ฐฑ๋ง(1M) ํ์
๋๋ค.
๋์ผํ ์ด๋ฉ์ผ์ด๋ ์ด๋ฆ์ด๋๋ผ๋ $distinct_id๊ฐ ๋ค๋ฅด๋ฉด ๋ณ๋์ ํ๋กํ๋ก ๋ฑ๋ก๋ฉ๋๋ค.
2. API๋ฅผ ํตํ ์ํฌํธ (Engage API)
ํ์ด์ฌ ๋ฑ ์๋ฒ์์ ์ง์ Mixpanel HTTP API๋ฅผ ํธ์ถํด ๋๋์ผ๋ก ์ ์ ํ๋กํผํฐ๋ฅผ ์ํฌํธํ ์ ์์ต๋๋ค.LBKSimport json import requestsLBKSPROJECT_TOKEN = "์ฌ๊ธฐ์_ํ๋ก์ ํธ_ํ ํฐ_์
๋ ฅ"LBKSdef get_users_from_database(): return [ {"user_id": "123", "$name": "Alice", "$email": "alice@โ[linear.app](http://linear.app)", "department": "engineering"}, {"user_id": "456", "$name": "Bob", "department": "product"}, ]LBKSdef transform_to_mp_format(user): distinct_id = user.pop("user_id") return {"$distinct_id": distinct_id, "$token": PROJECT_TOKEN, "$ip": "0", "$set": user}LBKSusers = get_users_from_database() profiles = [transform_to_mp_format(u) for u in users]LBKSresp = [requests.post](http://requests.post)( "[https://api.mixpanel.com/engage](https://api.mixpanel.com/engage)", params={"verbose": "2"}, headers={"Content-Type": "application/json"}, data=json.dumps(profiles) )LBKSprint(resp.json())LBKS- ํ ๋ฒ์ 200๊ฐ ํ๋กํ์ฉ ๋ฐฐ์น๋ก ๋ณด๋ด๋ ๊ฒ์ด ๊ถ์ฅ๋ฉ๋๋ค.
- $set ์ธ์๋ $set_once, $add, $union ๋ฑ ๋ค์ํ ์ฐ์ฐ์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
API ์์ ๋ฐ ์ฐ์ฐ์ ์ค๋ช
API ์ํ ์ฝ๋---
3. ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค ์ปค๋ฅํฐ ์ฌ์ฉ
BigQuery, Snowflake ๋ฑ ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค์ Mixpanel์ ์ฐ๊ฒฐํด ์๋์ผ๋ก ์ ์ ํ๋กํ์ ์ํฌํธํ ์ ์์ต๋๋ค. - ํ๋ก์ ํธ ์ค์ ์์ Warehouse Source๋ฅผ ์ฐ๊ฒฐํ๊ณ , User Table์ ์ ํํด ๋งคํํ๋ฉด ๋ฉ๋๋ค. - ์ด ๋ฐฉ๋ฒ์ ๋ณ๋์ ๋ผ์ด์ ์ค๊ฐ ํ์ํ ์ ์์ต๋๋ค. ์์ธํ ๋ณด๊ธฐ---ํ์์ ๋ฐ๋ผ ์ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ ํํด ์ฌ์ฉํ์๋ฉด ๋ฉ๋๋ค. ์ถ๊ฐ๋ก ๊ถ๊ธํ ์ ์ด ์์ผ๋ฉด ๋ง์ํด ์ฃผ์ธ์!
kapa.ai is still learning and improving, please let me know how I did by reacting below.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Note: we set `$ip` to 0 here to tell Mixpanel not to look up the IP of this user. ์ด ๋ถ๋ถ์ด ์ด๋ค ์๋ฏธ์ผ?
kapa.ai Note: we set `$ip` to 0 here to tell Mixpanel not to look up the IP of this user. ์ด ๋ถ๋ถ์ด ์ด๋ค ์๋ฏธ์ผ?
Let me check the knowledge base for you again. One moment! ๐
Mixpanel์์ $ip๋ฅผ 0์ผ๋ก ์ค์ ํ๋ฉด, ํด๋น ์ ์ ํ๋กํ์ ์ํฌํธํ ๋ Mixpanel์ด IP ์ฃผ์๋ฅผ ์ฌ์ฉํด ์์น(์ง๋ฆฌ ์ ๋ณด)๋ฅผ ์๋์ผ๋ก ์ถ์ ํ์ง ์๋๋ก ํ๋ค๋ ์๋ฏธ์
๋๋ค.์ฆ, ์๋ฒ์์ API๋ก ์ ์ ํ๋กํ์ ๋ณด๋ผ ๋ $ip๋ฅผ 0์ผ๋ก ์ง์ ํ๋ฉด, Mixpanel์ ๊ทธ ์์ฒญ์ IP(์: ์๋ฒ์ IP ์ฃผ์)๋ฅผ ์ฌ์ฉํด $city, $region, mp_country_code์ ๊ฐ์ ์์น ์ ๋ณด๋ฅผ ์๋์ผ๋ก ์ฑ์ฐ์ง ์์ต๋๋ค.
์ด๋ ๊ฒ ํ๋ฉด ๋ชจ๋ ์ ์ ์ ์์น๊ฐ ์๋ฒ(๋ฐ์ดํฐ์ผํฐ) ์์น๋ก ์๋ชป ์ ์ฅ๋๋ ๊ฒ์ ๋ฐฉ์งํ ์ ์์ต๋๋ค.์๋ ์์์ฒ๋ผ $ip๋ฅผ 0์ผ๋ก ์ง์ ํฉ๋๋ค: LBKS{ "$token": "mytoken", "$distinct_id": "13793", "$ip": "0", "$set": { "My_property": "my_value" } }LBKS์ด๋ ๊ฒ ํ๋ฉด Mixpanel์ IP ๊ธฐ๋ฐ ์์น ์ ๋ณด๋ฅผ ์ ์ฅํ์ง ์์ต๋๋ค.
์์ธํ ๋ด์ฉ์ ๊ณต์ ๋ฌธ์์์ ํ์ธํ ์ ์์ต๋๋ค.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
{'error': None, 'errors': {}, 'num_good_events': 200, 'status': 1}ํด๋น ๋ฆฌ์คํฐ์ค๋ ๋ญ ์๋ฏธํ๋๊ฑฐ์ผ
Let me check the knowledge base for you again. One moment! ๐
์ฃ์กํ์ง๋ง, ์ ๊ณต๋ ์ง์ ์์ค์์๋ ``` {'error': None, 'errors': {}, 'num_good_events': 200, 'status': 1}
์ ๊ฐ์ ๋ฆฌ์คํฐ์ค ํฌ๋งท์ด๋ ๊ฐ ํ๋์ ์๋ฏธ์ ๋ํ ๋ช
ํํ ์ค๋ช
์ ์ฐพ์ ์ ์์ต๋๋ค.LBKSMixpanel ๊ณต์ ๋ฌธ์์ ๋ฐ๋ฅด๋ฉด, ์ด๋ฒคํธ ์ํฌํธ API ๋ฑ์์๋ ์ผ๋ฐ์ ์ผ๋ก `num_records_imported`, `status`, `error` ๋ฑ์ ํ๋๋ฅผ ํฌํจํ ์๋ต์ ๋ฐํํ์ง๋ง, ์์ ๊ฐ์ด `num_good_events`์ `status: 1` ํํ์ ๋ฆฌ์คํฐ์ค์ ๋ํ ๊ตฌ์ฒด์ ์ธ ์ธ๊ธ์ ์์ต๋๋ค.
๋ฐ๋ผ์ ํด๋น ๋ฆฌ์คํฐ์ค์ ์ ํํ ์๋ฏธ๋ฅผ ์๋ด๋๋ฆฌ๊ธฐ ์ด๋ ต์ต๋๋ค.LBKS์ถ๊ฐ์ ์ธ ์ ๋ณด๊ฐ ํ์ํ๋ค๋ฉด Mixpanel ๊ณต์ ๋ฌธ์๋ ์ง์ํ์ ๋ฌธ์ํ์๋ ๊ฒ์ ๊ถ์ฅ๋๋ฆฝ๋๋ค.
[์ด๋ฒคํธ ์ํฌํธ ์๋ต ์์ ์ฐธ๊ณ ](https://github.com/mixpanel/docs/blob/main/reference/Ingestion%20API/events/import-events.md)
kapa.ai is still learning and improving, please let me know how I did by reacting below.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai ์ฐํ๋ฆฌํ๋ ์ ์ ํ๋กํผํฐ๋ฅผ ์ด๊ดํ๋ ค๊ณ ํด ์ด๋ป๊ฒ ํด์ผํด?
Let me check the knowledge base for you again. One moment! ๐
์ฐํ๋ฆฌํ๋(Amplitude)์์ ๋ฏน์คํจ๋(Mixpanel)๋ก ์ ์ ํ๋กํผํฐ(์ฌ์ฉ์ ํ๋กํ)๋ฅผ ์ด๊ดํ๋ ค๋ฉด ์๋์ ๊ฐ์ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.---
1. ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค ์ปค๋ฅํฐ ์ฌ์ฉ
๊ฐ์ฅ ๊ถ์ฅ๋๋ ๋ฐฉ๋ฒ์ Amplitude ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค(BigQuery, Snowflake ๋ฑ)์ ์ ์ฅํ ๋ค, Mixpanel์ Warehouse Connector๋ฅผ ํตํด ์ ์ ํ๋กํผํฐ๋ฅผ ์ด๊ดํ๋ ๊ฒ์
๋๋ค.์ ์ฐจ ์์ฝ:
1. Amplitude์ ์ ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์ดํฐ ์จ์ดํ์ฐ์ค์ ์ ์ฌํฉ๋๋ค.
2. ์๋์ ๊ฐ์ด SQL๋ก JSON ์ปฌ๋ผ์ ํํํ(flatten)ํ์ฌ ํ์ํ ์ปฌ๋ผ๋ง ์ถ์ถํฉ๋๋ค.LBKSSELECT event_time, user_id, -- user properties JSON_EXTRACT_SCALAR(user_properties, "$['$email']") AS email, JSON_EXTRACT_SCALAR(user_properties, "$['$name']") AS name, JSON_EXTRACT_SCALAR(user_properties, "$['last_genre']") AS last_genre, JSON_EXTRACT_SCALAR(user_properties, "$['lifetime_purchase']") AS lifetime_purchase FROM `project.dataset.tablename` t1 INNER JOIN ( SELECT user_id, MAX(event_time) as max_event_time FROM `project.dataset.tablename` WHERE user_id IS NOT NULL GROUP BY user_id ) t2 ON t1.user_id = t2.user_id AND t1.event_time = t2.max_event_timeLBKS3. Mixpanel ํ๋ก์ ํธ์์ Warehouse Connector๋ฅผ ์ค์ ํ๊ณ , ์์์ ๋ง๋ ํ
์ด๋ธ/๋ทฐ๋ฅผ ์ฐ๊ฒฐํ์ฌ ๊ฐ ํ๋๋ฅผ ๋งคํํฉ๋๋ค.
์์ธํ ์ ์ฐจ๋ ๊ณต์ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํ์ธ์.---
2. Mixpanel Migration Service ์ฌ์ฉ (15M ์ด๋ฒคํธ ์ดํ)
Mixpanel์์ ์ ๊ณตํ๋ ๋ฌด๋ฃ Migration Service๋ฅผ ์ด์ฉํด Amplitude์ ์ด๋ฒคํธ์ ์ ์ ํ๋กํผํฐ๋ฅผ ์๋์ผ๋ก ์ด๊ดํ ์ ์์ต๋๋ค.
์๋์ ๊ฐ์ด API๋ฅผ ํธ์ถํ๋ฉด ๋ฉ๋๋ค.LBKScurl --request POST \ --url [https://migrate.api.mixpanel.com/amplitude](https://migrate.api.mixpanel.com/amplitude) \ --header "Content-Type: application/json" \ --data '{ "AMPLITUDE_API_KEY": "YOUR_AMP_KEY", "AMPLITUDE_API_SECRET": "YOUR_AMP_SECRET", "MIXPANEL_TOKEN": "YOUR_MP_TOKEN", "START_DATE": "YYYY-MM-DD", "END_DATE": "YYYY-MM-DD" }'LBKS์ด ์๋น์ค๋ Amplitude์์ ๋ฐ์ดํฐ๋ฅผ ์ถ์ถํด Mixpanel์ ๋ง๊ฒ ๋ณํ ํ, ์ด๋ฒคํธ์ ์ ์ ํ๋กํ์ ์๋์ผ๋ก ์ด๊ดํฉ๋๋ค.
์์ธํ ์๋ด๋ ์ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ์ธ์.---
3. mixpanel-utils ์คํฌ๋ฆฝํธ ์ฌ์ฉ
mixpanel-utils ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ import_from_amplitude ํจ์๋ฅผ ์ฌ์ฉํ๋ฉด Amplitude ํ๋ก์ ํธ์ ๋ฐ์ดํฐ๋ฅผ Mixpanel๋ก ์ง์ ์ด๊ดํ ์ ์์ต๋๋ค.LBKSmputils.import_from_amplitude("Amplitude Key", "Amplitude Secret", "20210901T00", "20210930T23")LBKS- ๋ ์ง๋ YYYYMMDDTHH ํ์์ผ๋ก ์ง์ ํฉ๋๋ค.
- ์ด ๋ฐฉ๋ฒ์ Mixpanel์ Original ID Merge ๋ฐฉ์์์๋ง ์ง์๋ฉ๋๋ค
์์ธํ ๋ณด๊ธฐ---์ด ์ธ์๋, CDP(Segment ๋ฑ)๋ Reverse ETL ๋๊ตฌ(Census, Hightouch ๋ฑ)๋ฅผ ํตํด์๋ ์ด๊ด์ด ๊ฐ๋ฅํฉ๋๋ค.
๊ฐ ๋ฐฉ๋ฒ์ ์ธ๋ถ ์ค์ ์ ์ฌ์ฉ ์ค์ธ ์ธํ๋ผ์ ๋ฐ์ดํฐ ๊ตฌ์กฐ์ ๋ฐ๋ผ ๋ฌ๋ผ์ง ์ ์์ผ๋, ๊ณต์ ๋ฌธ์๋ฅผ ์ฐธ๊ณ ํด ์ฃผ์ธ์.Amplitude์์ Mixpanel๋ก ๋ง์ด๊ทธ๋ ์ด์
๊ณต์ ๊ฐ์ด๋
Warehouse Connector๋ก ์ ์ ํ๋กํผํฐ ์ด๊ด
Migration Service ์๋ด
kapa.ai is still learning and improving, please let me know how I did by reacting below.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai engage API๋ฅผ ์ด์ฉํด์ ์ ์ ํ๋กํ์ ์ ๋ฐ์ดํธ ํ์ด. ํ์ง๋ง UI์์ ๋ณด์ฌ์ง์ง ์์
Let me check the knowledge base for you again. One moment! ๐
Engage API๋ฅผ ์ด์ฉํด ์ ์ ํ๋กํ์ ์ ๋ฐ์ดํธํ์ง๋ง Mixpanel UI์์ ๋ณด์ด์ง ์๋ ๊ฒฝ์ฐ, ์๋์ ๊ฐ์ ์์ธ๊ณผ ์ ๊ฒ ์ฌํญ์ด ์์ต๋๋ค.1. distinct_id ์ผ์น ์ฌ๋ถ ํ์ธ Mixpanel์ ์ด๋ฒคํธ์ ์ ์ ํ๋กํ์ distinct_id๋ก ์ฐ๊ฒฐํฉ๋๋ค. ์ด๋ฒคํธ์ ํ๋กํ ๋ชจ๋ ๋์ผํ distinct_id๋ฅผ ์ฌ์ฉํด์ผ UI์์ ์ ์์ ์ผ๋ก ์กฐํํ ์ ์์ต๋๋ค. distinct_id๊ฐ ๋ค๋ฅด๋ฉด UI์์ ํด๋น ํ๋กํ์ด ๋ณด์ด์ง ์์ ์ ์์ต๋๋ค. ์์ธํ ๋ณด๊ธฐ2. ํ๋กํ ์์ฑ/์ ๋ฐ์ดํธ๊ฐ ์ ์์ ์ผ๋ก ์ฒ๋ฆฌ๋์๋์ง ํ์ธ Engage API ํธ์ถ ์ ์๋ต์ด ์ฑ๊ณต(์: status: 1)์ผ๋ก ๋์๋ค๋ฉด, ์ค์ ๋ก ํ๋กํ์ด ์์ฑ๋์๋์ง API๋ก ๋ค์ ์กฐํํด๋ณด์ธ์. ํ๋กํ ์กฐํ ๋ฐฉ๋ฒ3. UI ํํฐ/๊ฒ์ ์กฐ๊ฑด ํ์ธ Users ํญ์์ ํํฐ๋ ๊ฒ์ ์กฐ๊ฑด์ด ์๋ชป ์ค์ ๋์ด ์์ผ๋ฉด ํ๋กํ์ด ๋ณด์ด์ง ์์ ์ ์์ต๋๋ค. ๋ชจ๋ ํํฐ๋ฅผ ํด์ ํ๊ณ ๋ค์ ํ์ธํด๋ณด์ธ์.4. ํ๋กํ ์์ฑ ์ปฌ๋ผ ๋ ธ์ถ ์ฌ๋ถ UI์์ ๋ณด์ด๋ ์ปฌ๋ผ(ํ๋กํผํฐ)์ โEdit Columnsโ์์ ์ ํํ ํญ๋ชฉ๋ง ๋ ธ์ถ๋ฉ๋๋ค. ํ์ํ ์ปฌ๋ผ์ด ์ ํ๋์ด ์๋์ง ํ์ธํ์ธ์. CSV ๋ด๋ณด๋ด๊ธฐ ๋ฐ ์ปฌ๋ผ ์ค์ 5. ๋ฐ์๊น์ง ์ฝ๊ฐ์ ์ง์ฐ API๋ก ๋๋ ์ ๋ฐ์ดํธ ์ UI์ ๋ฐ์๋๊ธฐ๊น์ง ์ฝ๊ฐ์ ์๊ฐ์ด ๊ฑธ๋ฆด ์ ์์ต๋๋ค.6. $distinct_id ๊ฐ์ด ์๋ชป ์ง์ ๋ ๊ฒฝ์ฐ CSV๋ API๋ก ์ํฌํธํ ๋ $distinct_id๊ฐ ์๋ชป ์ง์ ๋๋ฉด ๋น ํ๋กํ์ด ์์ฑ๋๊ฑฐ๋, UI์์ ์ฐพ๊ธฐ ์ด๋ ค์ธ ์ ์์ต๋๋ค. FAQ ์ฐธ๊ณ ์ ์ฌํญ์ ์ ๊ฒํด๋ ๋ฌธ์ ๊ฐ ๊ณ์๋๋ค๋ฉด, Engage API๋ก ํด๋น distinct_id์ ํ๋กํ์ ์กฐํํด ์ค์ ๋ก ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋์ด ์๋์ง ํ์ธํด๋ณด๋ ๊ฒ์ด ์ข์ต๋๋ค. Engage API ํ๋กํ ์กฐํ ์์๋ง์ฝ ์ฌ์ ํ ํด๊ฒฐ๋์ง ์๋๋ค๋ฉด, Mixpanel ์ง์ํ์ ๋ฌธ์ํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
