VI | EN
Message us on Messenger
Developer resources

Pixel event stats — Facebook API

Pixel Stats · 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.

Pixel Stats

GET/{version}/{pixel_id}/statsVia 360: GET https://partner.quantri360.com/v1/facebook/{version}/{pixel_id}/stats
Coming soon. This API already runs in production through 360 and pricing is being finalised — you can read the docs and prepare your integration now.
Description

Thống kê sự kiện pixel nhận được THEO GIỜ (tối đa 7 ngày gần nhất): số PageView, ViewContent, AddToCart, Purchase… hoặc theo thiết bị / trình duyệt / URL. Dùng để kiểm pixel còn bắn đủ sự kiện, phát hiện tụt sự kiện mua sau khi sửa web.

  • Gọi thật: platform_shop_id=act_<id> dùng được cho pixel tài khoản thấy ở adspixels; gửi pixel id thì 360 chỉ nhận khi pixel đó đã nối với brand (khác → lỗi tài sản chưa nối).
  • Pixel lâu không bắn (xem last_fired_time) → data rỗng, không phải lỗi.
  • Chỉ có dữ liệu 7 ngày gần nhất; không gửi start_time thì trả khoảng 24 giờ gần nhất.
  • Tên sự kiện tùy chỉnh của web (ví dụ showroom_view) cũng xuất hiện cạnh sự kiện chuẩn.

Request

Endpoint

GET https://partner.quantri360.com/v1/facebook/{version}/{pixel_id}/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_idquerystringact_123456789 hoặc 1234567890Tài sản Facebook brand đã nối với 360: tài khoản quảng cáo (act_<id> hoặc <id>), Page id hoặc Pixel id — lấy ở GET /v1/platforms. Có thể bỏ khi đường dẫn đã chứa act_<id> / page id của brand.

Request parameters

NameInTypeRequiredSampleDescription
versionpathstringYesv25.0
pixel_idpathstringYes880903560703328Pixel id (lấy ở GET /act_{account_id}/adspixels).
platform_shop_idquerystringNoact_5924809560908319Tài khoản quảng cáo dùng được pixel, dạng act_<id> (hoặc chính pixel id nếu pixel đã nối với 360). BẮT BUỘC khi brand nối nhiều tài sản Facebook.
aggregationquerystringNoeventGộp theo: event (mặc định, 100 sự kiện nhiều nhất) · device_type · device_os · browser_type · host · url (bỏ query string) · custom_data_field (cần event) · event_total_counts (tổng cả kỳ) · event_source · match_keys …
start_timequerystringNo1793260800Từ thời điểm (unix giây hoặc ISO 8601). Không xa hơn 7 ngày trước.
end_timequerystringNoĐến thời điểm (mặc định = lúc gọi).
eventquerystringNoPurchaseTên sự kiện — dùng với aggregation=custom_data_field.
event_sourcequerystringNoWEB_ONLYWEB_ONLY (pixel trình duyệt) | SERVER_ONLY (Conversions API).

Request examples

curl -s "https://partner.quantri360.com/v1/facebook/v25.0/880903560703328/stats?platform_shop_id=act_5924809560908319&aggregation=event&start_time=1793260800" \
  -H "Authorization: Bearer $KEY"
Python
import requests

KEY = "q360_live_..."  # khóa API của brand
r = requests.get(
    "https://partner.quantri360.com/v1/facebook/v25.0/880903560703328/stats",
    params={
        "platform_shop_id": "act_5924809560908319",
        "aggregation": "event",
        "start_time": 1793260800
    },
    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/facebook/v25.0/880903560703328/stats');
for (const [k, v] of Object.entries({"platform_shop_id":"act_5924809560908319","aggregation":"event","start_time":1793260800})) 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/facebook/v25.0/880903560703328/stats' . '?' . http_build_query(['platform_shop_id' => 'act_5924809560908319', 'aggregation' => 'event', 'start_time' => 1793260800]);
$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 Facebook)

NameTypeSampleDescription
dataobject[]Một dòng mỗi GIỜ.
start_timestring2026-10-29T08:00:00+0000Đầu giờ, UTC (`+0000`) — cộng 7 ra giờ Việt Nam.
aggregationstringeventKiểu gộp đã yêu cầu.
dataobject[]`[{value, count}]` — `value` = tên sự kiện / thiết bị / URL…, `count` = số lần.

Response sample

{
  "data": [
    {
      "start_time": "2026-10-29T12:00:00+0000",
      "aggregation": "event",
      "data": [
        {
          "value": "PageView",
          "count": 493
        },
        {
          "value": "ViewContent",
          "count": 255
        },
        {
          "value": "InitiateCheckout",
          "count": 28
        },
        {
          "value": "AddToCart",
          "count": 26
        },
        {
          "value": "Search",
          "count": 12
        },
        {
          "value": "AddPaymentInfo",
          "count": 2
        },
        {
          "value": "Purchase",
          "count": 2
        }
      ]
    },
    {
      "start_time": "2026-10-29T13:00:00+0000",
      "aggregation": "event",
      "data": [
        {
          "value": "PageView",
          "count": 709
        },
        {
          "value": "ViewContent",
          "count": 378
        },
        {
          "value": "AddToCart",
          "count": 16
        }
      ]
    }
  ]
}

Get started

  1. Sign up for Partner
  2. Enable a data type of the Quảng cáo (Marketing API) group on the platform page
  3. Create an API key (tick the Facebook channel)
  4. Call it as in the examples above