---
title: "Create an event tracker"
method: POST
path: "/event_trackers"
tags: ["Event Trackers"]
---

# Create an event tracker

`POST /event_trackers`

## Request

- Base URL: `https://open.shopline.io/v1`
- URL: `https://open.shopline.io/v1/event_trackers`
- Auth: HTTP bearer

To create a new third party's event tracker<br>創建新第三方事件追蹤

## Query parameters

- `version` string

## Request body

- object
  - `event_key` 'tiktok' | 'facebook_standard_pixel', required: The platform of tracking services<br>追蹤平台<br>
  - `event_type` 'loaded_home_page' | 'added_product_to_cart' | 'loaded_checkout_page' | 'placed_an_order' | 'loaded_any_page', required: The event to be tracked<br>需要追蹤的事件<br>
  - `config_data` object, required: Config data, each event_key has its own config<br> 設定，每個event_key都有各自的config
    - `tracking_code` string: Tracking code<br>追蹤碼
    - `access_token` string: Access token

## Response `201`

Created

- EventTracker
  - `id` string: ID
  - `event_type` 'loaded_home_page' | 'added_product_to_cart' | 'loaded_checkout_page' | 'placed_an_order' | 'loaded_any_page'
  - `event_key` 'tiktok' | 'facebook_standard_pixel': The platform of tracking services
  - `status` 'active': The status of the event tracker
  - `created_at` string: created time
  - `updated_at` string: updated time
  - `config_data` object: Config data, each event has its own config key
    - `dynamic_remarketing` boolean: false by default
    - `single_variation` boolean: false by default
    - `unique_ids` boolean: false by default
    - `tracking_code` string: tracking code
    - `access_token` string: for tiktok

## Other responses

- `401`: Bad authentication
- `422`: Unprocessable entity
- `500`: Server error

## Changes

- **2026-11-03** `d2518391b149`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/shoplineapp/apis/shopline-open-api/changes/event_trackers/post.md)

---

[API](https://skmtc.dev/shoplineapp/apis/shopline-open-api.md) - [All operations](https://skmtc.dev/shoplineapp/apis/shopline-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shoplineapp/apis/shopline-open-api/revisions/d2518391b149?raw)
