Integrations / Amplitude
Amplitude
Product analytics: event segmentation, active users, session metrics and user lookups (US data residency).
6 actions
API key
6 read0 write
Calls amplitude.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "amplitude" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get active or new usersreadamplitude.active_usersGet counts of active or new users over a date range, per day, week or month.
| Input | Type | Description | |
|---|---|---|---|
start | string | Required | Start date, YYYYMMDD |
end | string | Required | End date, YYYYMMDD |
metric | string | Optional | Which users |
interval | integer | Optional | Bucket: 1 day, 7 week, 30 month |
await setu.execute({
userId: "user_1",
action: "amplitude.active_users",
input: {
"start": "<start>",
"end": "<end>"
},
});Get average session lengthreadamplitude.average_session_lengthGet the average session length in seconds per day over a date range.
| Input | Type | Description | |
|---|---|---|---|
start | string | Required | Start date, YYYYMMDD |
end | string | Required | End date, YYYYMMDD |
await setu.execute({
userId: "user_1",
action: "amplitude.average_session_length",
input: {
"start": "<start>",
"end": "<end>"
},
});Event segmentationreadamplitude.event_segmentationCount one event over a date range as uniques, totals or other metrics, bucketed by day, week or month.
| Input | Type | Description | |
|---|---|---|---|
event_type | string | Required | Event type name, e.g. watch_tutorial |
start | string | Required | Start date, YYYYMMDD |
end | string | Required | End date, YYYYMMDD |
metric | string | Optional | Metric |
interval | integer | Optional | Bucket size: 1 (day), 7 (week) or 30 (month) |
await setu.execute({
userId: "user_1",
action: "amplitude.event_segmentation",
input: {
"event_type": "<event_type>",
"start": "<start>",
"end": "<end>"
},
});Get user activityreadamplitude.get_user_activityGet the event stream and summary for one user by Amplitude id (limits are zero-based, so limit=1 returns two events).
| Input | Type | Description | |
|---|---|---|---|
user | string | Required | Amplitude id of the user |
limit | integer | Optional | Maximum events (up to 1000) |
offset | integer | Optional | Events to skip |
direction | string | Optional | Order |
await setu.execute({
userId: "user_1",
action: "amplitude.get_user_activity",
input: {
"user": "<user>"
},
});Get real-time active usersreadamplitude.realtime_active_usersGet active users in 5-minute buckets for today and yesterday.
No input.
await setu.execute({
userId: "user_1",
action: "amplitude.realtime_active_users",
input: {},
});Search for a userreadamplitude.search_userFind a user by Amplitude id, device id, user id or user id prefix. Returns matching Amplitude ids.
| Input | Type | Description | |
|---|---|---|---|
user | string | Required | Amplitude id, device id, user id or user id prefix |
await setu.execute({
userId: "user_1",
action: "amplitude.search_user",
input: {
"user": "<user>"
},
});