> Site index: https://usehardal.com/llms.txt
> Every content route also serves markdown at <url>.md

# TikTok DNS Setup: First-Party Domain for Events API

Set up TikTok Events API (eAPI) DNS records on a first-party domain. Add the CNAME and TXT records, verify DNS propagation, and test your Pixel.

Source: https://usehardal.com/how-to-set-up-first-party-domain-for-tiktok-eapi
Published: 2025-12-15
Updated: 2026-08-22
Author: Emircan Uye

---

> **Quick answer:** Pick a subdomain you own, then add the CNAME and TXT records from your Events API Gateway dashboard. Once both records verify, set the domain as primary if required and test browser and server events.

This guide shows how to connect a first-party domain to TikTok Events API (eAPI) through Hardal. Keep your current DNS resolver. Public TikTok DNS addresses, fixed IP addresses, and lists of `tiktok.com` domains are not part of this setup.

## What is TikTok DNS setup for Events API?

Here, **TikTok DNS** means the records that connect an advertiser-owned subdomain, such as `eapi.example.com`, to TikTok Events API Gateway. Your computer, phone, and router keep their existing DNS resolvers.

The setup has two jobs:

1. A **CNAME record** routes the chosen subdomain to the gateway target.
2. A **TXT record** proves that you control the domain.

The gateway generates the hostnames and values for your account. Copy them from your own gateway. Another site's target or verification token will not verify your domain.

## Before you configure the TikTok domain

You need:

- A TikTok Events API Gateway configured and active in Hardal
- Access to the DNS zone for your website domain
- Permission to manage the connected TikTok Pixel or dataset
- Help from your IT or infrastructure team if another team owns DNS

