> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/connectors/destinations/tiktok/server-side.md).

# Server-side

Send offline hashed data to TikTok Ads and build Custom Audiences.

The server-side TikTok connector sends offline hashed data from mediarithmics to TikTok Ads and creates Custom Audiences. It pushes the audience every time the segment is updated.

<table data-search="false"><thead><tr><th width="220">Connection</th><th></th></tr></thead><tbody><tr><td><strong>Type</strong></td><td>Server-side</td></tr><tr><td><strong>Category</strong></td><td><a href="/connectors/partner-types/social-and-retail-media.md">Social &#x26; retail media</a></td></tr><tr><td><strong>Identifiers sent</strong></td><td>Email hash (SHA-256), Mobile IDs (IDFA, AAID or both), Phone number hashes</td></tr><tr><td><strong>Authentication</strong></td><td>OAuth authorisation code, passed to your account manager</td></tr></tbody></table>

## Description

### What you can do with this connector

* Build a TikTok Custom Audience from a mediarithmics segment.
* Enrich a TikTok audience that already exists.
* Set how long TikTok retains the audience.

### Which identifiers are sent

* **Email hash (SHA-256)**
* **Mobile IDs** - IDFA, AAID, or both
* **Phone number hashes**

{% hint style="warning" %}
Your identifiers must match TikTok's formats **before** being hashed in SHA-256, otherwise the match rate can be zero. TikTok documents the expected formats in its [customer file guide](https://ads.tiktok.com/help/article/customer-file?lang=en).
{% endhint %}

TikTok is reached by several connectors and they behave differently - [the comparison is on the TikTok page](/connectors/destinations/tiktok.md).

## Connector setup

### Prerequisites

* A TikTok Ads Business account.
* The **advertiser ID** of the target TikTok account.

### Authentication

Whitelist the mediarithmics organisation:

1. Paste the authorisation URL provided by mediarithmics into your browser.
2. Make sure you are signed in with your **TikTok Ads Business** account.
3. Click **Confirm**.
4. You are redirected to mediarithmics with an `auth_code` query parameter in the URL - for example `https://navigator.mediarithmics.com/?auth_code=…`.
5. Give the code value, or the complete URL, to your account manager.

{% hint style="warning" %}
The `auth_code` expires after **1 hour**. Repeat the steps to generate a new one.
{% endhint %}

### Setup steps

{% stepper %}
{% step %}
**Complete the authorisation and pass the `auth_code` to your account manager.**
{% endstep %}

{% step %}
**Select the TikTok connector and fill in its configuration.**

<table data-search="false"><thead><tr><th width="300">Field</th><th></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>A name you choose.</td></tr><tr><td><strong>Advertiser ID</strong></td><td>The target TikTok advertiser account.</td></tr><tr><td><strong>Audience Name</strong> <em>(optional)</em></td><td>The name of the audience generated in TikTok Ads. Defaults to the mediarithmics segment name.</td></tr><tr><td><strong>Audience ID</strong> <em>(optional)</em></td><td>An existing TikTok Ads audience to enrich. Left empty, a new one is generated and this field is filled in by the connector.</td></tr><tr><td><strong>Retention in Days</strong> <em>(optional)</em></td><td>How long the audience is retained.</td></tr><tr><td><strong>Identifying Resources</strong></td><td>See below.</td></tr></tbody></table>

The identifying resources available:

<table data-search="false"><thead><tr><th width="360">Resource</th><th></th></tr></thead><tbody><tr><td><code>USER_EMAIL</code></td><td>Emails from UserEmail - global identifiers.</td></tr><tr><td><code>USER_PROFILE</code></td><td>Emails and/or phone numbers from UserProfile data, depending on the datamart configuration file. Only the selected compartments are used.</td></tr><tr><td><code>USER_DEVICE_TECHNICAL_ID</code> › <code>MOBILE_ADVERTISING_ID</code></td><td>GAID and IDFA from registries 2 and 3. Only the selected registries are used, and IDFAs cannot be distinguished from GAIDs.</td></tr></tbody></table>
{% endstep %}
{% endstepper %}

Creating and activating the feed on a segment is covered in the **Audience & Activation** section, under *Activate your audiences › Send your first-party data to a destination*.

## Good to know

Two TikTok limits shape what you can do:

* You can create **up to 400 audiences** on the TikTok platform.
* TikTok only considers an audience with [**at least 1,000 matched users**](https://ads.tiktok.com/help/article/custom-audiences?lang=en). Below that, the segment is unusable on the TikTok side.

{% hint style="danger" %}
A feed that does not reach 1,000 matched users is **renamed and stopped**: `feed_name` becomes `ERROR_NO_MATCHING_feed_name`.
{% endhint %}

## FAQ

#### My feed was renamed `ERROR_NO_MATCHING_…` and stopped. Why?

The audience did not reach TikTok's 1,000 matched-user threshold. Widen the segment or send more identifier types.

#### My match rate is zero. What should I check?

The format of your identifiers **before** hashing. TikTok expects specific formats, and a mismatch there produces no matches at all. See TikTok's [customer file guide](https://ads.tiktok.com/help/article/customer-file?lang=en).

#### The authorisation code stopped working.

It expires after an hour. Repeat the authorisation steps to generate a new one.

## Partner documentation

TikTok documents its own platform at <https://ads.tiktok.com/help/>. Use it for anything that happens on the partner side of this connector: account setup, the fields the partner expects, and its own limits.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/connectors/destinations/tiktok/server-side.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
