# Amplitude

## Cohort Sync

The Cohort Sync integration with Amplitude allows you to launch in-product surveys to specific cohorts you’ve already created in Amplitude. Enabling you to generate highly contextual and actionable insights which help create a deeper understanding of user behaviours.

### **Considerations**

Amplitude Cohort Sync is available to all customers on free and paid plans of Blitzllama.

### Setup&#x20;

#### Blitzllama Setup

1. Navigate to **Connections tab** on Blitzllama's dashboard
2. Click on **Amplitude** under **Sources**.
3. Click Connect and copy the **API key**.

#### Amplitude Setup

1. In Amplitude Data, click **Catalog** and select the **Destinations** tab.
2. In the Cohort section, click **Blitzllama**.
3. Click **Add another destination**.
4. Enter *Name* and *Blitzllama's API Key*.
5. Save the destination.

#### Send a cohort

1. In Amplitude, open the cohort you want to export.&#x20;
2. Click Sync, and choose Blitzllama.&#x20;
3. Select the destination.&#x20;
4. Select the sync cadence.&#x20;
5. Save when finished.&#x20;

After your cohort is synced, you can find it under Cohorts tab in the Blitzllama's dashboard. Expect updates to reflect within 15 minutes.

## Events Streaming

You can use Amplitude events to trigger in-app surveys via Amplitude's Event Stream method, enabling seamless, real-time survey launches based on user actions.

### **Considerations**

* **Amplitude Events Stream** integration is only available on Blitzllama's **Scale** plan.

### **Setup**

#### **Amplitude Setup**

1. Navigate to Amplitude's dashboard. In **Amplitude Data**, click **Catalog** and select the **Destinations** tab.
2. In the **Event Streaming** section, click **Webhook**.
3. Enter a sync name like **"Blitzllama Events Stream"**, then click **Create Sync**.
4. Toggle **Status** to **Enabled**.

#### **Blitzllama Setup**

5\. In Blitzllama, navigate to **Connections** > **Data Import** > **Amplitude**.

6\. Copy both the **Stream URL** and **API Key** from the **Events Streaming** section.

<figure><img src="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FfgWokKPEWUqJxITLPuzG%2Fimage.png?alt=media&#x26;token=a5070648-8d17-4223-8535-58a05080c7d8" alt=""><figcaption></figcaption></figure>

#### **Amplitude Setup (continued)**

7\. Return to the **Webhook** settings in Amplitude and paste the copied Stream URL into the **Webhook URL** field.

8\. In the **Headers** section, add a new header key `authorization` with the value set to the copied **API Key**.

<figure><img src="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FaRNOUeaM7v8bpUPc3674%2Fimage.png?alt=media&#x26;token=33f497a0-98b4-40ae-97ef-7ac3e188930e" alt=""><figcaption></figcaption></figure>

9\. Toggle on **Send Events** to begin sending events.

10\. Keep Amplitude's default payload under the Event Payload section.

11\. Choose the events you want to trigger surveys on—these will be sent to Blitzllama. You can add more events at any time.

<figure><img src="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2FmLtJVtHibRv6xZ4rss1O%2Fimage.png?alt=media&#x26;token=67919198-8c1f-4cf7-a085-92ac4284d5e8" alt=""><figcaption></figcaption></figure>

### **Launching Surveys with Amplitude Events**

1. In Blitzllama, open the **Survey Editor** and go to the **Configuration** tab.
2. Scroll to the **Select Survey Trigger** section, then choose the Amplitude event you wish to use as a trigger.
3. Surveys are launched after the Amplitude event occurs, so they require a **view trigger** - places in he app where the survey should be displayed - these are Blitzllama event (e.g., **MainActivity** in the screenshot).

<figure><img src="https://713176431-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MagfF5JPg-8vm99iTd9%2Fuploads%2Fuk5WMECAqwEoa9fClmX8%2Fimage.png?alt=media&#x26;token=4bafffa7-c525-4db1-b77e-519f1a0e097b" alt=""><figcaption></figcaption></figure>

For further reference, you can find more details in [Amplitude’s Webhook documentation](https://amplitude.com/docs/data/destination-catalog/webhooks)

{% hint style="info" %}
For any issues with setup, please write to <tech@blitzllama.com>.
{% endhint %}
