kapa.ai ๋ฏน์คํจ๋ ๋์๋ณด๋์์ IP์ ๋๋ฐ์ด์ค๊ธฐ๊ธฐ๋ก ์ค๋ณต ์ฌ์ฉ์๋ฅผ ์ฒดํฌํ ์. ใ ฃใ ์ด?
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
๋ฏน์คํจ๋์์ IP์ ๋๋ฐ์ด์ค(๊ธฐ๊ธฐ) ์ ๋ณด๋ฅผ ํ์ฉํด ์ค๋ณต ์ฌ์ฉ์๋ฅผ ์ง์ ์ ์ผ๋ก "์ฒดํฌ"ํ๋ ๊ธฐ๋ฅ(์ฆ, ๋์ผ IP ๋๋ ๋์ผ ๋๋ฐ์ด์ค๋ก ์ ์ํ ์ฌ์ฉ์๋ฅผ ์๋์ผ๋ก ์๋ณํด์ฃผ๋ ๋์๋ณด๋ ๊ธฐ๋ฅ)์ ๋ํ ๋ช ํํ ์ธ๊ธ์ ์ง์ ์์ค์ ์์ต๋๋ค.
๋ฏน์คํจ๋์ ID Merge ์์คํ
์ ์ฃผ๋ก $device_id์ $user_id๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ฌ๋ฌ ๊ธฐ๊ธฐ๋ ํ๋ซํผ์์์ ๋์ผ ์ฌ์ฉ์๋ฅผ ํ๋๋ก ํฉ์น๋ ๋ฐ ์ด์ ์ ๋ง์ถ๊ณ ์์ต๋๋ค. ์ฆ, ์ฌ์ฉ์๊ฐ ์ฌ๋ฌ ๊ธฐ๊ธฐ(์: ์น, ๋ชจ๋ฐ์ผ)์์ ์ ์ํ๋๋ผ๋, ๋ก๊ทธ์ธ ์์ ์ .identify()๋ฅผ ํธ์ถํ๋ฉด ํด๋น $device_id์ $user_id๊ฐ ํ๋์ ID ํด๋ฌ์คํฐ๋ก ๋ณํฉ๋์ด ๋์ผ ์ฌ์ฉ์๋ก ์ธ์๋ฉ๋๋ค. ์ด ๊ณผ์ ์์ IP๋ ์ง์ ์ ์ผ๋ก ์ค๋ณต ์ฌ์ฉ์ ์๋ณ์ ์ฌ์ฉ๋์ง ์์ต๋๋ค. IP๋ ์ฃผ๋ก ์ง๋ฆฌ์ ์์น(GeoIP) ์ ๋ณด ์ถ์ถ์ ํ์ฉ๋ฉ๋๋คIdentifying Users (Simplified), Geolocation: IP address and location properties.
๋ฐ๋ผ์, ๋ฏน์คํจ๋ ๋์๋ณด๋์์ "IP์ ๋๋ฐ์ด์ค ์ ๋ณด๋ก ์ค๋ณต ์ฌ์ฉ์๋ฅผ ์ง์ ์ ์ผ๋ก ์ฒดํฌ"ํ๋ ๊ธฐ๋ฅ์ ๊ณต์์ ์ผ๋ก ์ ๊ณต๋์ง ์์ต๋๋ค. ์ค๋ณต ์ฌ์ฉ์ ๊ด๋ฆฌ๋ ์ฃผ๋ก ID Merge(์๋ณ์ ๋ณํฉ) ๊ธฐ๋ฅ์ ํตํด ์ด๋ฃจ์ด์ง๋ฉฐ, 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.
kapa.ai export api ์ฌ์ฉ๋ฐฉ๋ฒ ์๋ ค์ค ์์ ๋ณด์ฌ์ค
Let me check the knowledge base for you again. One moment! ๐
Mixpanel์ Export API(ํนํ Raw Event Export API)๋ฅผ ์ฌ์ฉํ๋ฉด ํ๋ก์ ํธ์ ์ด๋ฒคํธ ๋ฐ์ดํฐ๋ฅผ JSONL(Newline-delimited JSON) ํ์์ผ๋ก ์ถ์ถํ ์ ์์ต๋๋ค. ์๋๋ ์ฌ์ฉ ๋ฐฉ๋ฒ๊ณผ ์์ ์ ๋๋ค.
1. ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ
- ์๋ํฌ์ธํธ:
[https://data.mixpanel.com/api/2.0/export](https://data.mixpanel.com/api/2.0/export)
- ํ์ ํ๋ผ๋ฏธํฐ:
- from_date (YYYY-MM-DD)
- to_date (YYYY-MM-DD)
- ์ ํ ํ๋ผ๋ฏธํฐ:
- event (ํน์ ์ด๋ฒคํธ๋ง ์ถ์ถ, JSON ๋ฐฐ์ด๋ก ์ ๋ฌ)
- limit (์ต๋ 100,000)
- where (ํํฐ ์กฐ๊ฑด)
- project_id (์๋น์ค ๊ณ์ ์ฌ์ฉ ์ ํ์)
2. ์์
cURL ์์
sh
curl --request GET \
--url '[https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100&event=["sample_event"]](https://data.mixpanel.com/api/2.0/export?from_date=2024-07-23&to_date=2024-07-24&limit=100&event=[%22sample_event%22])' \
--header 'accept: text/plain' \
--header 'authorization: Basic <YOUR_AUTH_TOKEN> '
- authorization ํค๋์๋ Base64๋ก ์ธ์ฝ๋ฉ๋ ์๋น์ค ๊ณ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ๋ฃ์ด์ผ ํฉ๋๋ค.
- ๊ฒฐ๊ณผ๋ ํ ์ค์ ํ๋์ JSON ์ค๋ธ์ ํธ๊ฐ ๋ค์ด์๋ JSONL ํฌ๋งท์ผ๋ก ๋ฐํ๋ฉ๋๋ค.
๋ฐํ ์์
{"event":"Signed up","properties":{"time":1602611311,"$insert_id":"ABCDE","mp_processing_time_ms":1602625711874}}
{"event":"Signed up","properties":{"time":1602787121,"$insert_id":"ABCDE","mp_processing_time_ms":1602801521561}}
3. ์ฐธ๊ณ ์ฌํญ
- ์๊ฐ๋: 2023๋ 1์ 1์ผ ์ดํ ์์ฑ๋ ํ๋ก์ ํธ๋ UTC, ๊ทธ ์ด์ ์ ํ๋ก์ ํธ ํ์์กด ๊ธฐ์ค์ ๋๋ค. - ์ฟผ๋ฆฌ ์ ํ: ์๊ฐ๋น 60ํ, ์ด๋น 3ํ, ๋์ 100ํ๊น์ง ํ์ฉ๋ฉ๋๋ค. - ๋ ๋ง์ ํ๋ผ๋ฏธํฐ์ ์์ธ ์ค๋ช ์ ๊ณต์ ๋ฌธ์์์ ํ์ธํ ์ ์์ต๋๋ค.
์์ธํ ๋ด์ฉ๊ณผ ์ถ๊ฐ ์์ ๋ Mixpanel Export Methods ๊ณต์ ๋ฌธ์์์ ํ์ธํ์ค ์ ์์ต๋๋ค. ์ฐธ๊ณ : ๊ณต์ ์์ ๋ฐ ์ค๋ช
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! ๐
Mixpanel Raw Event Export API๋ฅผ ํ์ด์ฌ์์ ์ฌ์ฉํ๋ ์์ ๋ ์๋์ ๊ฐ์ต๋๋ค.
๊ณต์ ๋ฌธ์์ ๋ฐ๋ฅด๋ฉด, cURL๊ณผ ๋์ผํ ๋ฐฉ์์ผ๋ก ํ์ด์ฌ์ requests ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
```
import requests
url = 'https://data.mixpanel.com/api/2.0/export' params = { 'from_date': '2024-07-23', 'to_date': '2024-07-24', 'event': '["sample_event"]', # ์ํ๋ ์ด๋ฒคํธ๋ช 'limit': 100 } headers = { 'accept': 'text/plain', 'authorization': 'Basic <YOUR_AUTH_TOKEN> ' # ์๋น์ค ๊ณ์ ์ธ์ฆ ์ ๋ณด (Base64 ์ธ์ฝ๋ฉ) }
response = requests.get(url, params=params, headers=headers)
with open('mixpanel_export.jsonl', 'w', encoding='utf-8') as f: f.write(response.text)
LBKS- `<YOUR_AUTH_TOKEN> ` ๋ถ๋ถ์๋ ์๋น์ค ๊ณ์ ์ ์ธ์ฆ ์ ๋ณด๋ฅผ Base64๋ก ์ธ์ฝ๋ฉํด์ ๋ฃ์ด์ผ ํฉ๋๋ค.
- ๋ฐํ๋๋ ๋ฐ์ดํฐ๋ ํ ์ค์ ํ๋์ JSON ์ค๋ธ์ ํธ๊ฐ ๋ค์ด์๋ JSONL ํฌ๋งท์
๋๋ค.
์์ธํ ๋ด์ฉ์ [Mixpanel ๊ณต์ Export Methods ๋ฌธ์](https://docs.mixpanel.com/docs/export-methods)์์ ํ์ธํ ์ ์์ต๋๋ค.
[๊ณต์ ์์ ๋ฐ ์ค๋ช
์ฐธ๊ณ ](https://docs.mixpanel.com/docs/export-methods#exporting-events)
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 auth_token์ ๋ญ๊ฐ ๋ค์ด๊ฐ
Let me check the knowledge base for you again. One moment! ๐
auth_token์๋ "์๋น์ค ๊ณ์ ์ username๊ณผ secret์ ์ฝ๋ก (:)์ผ๋ก ์ฐ๊ฒฐํ ๋ค Base64๋ก ์ธ์ฝ๋ฉํ ๊ฐ"์ด ๋ค์ด๊ฐ๋๋ค.
Mixpanel์ Export API(๋ฐ ๋๋ถ๋ถ์ ์๋ฒ API)๋ ์๋น์ค ๊ณ์ (Service Account) ์ธ์ฆ์ ๊ถ์ฅํฉ๋๋ค. ์ธ์ฆ ๋ฐฉ์์ HTTP Basic Auth์ด๋ฉฐ, username๊ณผ secret์ ์ฌ์ฉํฉ๋๋ค.
์๋ฅผ ๋ค์ด, ์๋น์ค ๊ณ์ ์ username์ด my_user์ด๊ณ secret์ด my_secret์ด๋ผ๋ฉด,
my_user:my_secret์ Base64๋ก ์ธ์ฝ๋ฉํ ๊ฐ์ authorization: Basic <auth_token> ํค๋์ ๋ฃ์ด์ผ ํฉ๋๋ค.
ํ์ด์ฌ ์์:
import base64
username = 'my_user'
secret = 'my_secret'
auth_token = base64.b64encode(f"{username}:{secret}".encode()).decode()
headers = {
'authorization': f'Basic {auth_token}'
}
Mixpanel ๊ณต์ ๋ฌธ์์์๋ ์๋น์ค ๊ณ์ ์ username๊ณผ secret์ Basic Auth๋ก ์ฌ์ฉํ๋ ๊ฒ์ ์๋ดํ๊ณ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ Service Accounts ์ธ์ฆ ๋ฌธ์์์ ํ์ธํ ์ ์์ต๋๋ค.
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 Unable to authenticate request ์ด ๋ฉ์์ง๋ ์ด๋ค ์๋ฏธ์ผ
Let me check the knowledge base for you again. One moment! ๐
"Unable to authenticate request"๋ผ๋ ๋ฉ์์ง๋ Mixpanel API์ ์ธ์ฆ ์ ๋ณด๊ฐ ์ฌ๋ฐ๋ฅด์ง ์๊ฑฐ๋ ๋๋ฝ๋์ด ์์ด ์์ฒญ์ด ๊ฑฐ๋ถ๋์์์ ์๋ฏธํฉ๋๋ค. Mixpanel API๋ ๋๋ถ๋ถ์ ๊ฒฝ์ฐ ์ธ์ฆ์ด ํ์ํ๋ฉฐ, ๊ถ์ฅ๋๋ ๋ฐฉ์์ ์๋น์ค ๊ณ์ (Service Account)์ username๊ณผ secret์ ์ฌ์ฉํ HTTP Basic Auth์ ๋๋ค. ์ธ์ฆ ์ ๋ณด๊ฐ ์๋ชป๋์๊ฑฐ๋, ์ฌ๋ฐ๋ฅธ ํ์์ผ๋ก ์ ๋ฌ๋์ง ์์ผ๋ฉด ์ด๋ฐ ์๋ฌ ๋ฉ์์ง๊ฐ ๋ฐํ๋ฉ๋๋ค.
์๋ฅผ ๋ค์ด, Export API๋ฅผ ์ฌ์ฉํ ๋๋ ๋ค์๊ณผ ๊ฐ์ด ์ธ์ฆํด์ผ ํฉ๋๋ค:
- ์๋น์ค ๊ณ์ ์ username๊ณผ secret์ ์ฝ๋ก (:)์ผ๋ก ์ฐ๊ฒฐํ ๋ค Base64๋ก ์ธ์ฝ๋ฉํ์ฌ,
authorization: Basic <์ธ์ฝ๋ฉ๋ ๊ฐ> ํค๋์ ํฌํจํด์ผ ํฉ๋๋ค.
- ๋๋ cURL์์๋ -u <username> :<secret> ์ต์
์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
์ด์ ๊ด๋ จ๋ ์ธ์ฆ ๋ฐฉ๋ฒ ๋ฐ ์ฃผ์์ฌํญ์ ๊ณต์ ๋ฌธ์์์ ํ์ธํ ์ ์์ต๋๋ค. Mixpanel API ์ธ์ฆ ๋ฐฉ๋ฒ Export API ์ธ์ฆ ์๋ด
์ฆ, ์ด ๋ฉ์์ง๊ฐ ๋ณด์ธ๋ค๋ฉด ์ธ์ฆ ์ ๋ณด(์๋น์ค ๊ณ์ username/secret, ํน์ ํ๋ก์ ํธ ์ํฌ๋ฆฟ ๋ฑ)๊ฐ ์ฌ๋ฐ๋ฅด๊ฒ ์ ๋ฌ๋์๋์ง, Base64 ์ธ์ฝ๋ฉ์ด ์ ํํ์ง, ๊ทธ๋ฆฌ๊ณ ์ฌ๋ฐ๋ฅธ ํค๋์ ํฌํจ๋์๋์ง ๋ค์ ํ์ธํด์ผ ํฉ๋๋ค.
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.
