> ## Documentation Index
> Fetch the complete documentation index at: https://help.treble.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# fact_whatsapp_link_events

> Click and open events of your Treble WhatsApp links.

# fact\_whatsapp\_link\_events

Each row is one event on a Treble WhatsApp link (short links that open a WhatsApp conversation) — both user activity (clicks, conversations started) and the link's own lifecycle. It replaces the legacy `fact_whatsapp_links`.

## What questions does it answer?

* How many clicks does each link get, and when?
* Which links drive the most conversation starts?
* What is each link's click → conversation rate?

## Columns

| Column       | Type       | Description                                                                                                                               |
| ------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `event_id`   | UUID       | Unique identifier of the event                                                                                                            |
| `company_id` | Int32      | Your company (filtered automatically)                                                                                                     |
| `link_id`    | Int32      | The WhatsApp link                                                                                                                         |
| `link_name`  | String     | Name you gave the link                                                                                                                    |
| `event_type` | String     | User activity: `CLICK` (link opened), `CONVERSATION` (a conversation started from the link). Link lifecycle: `CREATE`, `UPDATE`, `DELETE` |
| `created_at` | DateTime64 | When the event happened                                                                                                                   |
| `synced_at`  | DateTime64 | When this row was last written/corrected                                                                                                  |

## Example queries

### Clicks and conversations per link, last 30 days

```sql theme={null}
SELECT
    link_name,
    countIf(event_type = 'CLICK')        AS clicks,
    countIf(event_type = 'CONVERSATION') AS conversations,
    round(100.0 * conversations / nullIf(clicks, 0), 1) AS conversion_pct
FROM fact_whatsapp_link_events
WHERE created_at >= today() - 30
GROUP BY link_name
ORDER BY clicks DESC
```
