# Send Conversion Event — TikTok Ads Manager

> Send a server-side web conversion event to TikTok via the Events API. Use this to report purchases, sign-ups, and other conversions without relying on browser-side tracking. pixel_id is the TikTok Pixel ID found in Events Manager — not the…

- Key: `tiktok_ads_manager-send-conversion-event`
- Type: Action (Write)
- Version: 0.0.2
- App: TikTok Ads Manager (`tiktok_ads_manager`) — https://pipedream.com/apps/tiktok-ads-manager.md
- This page (HTML): https://pipedream.com/apps/tiktok-ads-manager/actions/send-conversion-event
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/tiktok_ads_manager/actions/send-conversion-event/send-conversion-event.mjs

## Description

Send a server-side web conversion event to TikTok via the Events API. Use this to report purchases, sign-ups, and other conversions without relying on browser-side tracking. `pixel_id` is the TikTok Pixel ID found in Events Manager — not the same as `advertiser_id`. Standard event names: `Purchase`, `CompleteRegistration`, `ViewContent`, `AddToCart`, `InitiateCheckout`, `Subscribe`, `Contact`, `Download`. User identifiers (`email`, `phone_number`, `external_id`) must be SHA256-hashed before passing. `timestamp` uses ISO 8601 format (e.g., `2024-01-15T19:49:27Z`). Defaults to current time if omitted. [See the documentation](https://business-api.tiktok.com/portal/docs/report-web-events-in-bulk/v1.3)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `pixelId` | `string` | Yes | Your TikTok Pixel ID (pixel_code). Find it in TikTok Events Manager under Assets → Events → Website Pixel. This is different from your advertiser ID. |
| `event` | `string` | Yes | Conversion event name. Standard values: Purchase, CompleteRegistration, ViewContent, AddToCart, InitiateCheckout, Subscribe, Contact, Download. Custom event names are also accepted. |
| `eventId` | `string` | No | Unique identifier for this event to prevent duplicates. Format: {UniqueID}_RandomNumber e.g. OrderID_357 or SessionID_892. If omitted, deduplication is not applied. |
| `timestamp` | `string` | No | Time the event occurred in ISO 8601 format. Example: 2024-01-15T19:49:27Z. Defaults to current time if omitted. |
| `value` | `string` | No | Total monetary value of the conversion (total order, not per-item). Required for Purchase events. Example: 99.99. |
| `currency` | `string` | No | ISO 4217 currency code. Required when value is set. Example: USD, EUR, GBP. |
| `email` | `string` | No | SHA256-hashed email address (lowercase before hashing). Do NOT pass plaintext. |
| `phoneNumber` | `string` | No | SHA256-hashed phone number. Include country code with + (e.g., +12025551234) before hashing. Do NOT pass plaintext. |
| `externalId` | `string` | No | SHA256-hashed unique identifier from your system (e.g., loyalty ID, user ID). Helps match events to TikTok users. |
| `pageUrl` | `string` | No | URL of the page where the event occurred. Example: https://example.com/checkout/confirmation. |
| `ipAddress` | `string` | No | Non-hashed public IP address of the user's browser (IPv4 or IPv6). Sending this alongside user_agent increases match rates. |
| `userAgent` | `string` | No | Non-hashed user agent string from the user's browser. Sending this alongside ip_address increases match rates. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "tiktok_ads_manager",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "tiktok_ads_manager-send-conversion-event",
  arguments: {
    pixelId: "Pixel ID",
    event: "Event Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "tiktok_ads_manager-send-conversion-event",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    tiktok_ads_manager: { authProvisionId: "apn_xxxxxxx" },
    pixelId: "Pixel ID",
    event: "Event Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "tiktok_ads_manager-send-conversion-event",
    "configured_props": {
      "tiktok_ads_manager": { "authProvisionId": "apn_xxxxxxx" },
      "pixelId": "Pixel ID",
      "event": "Event Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/tiktok-ads-manager.md · All apps: https://pipedream.com/apps
