# Zapier

> Start Zaps when visitors complete goals, payments arrive or traffic spikes, and send events to Reveata from any app.

The Reveata app for Zapier connects your analytics to thousands of other apps. **It is not in Zapier’s app directory yet**: until it is, use the API with Webhooks by Zapier as described below.

| | Name | When it runs |
| --- | --- | --- |
| Trigger | **New Goal Completion** | A visitor completes a goal (all goals, or one you choose). |
| Trigger | **New Payment** | A payment, renewal, trial or refund is recorded, with the channel, source and campaign it is credited to. |
| Trigger | **Traffic Spike Alert** | One of your traffic spike alerts fires. |
| Action | **Send Custom Event** | Records a goal on your website, for example a booked call, optionally for a known visitor. |

## Connect today: Webhooks by Zapier

1. Create an access token in **Account → API / MCP** with the permissions listed below.
2. In Zapier, add **Webhooks by Zapier** and call the [Reveata API](https://reveata.com/docs/api-and-cli) with the token as a Bearer token: for example `GET https://reveata.com/api/v1/websites/{website}/goal-completions` in a polling trigger, or `POST …/events` to send an event.

## Once the app is listed

1. Create an access token in **Account → API / MCP** with `websites:read` (for the website picker) plus the permissions your Zaps need: `goals:read` for goal completions, `payments:read` for payments, `alerts:read` for traffic spikes and `goals:write` to send events.
2. In Zapier, add Reveata and enter the address you open Reveata at (for example `https://reveata.com`) and the token.
3. Pick the website in each trigger or action.

A website API key (`dt_site_`) also works for one website, except for traffic spike alerts.

## How triggers work

Zapier checks Reveata every few minutes (how often depends on your Zapier plan) and starts a Zap for each new item. Triggers look at the last 30 days. Amounts come both in minor units (`amount`, e.g. `4900`) and as decimals (`amountDecimal`, e.g. `49`).

For traffic spikes, first create a **Traffic spike** alert for the website in Reveata; the trigger fires each time that alert does.

## Send Custom Event

Event names use lower-case letters, digits, `_` and `-`. Add a visitor id (from `window.reveata.visitorId()`) to credit the event to that visitor’s traffic source; without one the event still counts in your goal totals. Up to 20 text properties are kept.
