# Triple Whale

Nimbata's Triple Whale integration sends calls to Triple Whale as offline events, so your calls show up next to your web traffic in Triple Whale's attribution. Each event sends a call as a lead, an MQL, an SQL, an opportunity, a booked demo or a custom event of your own. Triple Whale matches the call to a customer by the caller's number, and a workflow decides which calls are sent.

**Before you start**

- Permissions: Triple Whale, under Integrations, in your Nimbata role
- A Triple Whale account with your Shopify store connected, and access to its API keys (**Data** > **APIs**). On some accounts, Triple Whale support (<support@triplewhale.com>) has to enable API keys first.
- The **Triple Whale** tile on your Integrations page. Triple Whale comes with the same plans as Cometly. On a plan that does not include it, **Go to integration** offers an upgrade instead.
- The Nimbata project whose calls you want to send: the integration is set up per project.

## Connect Triple Whale

Triple Whale has no sign-in. Nimbata sends events with an API key that you create in Triple Whale, for the shop the events belong to.

1. **Open the Triple Whale integration**

   Go to **Integrations** and click **Go to integration** on the **Triple Whale** tile (1).

   [The Triple Whale tile on the Integrations page, with Go to integration marked 1]

   *Open the Triple Whale tile (1).*

2. **Create an API key in Triple Whale**

   In Triple Whale, go to **Data** > **APIs** and create an API key for your shop. Give it a name (such as `Nimbata`) and the scope **Pixel Attribution: Read**, which is enough for Nimbata's events. Copy the key.

   > **Note:** The key belongs to the Triple Whale user who created it. It stops working if that user loses access to the shop, and then you create a new one.

3. **Paste the key in Nimbata**

   Paste the key in **API key** (1) and click outside the field. Nimbata checks the key with Triple Whale and says "Triple Whale accepted this key. It is saved with your first event."

4. **Enter the shop**

   Enter your shop in **Shop** (2) and click outside the field. The shop is your Shopify domain, such as `your-store.myshopify.com`, or the shop id in the address of the Triple Whale app. A pasted store address is trimmed to the domain. The user who created the API key must have access to this shop.

   [The Triple Whale integration in Nimbata, with the API key field marked 1 and the Shop field marked 2 under Account Credentials]

   *Paste the API key (1) and enter the shop (2).*

> **Note:** The API key and shop are saved with your first event. Removing every event removes them too, so you paste the key again before you add a new one.

## Add your events

Once the key and shop are entered, the page shows your events, starting with a **Lead**. It is saved as soon as both are in, together with the key and shop, and Nimbata says "Triple Whale settings saved." Each event sends a call to Triple Whale as one offline event. To send calls as another event too, click **Add event**. Every change saves on its own, and an event with a missing or wrong field is not saved until you fix it.

1. **Choose the event type**

   In **Event type** (1), choose what Triple Whale records for a call: **Lead**, **MQL (marketing qualified lead)**, **SQL (sales qualified lead)**, **Opportunity**, **Book demo** or **Custom event**. Only a custom event has a name and properties of its own.

2. **Name a custom event**

   For a **Custom event**, type its name in **Event name** (2), such as `qualified_call`, and click outside the field. A name has up to 100 letters, digits, spaces, dots, dashes or underscores, and starts with a letter or digit.

3. **Choose its properties**

   Under **Properties** (3), add the call fields a custom event carries, such as the call's duration or its tags, or a fixed text. Each property has a name made of letters, digits and underscores, used once per event. Names Triple Whale's event uses itself (such as `source`, `campaign` or `type`) are not allowed. Triple Whale takes at most 3 KB per event, so keep the list short: Nimbata shortens the longest texts of a larger event.

   [A Triple Whale custom event with Event type Custom event marked 1, Event name qualified_call marked 2, and its Properties duration and tags marked 3]

   *Choose Custom event (1), name it (2) and add its properties (3).*

### Which calls are sent

