# Set up a gateway

_Model your tag manager, CDP or custom event pipeline in Avo with your agent, through the Avo MCP._

> 🚧 Gateways are in closed beta. Reach out at [support@avo.app](mailto:support@avo.app) or in the chat bubble in the app to request access and share feedback.

[Gateways](https://www.avo.app/docs/data-design/avo-tracking-plan/gateways.md) are created and changed through the [Avo MCP](https://www.avo.app/docs/reference/avo-mcp/overview.md), so you set one up by asking your agent (Claude, Cursor, Codex or another MCP client) to do it on a branch. The app shows the gateway for review, and you merge the branch as usual.

## Before you start

- [Connect your agent to the Avo MCP](https://www.avo.app/docs/reference/avo-mcp/overview.md).
- Make sure the sources and destinations the gateway connects already exist in your tracking plan. Your agent can create missing ones in the same branch.
- Start small: one gateway, the sources that feed it, and one output, such as Meta. You don't need your whole tracking plan in Avo first. Start with the events that pass through the gateway.

## 1. Create the gateway

Ask your agent to create the gateway on a new branch, with an input for each source that feeds it and an output for each destination it sends to. For example:

> On a new branch in Avo, create a gateway called "Server-side GTM" with the Web, iOS and Android sources as inputs and Meta, Google Ads and Pinterest as outputs.

Avo gives each output an **output reference**, such as `meta-7f3k2q`. You'll paste it into your gateway setup later.

## 2. Choose what passes through

Decide, for events and for properties separately, whether each checkpoint sends everything or only what you list:

- **All sent** (the default). Every event and property that arrives passes on, apart from properties a transformation drops.
- **Allow list.** Only the events and properties on the list pass. Use it for an output that should only receive a known set, such as an ad platform.
  - **Events.** An event on the list keeps all its variants. An event added to the plan later doesn't pass until you put it on the list. Renaming an event doesn't put it on the list.
  - **Properties.** Only properties that a transformation names, or that come in an added bundle, pass. A property added to the plan later is dropped until you put it on the list.

For example:

> At the Meta output, only send `purchase`, `add_to_cart` and `ViewContent`. Only send `value`, `currency`, `contents` and `em`, and say that the gateway adds `event_id` to every event.

## 3. Describe what the gateway changes

Ask your agent to add the [transformations](https://www.avo.app/docs/data-design/avo-tracking-plan/gateways/transformations.md) for the gateway as a whole, for each output, or both. Describe them the way you'd explain your tags to a colleague:

> At the Pinterest output, send `transaction_id` as `order_id`. Stop sending `search_query` to every ad platform output. Require `tier` on product views sent to Meta.

Your agent can also write the transformations from your existing setup. Give it an export of your container (in GTM, **Admin** > **Export Container**), or access to your tag manager or CDP through that tool's own MCP or API. Ask it to compare what each tag sends with your tracking plan and describe the differences as transformations. Check the result on the branch before you merge.

## 4. Map origin hints to sources

Every event that reaches the gateway needs an origin hint, a value such as `web`, `ios` or `android` that names the source it came from. Without one, Avo can't check the event. On the same branch, open each source that feeds the gateway on the **Sources** page, go to its **Inspector setup** tab and add its value under **Origin hints**. Your agent can add them for you as well. See [Tell Avo which source an event came from](https://www.avo.app/docs/inspector/configuring-inspector-gateways.md#tell-avo-which-source-an-event-came-from).

## 5. Install Inspector before you merge

We recommend installing Inspector in development while the gateway is still on the branch. The gateway's Inspector API key works before you merge, so you can send test events through the gateway and check in the [Inspector Debugger](https://www.avo.app/docs/inspector/inspector-debugger.md) that they arrive at each checkpoint. Avo starts checking events against the gateway's design, and mapping origin hints to sources, once the branch is merged.

Follow [Configuring Inspector Gateways](https://www.avo.app/docs/inspector/configuring-inspector-gateways.md) for your gateway type.

## 6. Review and merge

Open the branch in Avo. The gateway appears on the **Sources** page under **Gateways**, and the branch diff lists every transformation as a rule, before and after. Open the gateway's **Transformations** tab to check what each output will receive.

[Ask a teammate to review the branch](https://www.avo.app/docs/workflow/review.md#how-to-request-a-review), such as whoever owns the tags or the destination. When it looks right, merge the branch.

## Keeping the gateway up to date

When your tags change, update the gateway the same way: ask your agent to change the transformations on a branch. When the plan changes, your agent can read the new definitions through the Avo MCP and tell you which tags to change. If your agent is also connected to your tag manager or CDP, for example through its MCP or API, it can make those changes there for you.

## Limits during the closed beta

- Gateways are created and edited through the Avo MCP only. The app shows them read-only.
- Gateways are only available in workspaces in the closed beta. A write to a workspace without access returns an error.

> Avo is the analytics governance platform for product data that lets you define it consistently, implement it correctly and trust it everywhere. Using an AI agent? Connect it to the [Avo MCP](https://www.avo.app/docs/reference/avo-mcp/overview.md) at `https://mcp.avo.app/mcp` and it can create this gateway for you on a branch, from your description or from your existing tags.
