> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Send from a GTM server container

Add the Zernio Conversions API tag to a Google Tag Manager server container, so one tag sends its conversions to Zernio and every ad platform, deduplicated.

After this page, your Google Tag Manager server container sends its conversions to Zernio with one tag. Zernio forwards each one to Meta, Google Ads, TikTok and your other ad platforms, deduplicated.

## When to use it

Use this tag when a GTM server container, on Stape, Google Cloud or your own server, already receives your GA4 events and runs a separate tag for each ad platform.

The **Zernio Conversions API** tag replaces those per-platform tags. It calls the public `POST /v1/events` endpoint that the [Send events](/products/conversions-api/send) page documents.

Without a server container, use the [Zernio tag](/products/server-side-tracking/install) on your site instead. It sends conversions server-side by itself. For a web container, use the [Zernio Tracking Tag](https://github.com/zernio-dev/gtm-template).

## Before you start

- A team with ads access: included on usage-based plans; legacy plans need the Ads add-on.
- The `profileId` of the profile whose ad accounts get the events.
- At least one ad account switched on for that profile, under **Ads**, then **Conversions**. Without one, events are stored but sent nowhere. See [Choose where it sends](/products/server-side-tracking/ad-accounts).
- A server container whose GA4 client receives your events, and permission to publish it.

## Step 1: Create a key for Conversions only

The key sits in your container, where anyone who edits it can read it. Limit it to sending conversions:

1. In Zernio, open [API keys](https://zernio.com/dashboard/api-keys) and click **Create key**.
2. Name it, for example `GTM server container`.
3. Set **Permission** to **Read and write**.
4. Under **Profiles**, pick the one profile.
5. Under **Features**, turn off **All features**, then turn on **Ads** only.

Copy the key, which starts with `zrk_`. It cannot post, read messages or change other profiles.

## Step 2: Import the template

1. Download `template.tpl` from Zernio's [gtm-server-template](https://github.com/zernio-dev/gtm-server-template) repository on GitHub.
2. In the server container, open **Templates**. Under **Tag Templates**, click **New**.
3. Click the **⋮** menu at the top right, then **Import**, and pick `template.tpl`.
4. Click **Save**.

## Step 3: Create the tag

Click **Tags**, then **New**, and pick **Zernio Conversions API**. Fill in:

| Field | What to enter |
|---|---|
| **Zernio API key** | The key from step 1 |
| **Profile ID** | The profile's 24-character id |
| **Event name (optional)** | Leave empty, so each GA4 event keeps its standard name |
| **Also send GA4 events with no standard name, under their own name** | Off, unless you want your own event names sent too |
| **Skip events whose ad_storage or ad_user_data consent is denied** | On, the default |
| **Visitor country (optional)**, under **Consent** | A variable with the visitor's two-letter country code, such as a geo header your host adds |

Fire it on a trigger of type **Custom**, on **Some events**, where **Client Name** equals **GA4**. The tag skips `page_view`, `scroll` and other events with no standard name, unless you turned on the option above.

Save the tag. Leave the per-platform tags on until step 4 shows the events arriving.

## Step 4: Test with a test code

1. Copy the test code from Meta Events Manager, **Test events**.
2. In the tag, open **Testing and logs** and paste it into **Test code**. Tick **Log to the console in Preview mode**.
3. Click **Preview**, and make a test purchase on your site.
4. Check the event in Meta's **Test events** tab.

In preview, the console shows each request the tag sends and Zernio's answer.

Zernio forwards test events but never stores them. Then empty **Test code**, publish, and make one real purchase.

Open **Ads**, then **Conversions**, then the **Events** tab: the event shows with every send to every destination.

## Step 5: Turn off the per-platform tags

Once the events reach Zernio, pause the server container's Meta, Google Ads and TikTok conversion tags. Each platform then gets one server copy, from Zernio.

Keep the browser pixels if you use them. They deduplicate against Zernio through the shared event id.

## What it sends

The tag reads the GA4 client's event data and sends one event per tag firing:

| Event data | Zernio field |
|---|---|
| `event_name`, under its standard name | `eventName` |
| `transaction_id` on a `Purchase`, else `event_id`, else `x-fb-event_id`, else a new id | `eventId` |
| The time the tag fires | `eventTime`, in unix seconds |
| `value`, `currency` | `value`, `currency` |
| `items`: `item_id`, `item_name`, `item_category`, `price`, `quantity` | `items`: `id`, `name`, `category`, `price`, `quantity` |
| `user_data.email_address` (or `user_data.email`), `user_data.phone_number` | `user.email`, `user.phone` |
| `user_data.address`: `first_name`, `last_name`, `city`, `region`, `postal_code` | `user.firstName`, `lastName`, `city`, `state`, `zip` |
| **Visitor country**, else `user_data.address.country` | `user.country` |
| `user_id`, `client_id` | `user.externalId`, `user.gaClientId` |
| `ip_override`, `user_agent` | `user.ipAddress`, `user.userAgent` |
| `transaction_id` | `user.orderId` |
| The Zernio tag's `_zid` cookie | `user.visitorId` |
| `page_location` | `sourceUrl` |
| `gclid`, `gbraid`, `wbraid`, `dclid`, `ttclid`, `msclkid`, `twclid`, `li_fat_id`, `ScCid`, `rdt_cid` and other click ids in `page_location` | `user.clickIds` |
| `fbclid` in `page_location`, when there is no `_fbc` cookie | `user.clickIds.fbc`, built the way Meta's pixel builds it |
| The `_fbc`, `_fbp`, `_ttp`, `_scid`, `_epik` and `_rdt_uuid` cookies, when the URL has no such id | `user.clickIds.fbc`, `fbp`, `ttp`, `scid`, `epik`, `rdt_uuid` |
| `x-ga-gcd`, with `x-ga-gcs` filling in `ad_storage` and `analytics_storage` | `consent` on the event |

Every event also carries `actionSource: "web"`.

GA4 names map to Zernio's: `purchase` to `Purchase`, `generate_lead` to `Lead`, `sign_up` to `CompleteRegistration`, `begin_checkout` to `InitiateCheckout`, `add_to_cart` to `AddToCart`, `view_item` to `ViewContent`.

The full list of standard names is on [Send events](/products/conversions-api/send#event-names).

## How it behaves

- **Dedup.** A purchase uses its `transaction_id` as `eventId`, the same id the Zernio tag and store connections give it. For other events, set a GA4 `event_id` parameter in your web tags with the id your browser pixel sends, so each platform keeps one copy. See [Count each conversion once](/products/server-side-tracking/deduplication).
- **No event id.** An event other than a purchase with no `event_id` gets a new id each time, which no pixel can match.
- **One sender per event.** If the Zernio tag or a store connection already sends an event, do not also send it from the container, unless both copies share the event id.
- **Plain values only.** Zernio hashes email and phone itself. The tag does not read the `sha256_` fields of `user_data`.
- **Consent.** With the consent box on, an event whose `ad_storage` or `ad_user_data` is denied never leaves the container. Every event sent carries the Consent Mode signals it has, and Zernio applies your profile's consent rules on top. See [Consent](/products/conversions-api/send#consent).
- **Bad values.** A `value` that is not a number, or a `currency` that is not a three-letter code, is left out instead of failing the event.
- **Async.** The tag sends `mode: "async"`, so Zernio answers `202` at once and sends to each ad platform on its own.
- **Failures.** Any answer other than `2xx`, or none within 5 seconds, marks the tag as failed in the container. The tag does not retry.
- **Source.** Events arrive with source `api`, like any `POST /v1/events` call. A [forwarding rule](/products/server-side-tracking/ad-accounts#choose-with-the-api) with source `api` covers them.

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `401` | The key is missing or wrong | Paste the key again |
| `403 ads_addon_required` | The team is on a legacy plan without the Ads add-on | Move to usage-based billing, or add the Ads add-on |
| `403 insufficient_permissions` | The key has **Ads** turned off | Create a key with **Ads** on |
| `404` | The profile is not in your team, or not in the key's profiles | Copy the profile id again |
| `400` naming a field | A value has the wrong type, or the event is over 32 KB | Read `param` in the preview console |
| `warnings` with `no_destination` | No ad account is switched on for the profile | Switch one on under **Ads**, then **Conversions** |
| Nothing sent, and the console (with logging on) says **Skipped** | The event has no standard name, or the visitor denied ad consent | Map the event in your web container, or check your consent banner |
| Events in Zernio, none on a platform | No ad consent for an EEA, UK or Swiss visitor | Check your consent banner sets Consent Mode |

## Related

- [Send events](/products/conversions-api/send)
- [Send events reference](/conversions/send-events)
- [Count each conversion once](/products/server-side-tracking/deduplication)
- [Choose where it sends](/products/server-side-tracking/ad-accounts)
- [Send Segment and RudderStack events](/products/conversions-api/segment-rudderstack)