> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pingtree.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok Enhanced Conversions

> Send server-side conversion events to TikTok via the Events API with ttclid tracking and buyer-level event triggers.

You can optimize your TikTok ads based on events that happen after form submission — such as sales, offer completions, or buyer acceptance — by sending server-side events from Pingtree to TikTok's Events API. This gives you more accurate attribution than pixel-based tracking alone, especially when combined with the `ttclid` click identifier.

***

## Capturing the TikTok Click ID

When a lead arrives from a TikTok ad, Pingtree automatically captures the `ttclid` parameter from the URL and stores it on the lead record. This identifier links the conversion back to the specific ad click, improving match rates in TikTok Ads Manager.

***

## Step 1: Generate an Access Token

1. Log into [TikTok Ads Manager](https://ads.tiktok.com/).
2. Open the **Pixel** you want to track with.
3. Go to the **Settings** tab.
4. Click **Generate Access Token** under *Server-Side Tracking*.

Save this token securely — you'll need it to authorize all API calls. Tokens expire periodically, so set a reminder to rotate them.

***

## Step 2: Define Conversion Points

TikTok conversion events can be tied to any stage in the lead lifecycle. You can map any TikTok standard event or custom event to a Pingtree trigger:

| Trigger                       | When It Fires                      | Configure At                                       |
| ----------------------------- | ---------------------------------- | -------------------------------------------------- |
| **Form Submission**           | User submits a form                | Source > Postbacks > On Form Submit                |
| **Lead Sold**                 | Lead is accepted by a buyer        | Distribution > Posting API                         |
| **Offer Wall Click**          | User clicks on an offer            | Source > Postbacks > On Offer Click                |
| **Offer Wall Conversion**     | User completes a third-party offer | Source > Postbacks > Filter by Events              |
| **Custom Buyer-Based Events** | Lead is routed to a specific buyer | Distribution > Routing Rules with event conditions |

***

## Step 3: Send Events to TikTok

**Endpoint:**

```
POST https://business-api.tiktok.com/open_api/v1.3/event/track/
```

**Headers:**

```
Access-Token: {YOUR_ACCESS_TOKEN}
Content-Type: application/json
```

> **Tip:** Confirm the exact endpoint version in your TikTok Events Manager, as TikTok may update the API version over time.

***

## Payload Field Mapping

| Pingtree Field   | TikTok Field   | JSON Path                        | Notes                                    |
| ---------------- | -------------- | -------------------------------- | ---------------------------------------- |
| `email`          | `email`        | `data.0.user.email`              | SHA-256 hashed                           |
| `mobile`         | `phone_number` | `data.0.user.phone`              | SHA-256 hashed                           |
| `transaction_id` | `event_id`     | `data.0.event_id`                | Unique per event                         |
| `ip`             | `ip`           | `data.0.user.ip`                 | Improves match rate                      |
| `user_agent`     | `user_agent`   | `data.0.user.user_agent`         | Recommended                              |
| `ttclid`         | `ttclid`       | `data.0.user.ttclid`             | TikTok click identifier                  |
| `utc_timestamp`  | `timestamp`    | `data.0.event_time`              | UNIX timestamp in UTC                    |
| `revenue`        | `value`        | `data.0.properties.value`        | Revenue or sale amount                   |
| *(static)*       | `event_source` | `event_source`                   | Set to `"web"`                           |
| *(custom)*       | `event`        | `data.0.event`                   | e.g., `CompleteRegistration`, `Purchase` |
| *(static)*       | `currency`     | `data.0.properties.currency`     | Usually `"USD"`                          |
| *(static)*       | `content_type` | `data.0.properties.content_type` | Usually `"product"`                      |

***

## Sample Payload

```json theme={null}
{
  "event_source": "web",
  "event_source_id": "{PIXEL_ID}",
  "data": [
    {
      "event": "CompleteRegistration",
      "event_time": 1655321234,
      "event_id": "txn_abc123",
      "user": {
        "email": "c3fcd3d76192e4007dfb496cca67e13b",
        "phone": "b7c3d3d131bde4123ac85b9e6807631f",
        "ttclid": "E.C.P.abc123xyz",
        "ip": "203.0.113.1",
        "user_agent": "Mozilla/5.0..."
      },
      "properties": {
        "value": 50.0,
        "currency": "USD",
        "content_type": "product"
      }
    }
  ]
}
```

***

## Attribution Tips

* Always include `ttclid` when available — it is the strongest signal for TikTok attribution.
* Hash `email` and `phone` with SHA-256 before sending. Pingtree's data transformer can handle this automatically.
* Use real event timestamps in UTC to avoid time drift issues.
* Include `ip` and `user_agent` to improve match rates when `ttclid` is not available.

***

## Troubleshooting

TikTok provides a **Test Events** tool in the Events Manager to validate your server-side events before going live:

1. In TikTok Events Manager, locate your pixel and find the **Test Events** section.
2. Copy the test event code.
3. In Pingtree, go to your postback configuration and add a static field with the test code.
4. Fire a test event using the **Test Postback** tool in Pingtree.
5. Check TikTok Events Manager to confirm the event was received and matched.

For implementation help, contact your account manager or reach out via **Live Support** in the Pingtree app.
