VI | EN
Message us on Messenger
Developer resources

Get Pixel Event statistics — TikTok Business API

Get Pixel Event statistics · call it through Quantri360 with one API key for your own accounts / assets that you connected and authorized — 360 handles request signing and refreshing the authorization you granted.

Get Pixel Event statistics

GET/pixel/event/stats/Via 360: GET https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/
Description

Use this endpoint to view statistics of event data over a period of time. Statistics returned include the number of attributed events (the number of events attributed to your ads), the number of preview events (the number of events generated by the ad preview), and the total number of events received from all data sources.

> Important

> By using Events API endpoints, you agree to the TikTok Business Products (Data) Terms and that you will not share sensitive data with TikTok.

Request

Endpoint

GET https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/

Authentication & shop

NameInTypeSampleDescription
AuthorizationheaderheaderBearer q360_live_ab12cd34_…Khóa API của brand (tạo ở mục API key). Bắt buộc với mọi request. Brand suy từ key — không truyền mã brand.
platform_shop_idquerystring7000000000000000001Tài sản TikTok Business đã kết nối — "Mã tài sản" ở trang Nền tảng hoặc GET /v1/platforms (tài khoản quảng cáo cho Marketing API, tài khoản TikTok cho Organic / Messaging). Có thể bỏ khi chỉ kết nối một tài sản.

Request parameters

NameInTypeRequiredSampleDescription
date_rangequeryobjectYesTime range, which cannot exceed 30 days. Note: There may be slight differences between the event statistics obtained from this endpoint and the statistics displayed on Events Manager. This is because the event statistics from this endpoint are based on UTC time, while the statistics displayed on Events Manager are based on the advertiser's time zone.
pixel_idsquerystring[]YesPixel ID list. Max size: 10.

Request examples

curl -s "https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/?date_range=%7B%22start_date%22%3A%22%22%2C%22end_date%22%3A%22%22%7D&pixel_ids=%5B%5D" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/",
    params={
        "date_range": {
            "start_date": "",
            "end_date": ""
        },
        "pixel_ids": []
    },
    headers={"Authorization": f"Bearer {KEY}"},
    timeout=60,
)
print(r.status_code)
print(r.json())
Node.js
const KEY = 'q360_live_...'; // khóa API của brand
const url = new URL('https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/');
for (const [k, v] of Object.entries({"date_range":{"start_date":"","end_date":""},"pixel_ids":[]})) url.searchParams.set(k, typeof v === 'object' ? JSON.stringify(v) : String(v));
const r = await fetch(url, {
  method: 'GET',
  headers: { Authorization: `Bearer ${KEY}` },
});
console.log(r.status, await r.json());
PHP
<?php
$key = 'q360_live_...'; // khóa API của brand
$url = 'https://partner.quantri360.com/v1/tiktok_business/pixel/event/stats/' . '?' . http_build_query(['date_range' => '{"start_date":"","end_date":""}', 'pixel_ids' => '[]']);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $key]);
$res = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status, "\n", $res;

Response

Response fields (as returned by TikTok Business)

NameTypeSampleDescription
codenumberThe return code. For the complete list of error codes and descriptions, see Appendix - Return Codes.
messagestringThe return message. For details, see Appendix - Return Codes.
dataobjectReturned data.
listobject[]Data list.
pixel_idstringPixel ID.
statisticsobject[]Statistics.
pixel_event_typestringReturned only for a Standard Pixel Event. Standard Pixel Event type. To learn about the enum values, see the "Event name for ad creation (`optimization_event`)" column in Supported Pixel events - Pixel events.
custom_event_typestringReturned only for a Custom Pixel Event. Custom Pixel Event type. Custom Events are actions that TikTok partners can define themselves beyond the predefined Standard Events list. To learn more about Custom Events, see Standard and Custom Events. You cannot create a Custom Pixel Event via /pixel/event/create/, but you can send back a Custom Pixel Event directly by using the Events 1.0 endpoints /pixel/track/ or /pixel/batch/, or the Events 2.0 endpoint /event/track/. For instance, a `SHOPPING` event that is sent back will be regarded as a Custom Pixel Event because it's not included in the "Event" column in Events API 1.0 - Report web events and parameters - Supported web events or Events API 2.0 - Supported events - Web Standard Events.
attributed_countnumberAttributed events (number of events attributed to your ad).
preview_countnumberNumber of preview events (number of events generated by ad preview).
total_countnumberTotal number of pixel events for a specific event type (`pixel_event_type` or `custom_event_type`) received from all data sources. Formula: `total_count`= `browser_event_total_count` + `server_event_total_count`.
browser_event_total_countnumberNumber of pixel events for a specific event type received from web browser.
server_event_total_countnumberNumber of pixel events for a specific event type received from server.
request_idstringThe log id of a request, which uniquely identifies the request.

Response sample

HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "list": [
            {
                "statistics": [
                    {
                        "server_event_total_count": 3,
                        "convert_id": null,
                        "total_count": 10,
                        "browser_event_total_count": 7,
                        "attributed_count": 0,
                        "preview_count": 0,
                        "pixel_event_type": "ON_WEB_CART"
                    },
                    {
                        "server_event_total_count": 7803,
                        "convert_id": null,
                        "total_count": 12231,
                        "browser_event_total_count": 4428,
                        "attributed_count": 0,
                        "preview_count": 0,
                        "pixel_event_type": "ON_WEB_DETAIL"
                    },
                    {
                        "server_event_total_count": 0,
                        "convert_id": null,
                        "total_count": 16622,
                        "custom_event_type": "shopping",
                        "browser_event_total_count": 16622,
                        "attributed_count": 0,
                        "preview_count": 0
                    }
                ],
                "pixel_id": "{{pixel_id}}"
            }
        ]
    }
}
(/code);

Get started

  1. Sign up for Partner
  2. Enable a data type of the Ads (Marketing API) group on the platform page
  3. Create an API key (tick the TikTok Business channel)
  4. Call it as in the examples above