Amplitude - Cohort Syncs
This method is used to sync cohorts to Aampe in real-time
Cohorts built in Amplitude can be synced to Aampe in 2 ways
- Aampe official destination
- [Cohort sync via Webhook] - Syncs to Aampe via a custom webhook
Aampe Official Destination
- Go to Menu -> Data

- Click on Destinations
- Search for Aampe and select Cohorts

- Enter the following details
- Name: Aampe - Cohorts
- API key: {api_key}
API Key
-
- Important Note
Note that you will need the API key that you can fetch from - Go to: https://compose.aampe.com/system-setup/integrations/events
- Login using your org credentials
- Select Connect next to Aampe endpoint
- Copy the API key
- Paste it in place of {api_key}
- Important Note
-
- Select the User ID mapping. Here you want to select user ID which connects to your other aampe data, Aim for a non PII identifier if available.

-
Hit Save
-
Go to Users -> Cohorts, Select any Cohort that you want to sync and Hit Target Users and then Sync to Aampe destination
- Select Real-time Sync and hit Sync

- Your Aampe cohort integration is live
Setup Cohort custom Webhook to Aampe
- Go to Menu -> Data

- Click on Destinations

- Select Add Destination (+) sign
- Search for Webhook and Select Webhook (Cohorts) (There will be an event webhook as well - we dont want to select that)

- Enter the following settings:
- Display Name: Aampe-Cohorts
- Webhook URL: https://ingestion.api.aampe.com/v1/amplitude/cohorts
- Headers: Add the following Header:
- Key: authorization
- Value: Bearer {api_key}
Important Note
Note that you will need the API key that you can fetch from
- Go to: https://compose.aampe.com/system-setup/integrations/events
- Login using your org credentials
- Select Connect next to Aampe endpoint
- Copy the API key
- Paste it in place of {api_key}
- Sample:
Bearer my_token
- Number of users per batch: 10000
- Define cohort update payload:
- Select Customize Payload
- Copy this to the editor:
<#assign FtlUtils=statics['com.amplitude.integrations.connector.utils.FtlUtils']> { "batch": [ <#list input.users as user> { "type": "identify", "userId": "${user.user_id}", "traits": { "[Amplitude] ${input.cohort_name}: ${input.cohort_id}": ${input.in_cohort} <#if user.user_properties?? && user.user_properties?size gt 0> , <#list user.user_properties?keys as key> "${key}": ${FtlUtils.toJsonString(user.user_properties[key])}<#sep>,</#sep> </#list> </#if> }, "context": { "integration": { "name": "Amplitude Cohort Sync", "version": "1.0.0" } } }<#sep>, </#list> ] }

- Hit Save and your destination will be created.
- Now to start sycning go to Users -> Cohorts

- Select any Cohort that you want to sync and Hit Target Users

- Select Sync this to Webhook, and choose Aampe-Cohorts that we previously created
- Select Real-time Sync and hit Sync

- Your Aampe cohort integration is live
Updated 15 days ago