A workflow decides which calls reach your events (see [Send calls with a workflow](#send-calls-with-a-workflow) below). For each of those calls, Triple Whale receives:

- **The caller's number**, which Triple Whale uses to match the call to a customer. A call with a withheld number cannot be matched, so it is skipped and not sent.
- **Its source.** A call from a Google Ads click is sent as `google-ads` and one from a Facebook ad click as `facebook-ads`, so Triple Whale counts it in that paid channel. Any other call is sent with its UTM source as it is (such as `newsletter`) and shows in Triple Whale as a source of its own, with its UTM campaign.
- **The event**, and for a custom event its properties.

Each call is sent to each event once.

## Test the integration

Triple Whale has no test mode: a test event is recorded in your account, for a test customer called `nimbata-test-event`, so it never lands on a real customer.

1. **Click Send Test**

   Click **Send Test** on the event. The button shows once the event is saved.

2. **Fill in the call details and send**

   A panel opens with the call details the event sends: a custom event's properties, then **UTM Source**, **UTM Campaign**, **Google Ads Click ID** and **Facebook Click ID**, which decide its source. Fill in any of them, such as `google` in **UTM Source**, and click **Send event**.

3. **Find the test event in Triple Whale**

   Nimbata says "Triple Whale recorded the event for the test profile nimbata-test-event. It can take up to an hour to show." Then, in Triple Whale:

   - **A lead** counts in **Acquisition** > **Attribution**, set to **Today** (in your shop's time zone). Add the metric **Pixel Unique Leads** with the columns button: the **Leads** column counts it in the row of its source, such as `google`.
   - **A custom event** is among your custom conversions. Ask Moby, Triple Whale's assistant, for today's custom conversion events of `nimbata-test-event`, or query `custom_pixel_events_table` in the SQL Editor.

## Send calls with a workflow

Nothing is sent to Triple Whale until a workflow sends it. Create a workflow on **Inbound Call** that fires when the **Call Ends**, add a **Triple Whale** action and choose its events, then click **Enable** (1). Each event is listed by its type, and a custom event by its name, such as **qualified_call (custom)**. Add filters before the action to send only some calls, such as calls over a minute long. Triple Whale is offered in inbound call workflows only.

Detailed guide: [Conversion workflows](https://help.nimbata.com/workflows/conversion-workflows).

[A workflow firing on Inbound Call, Call Ends, with a Triple Whale action sending the Lead event, and the Enable button marked 1]

*The workflow sends every inbound call to the Lead event when the call ends. Click Enable (1).*

## Check it worked

The Triple Whale page now shows **Used in 1 workflow**, and the event lists the workflow that sends it. From now on, each call that meets the conditions in [Which calls are sent](#which-calls-are-sent) is sent to Triple Whale when it ends, and a lead counts in **Pixel Unique Leads** on Triple Whale's attribution page.

[The Triple Whale integration used in 1 workflow, with the saved API key and shop and the Lead event used by the workflow]

*The page shows Used in 1 workflow, and the event lists the workflow that sends it.*

## Troubleshooting

### Nimbata does not accept the API key

- "An API key has no spaces" or "This API key is not valid": copy the key again from Triple Whale, with nothing before or after it, and paste it again.
- "Triple Whale rejected the API key": create a new key in Triple Whale (**Data** > **APIs**) and save it in Nimbata.
- Triple Whale says "Creating API keys is not enabled for your account" when you create the key: ask Triple Whale support (<support@triplewhale.com>) to enable API keys for your account.

### The test event fails

- "Triple Whale did not accept this shop": check the **Shop**, and that the user who created the API key has access to it. If both are right, Triple Whale may be having a problem: try again later.
- "Triple Whale rejected the event": check the event name and properties, and keep them under 3 KB.
- "Triple Whale is limiting requests right now" or "Too many test events": wait a minute and try again.
- "Triple Whale could not be reached": try again in a moment.

### There is no Send Test button

The event is not saved yet. Fix the field marked in red, such as "Enter the event name." or a property name that is used twice, and the button appears once the event saves.

### You cannot remove an event, or clear the key or shop

Nimbata says "Workflows still send calls to these Triple Whale events. Remove them from those workflows first." An event a workflow sends to cannot be removed, and the key or shop it is sent with cannot be cleared, so the workflow never stops sending without a word. Remove the event from the workflow's **Triple Whale** action, then try again.

### Calls are not reaching Triple Whale

- Check that the workflow is enabled and that its **Triple Whale** action lists the event.
- Check that the API key and shop are still saved: without them, no event is sent. The page then says the events are not sent until an API key and a shop are saved.
- Check that the caller's number was not withheld: such calls are skipped.
- Give Triple Whale up to an hour, and look at **Today** in your shop's time zone.