If the gateway is not active yet, complete the [TikTok Events API Gateway setup guide](https://usehardal.com/tiktok-events-api-gateway-hardal-setup) first.

## Step 1: Open the TikTok Events API Gateway

In Hardal, select the relevant signal and open **Server Side Hosts**. Confirm that TikTok Gateway is configured and active, then follow its link to the TikTok Events API Gateway dashboard.

Open the gateway tied to the TikTok Pixel or dataset you want to track. Otherwise, you will configure the wrong connection.

## Step 2: Start the domain setup

In the TikTok Events API Gateway dashboard:

1. Open **Settings**.
2. Select **Set up domain**.
3. Review the domain requirements and click **Next**.

![TikTok Events API Gateway settings with the Set up domain option](https://imge.usehardal.com/cdn/website/blog-post/how-to-set-up-first-party-domain-for-tiktok-eapi/vssg5ktk1yd06zdcs0w2.jpg)

## Step 3: Choose a first-party TikTok domain

Use a dedicated subdomain of a domain your business controls. For example:

```
eapi.example.com
```

Any of these work:

- `tiktok.example.com`
- `events.example.com`
- `tracking.example.com`

Enter the hostname only, with no `https://`, trailing slash, or path. Use a dedicated subdomain so the CNAME does not collide with the records serving your main website.

![Domain field for a TikTok first-party tracking subdomain](https://imge.usehardal.com/cdn/website/blog-post/how-to-set-up-first-party-domain-for-tiktok-eapi/tc3jxnipzuqc2qlmh3wf.jpg)

If the dashboard offers **Set as primary domain**, select it to route supported TikTok Pixel requests through this endpoint. Click **Next** to generate the DNS instructions.

## Step 4: Copy the TikTok DNS records

Hardal's setup flow generates two records, a CNAME and a TXT verification record.

| Record | Purpose | What to copy |
|---|---|---|
| CNAME | Routes your tracking subdomain to the gateway | The host or name and target shown in the dashboard |
| TXT | Verifies control of the domain | The verification host or name and token shown in the dashboard |

Copy every character exactly. Never copy record values from a screenshot or another setup. Use the values in your gateway.

This flow does not use an A record or fixed TikTok DNS server IP. Add one only if your gateway explicitly asks for it.

## Step 5: Add the records at your DNS provider

Log in to the service that hosts your domain's authoritative DNS. Your DNS host and domain registrar may be different companies. Common hosts include Cloudflare, GoDaddy, Namecheap, and Route 53.

For each record:

1. Select the record type shown by the gateway.
2. Paste the **Name** or **Host** value.
3. Paste the **Target**, **Content**, or **Value**.
4. Leave TTL on **Automatic** or use your provider's default.
5. Save the record.

DNS control panels handle hostnames differently. Some expect only the label, such as `eapi`, and append `example.com` automatically. Others accept the complete hostname. Check the preview before saving so you do not accidentally create `eapi.example.com.example.com`.

If your DNS provider can proxy CNAME traffic, match the setting shown by the gateway. When the gateway requires direct DNS resolution, leave the record DNS-only.

## Step 6: Verify DNS propagation

Return to the gateway and wait for both records to show as verified. Many changes appear within minutes. Old answers can remain cached until the record's TTL expires.

You can inspect the public DNS response before retrying verification:

```bash
dig CNAME eapi.example.com +short
```

For the TXT record, query the exact verification hostname shown in the dashboard:

```bash
dig TXT <verification-hostname> +short
```

On Windows, use:

```powershell
nslookup -type=CNAME eapi.example.com
nslookup -type=TXT <verification-hostname>
```

The CNAME result should match the gateway target. The TXT result should contain the verification token. These lookups confirm that the records are public. The gateway still decides whether the setup passes.

## Step 7: Activate the first-party domain

Once the CNAME and TXT records pass verification:

1. Confirm the domain setup in the gateway.
2. Set the domain as primary if that is part of your configuration.
3. Wait for the gateway to finish provisioning before testing traffic.

## Step 8: Test TikTok Pixel and Events API traffic

Check the browser request first:

1. Open your website in a new browser tab.
2. Open developer tools and select **Network**.
3. Reload the page and trigger a test event.
4. Filter for your custom hostname, such as `eapi.example.com`.
5. Confirm that the request completes without a DNS, certificate, or HTTP error.

Then check the data connection in TikTok Events Manager:

1. Select the relevant Pixel or dataset.
2. Open **Test events**.
3. Trigger a test conversion on the website.
4. Confirm that the browser and Events API events appear.
5. Review diagnostics for missing parameters or connection errors.

TikTok recommends using Pixel and Events API together for website conversions. When both connections send the same conversion, pass a shared event ID and confirm deduplication so TikTok does not count the event twice. Read TikTok's [official Events API guidance](https://ads.tiktok.com/help/article/events-api?redirected=1) for the current connection recommendations.

## TikTok DNS troubleshooting

| Problem | What to check |
|---|---|
| CNAME not found | Check whether the DNS provider appended the root domain twice. Confirm that you added the record at the authoritative DNS host, not an inactive panel at the registrar. |
| CNAME conflict | A CNAME cannot share a hostname with an A or AAAA record. Pick a new subdomain, or remove the conflicting record after confirming that no other system uses it. |
| TXT record will not verify | Compare the TXT hostname and token with the gateway. Remove quotation marks you added yourself, but leave any quotes the DNS provider displays automatically. |
| Public DNS works, gateway still pending | Retry after the gateway's next verification check. Public resolvers and the gateway may see different cached answers until the old TTL expires. |
| Domain verifies, requests fail | Check the browser Network panel. `DNS_PROBE_FINISHED_NXDOMAIN` points to DNS, a certificate warning points to TLS provisioning, and a 4xx or 5xx response means the request reached an HTTP service. |

## What a first-party domain does

The first-party domain puts the gateway endpoint under a hostname your business owns. Browser requests go to `eapi.example.com` instead of a vendor hostname.

DNS handles that routing. Parameters, match keys, consent handling, and Pixel and Events API deduplication determine whether the resulting data is useful.

When the domain passes verification, run one test conversion and confirm that it appears in TikTok Events Manager. If the gateway itself is not ready, follow [the Hardal setup guide](https://usehardal.com/tiktok-events-api-gateway-hardal-setup) or watch the [step-by-step video](https://youtu.be/mrCBmqBg-NI).
