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

Aampe Official Destination

  1. Go to Menu → Data
  2. Click on Destinations
  3. Search for Aampe and select Cohorts
  4. Enter the following details:
    • Name: Aampe - Cohorts
    • API key: api_key
🚧 API Key To get the API key:
  1. Go to https://compose.aampe.com/system-setup/integrations/events
  2. Login using your org credentials
  3. Select Connect next to Aampe endpoint
  4. Copy the API key
  5. Paste it in place of api_key
  6. 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.
  7. Hit Save
  8. Go to Users → Cohorts, Select any Cohort that you want to sync and Hit Target Users and then Sync to Aampe destination
  9. Select Real-time Sync and hit Sync
  10. Your Aampe cohort integration is live

Setup Cohort Custom Webhook to Aampe

  1. Go to Menu → Data
  2. Click on Destinations
  3. Select Add Destination (+) sign
  4. Search for Webhook and Select Webhook (Cohorts) (There will be an event webhook as well - we don’t want to select that)
  5. Enter the following settings:
🚧 Important Note Get the API key from:
  1. Go to https://compose.aampe.com/system-setup/integrations/events
  2. Login using your org credentials
  3. Select Connect next to Aampe endpoint
  4. Copy the API key
  5. Paste it in place of api_key
  6. Sample: Bearer my_token
  7. Number of users per batch: 10000
  8. 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>,</#sep>
    </#list>
  ]
}
  1. Hit Save and your destination will be created.
  2. Now to start syncing go to Users → Cohorts
  3. Select any Cohort that you want to sync and Hit Target Users
  4. Select Sync this to Webhook, and choose Aampe-Cohorts that we previously created
  5. Select Real-time Sync and hit Sync
  6. Your Aampe cohort integration is live