How to configure TikTok Events API Gateway
Updated Oct 23, 2026
Before you begin
Since TikTok Events API Gateway routes the events your site already sends, you’ll need to set up TikTok web tracking on your site.
Step 1 | Create TikTok Events API Gateway on Stape
- 1.Log in to your Stape account and click Gateways in the dashboard.

2. Click Create gateway → Create TikTok Gateway.

3. Fill in:
- Gateway name – a descriptive label.
- Admin email – the account you'll use to log in to TikTok Events API Gateway. It can be different from your Stape login.
- Server location – pick the region closest to the majority of your traffic.
4. Click Create gateway.

5. Select a subscription plan and click Continue with <...>.

6. Wait for the gateway status to change to Running.

Step 2 | Connect the Pixel
- 1.Click Finish TikTok Gateway setup. If you don't see the button, you can also click the link that you can find under TikTok Events API Gateway settings.

2. Log in to the gateway with your admin email, set a password, and click Create Account. Stape never sees this password, store it somewhere safe.

3. In the Tenant list, click View details.

4. Click Connect data source.

5. Select your ad account and a dataset. Click Next.

6. You will see the pixel on your dashboard.

7. You can serve the TikTok Pixel library script through your own first-party subdomain instead of downloading it directly from TikTok's default servers. This will help you increase the protection of your events from ad blockers. In Data Sources, click View base code.

8. Follow the instructions on the Install Base Code pop-up.

Step 3 | Route traffic through your own domain (recommended)
Routing TikTok Events API Gateway through a custom domain on your own site measurably improves match quality and reduces ad-blocker loss.
- 1.Go to Settings → click Set up domain.

2. Enter the following:
- Prefix – the subdomain label to put before your root domain. For example,
tt,tiktok,data,events, orgateway. - Your domain – the root domain of your website (for example,
example.com). It should match the website domain where your TikTok Pixel is active.
Click Next.

3. You’ll get the values you have to provide to your DNS provider.

4. In your DNS provider (in our case Cloudflare), add a new record:
- Type -
CNAME - Name - the Record name from step 3.
- Target - the Value from step 3.
- Proxy status - off. If you keep it on, the Stape support team might not see the record and help with debugging.
Click Save.

5. Back in TikTok Events API Gateway, wait until that status changes from Waiting to Completed.

Note:
Disabling data routing is currently not supported. As a workaround, you can remove the existing DNS records. This will prompt the Events API to attempt sending events to the custom subdomain first, recognize that it is unreachable, and automatically fall back to routing events through the standard hub URL.
What to do if custom subdomain isn’t verified
Domain verification can take up to 72 hours, but it usually happens within 30-60 minutes if your DNS records are correct. If it takes more time for you, there may be a problem with your configurations.
There are the main reasons why a subdomain may not verified:
- Typo in the Name/Host field – some DNS managers automatically append your root domain. If you enter
data.yourdomain.cominstead of justdata, the record might resolve todata.yourdomain.com.yourdomain.com. In some DNS providers, only the prefix (for example,data) should be entered in the Host/Name field. - Proxy status enabled – if you use Cloudflare, ensure the proxy status for the CNAME record is set to DNS only, not Proxied.
- Target mismatch – ensure the CNAME points to the exact gateway target provided by Stape, with no spaces or typos.
- Conflicting DNS records – ensure there are no existing A, AAAA, or conflicting CNAME records for the exact same subdomain name in your DNS settings.
- Missing SSL – if you configured the custom domain using an Own CDN setup, Stape cannot verify the domain until an active SSL certificate is in place on your side.
You can check your DNS records with the Google Admin Toolbox Dig tool.
- 1.Enter your custom subdomain (for example,
data.yourdomain.com, withouthttps://or trailing slashes). - 2.Select the CNAME tab.
- 3.Verify that the returned target matches the exact value provided in your TikTok Events API Gateway dashboard.

Testing
Check the following:
- Events in the TikTok Events API Gateway. Open the Overview tab, in 30 minutes after triggering the events, you should see them in the dashboard.

- Events in TikTok Events Manager. Go to TikTok Ads Manager → Data sources → click on your Pixel. Under the Overview tab, check the incoming event timeline. Events routed through the gateway will display an indicator showing they were delivered through the Events API.

Was this article helpful?
🍽 Table of content:
Comments