Create an account.
Sign up from the public app and choose your store type. The account creates a merchant workspace, an API key store, and a default onboarding checklist.
Open signupGet merchant_id.
Open settings and copy the `merchant_id` from the developer panel. Use the same value in the pixel snippet and every server event.
MERCHANT_ID=mer_01j9z4w7n2t8qx6k3ad5b9c0efInstall the pixel.
Add this before </head> on every storefront page. The collector stores first-party browser context, restores click IDs, and lets browser-side pixels share the same event_id as server events.
<script
src="https://cdn.tracklayer.io/t.js"
data-merchant-id="MERCHANT_ID"
async>
</script>Send your first event.
curl https://api.tracklayer.io/v1/events \
-H "Authorization: Bearer tl_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_id": "ord_100045_purchase",
"event_name": "purchase",
"event_time": 1777039200,
"merchant_id": "MERCHANT_ID",
"source": "sdk",
"source_url": "https://store.example/thank-you",
"order_id": "100045",
"currency": "USD",
"value": 129.00,
"user_data": {
"email": "buyer@example.com",
"phone": "+15551234567",
"browser_ids": {
"fbp": "fb.1.1777039000.123456789",
"ga_client_id": "1871825471.1777039000"
}
},
"items": [
{ "id": "sku_hoodie", "name": "Heavyweight Hoodie", "price": 129.00, "quantity": 1 }
]
}'await fetch("https://api.tracklayer.io/v1/events", {
method: "POST",
headers: {
Authorization: "Bearer tl_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"event_id": "ord_100045_purchase",
"event_name": "purchase",
"event_time": 1777039200,
"merchant_id": "MERCHANT_ID",
"source": "sdk",
"source_url": "https://store.example/thank-you",
"order_id": "100045",
"currency": "USD",
"value": 129.00,
"user_data": {
"email": "buyer@example.com",
"phone": "+15551234567",
"browser_ids": {
"fbp": "fb.1.1777039000.123456789",
"ga_client_id": "1871825471.1777039000"
}
},
"items": [
{ "id": "sku_hoodie", "name": "Heavyweight Hoodie", "price": 129.00, "quantity": 1 }
]
}),
});import requests
payload = {
"event_id": "ord_100045_purchase",
"event_name": "purchase",
"event_time": 1777039200,
"merchant_id": "MERCHANT_ID",
"source": "sdk",
"source_url": "https://store.example/thank-you",
"order_id": "100045",
"currency": "USD",
"value": 129.00,
"user_data": {
"email": "buyer@example.com",
"phone": "+15551234567",
"browser_ids": {
"fbp": "fb.1.1777039000.123456789",
"ga_client_id": "1871825471.1777039000"
}
},
"items": [
{ "id": "sku_hoodie", "name": "Heavyweight Hoodie", "price": 129.00, "quantity": 1 }
]
}
requests.post(
"https://api.tracklayer.io/v1/events",
headers={
"Authorization": "Bearer tl_live_YOUR_API_KEY",
"Content-Type": "application/json",
},
json=payload,
)<?php
$payload = {
"event_id": "ord_100045_purchase",
"event_name": "purchase",
"event_time": 1777039200,
"merchant_id": "MERCHANT_ID",
"source": "sdk",
"source_url": "https://store.example/thank-you",
"order_id": "100045",
"currency": "USD",
"value": 129.00,
"user_data": {
"email": "buyer@example.com",
"phone": "+15551234567",
"browser_ids": {
"fbp": "fb.1.1777039000.123456789",
"ga_client_id": "1871825471.1777039000"
}
},
"items": [
{ "id": "sku_hoodie", "name": "Heavyweight Hoodie", "price": 129.00, "quantity": 1 }
]
};
$ch = curl_init("https://api.tracklayer.io/v1/events");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer tl_live_YOUR_API_KEY",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);Verify delivery.
Open /events and search `ord_100045_purchase`. The row should show source `sdk`, value, order_id, and delivery status.
If the browser pixel also fired, the same event_id keeps browser and server copies tied together.
Open the connected destination. Meta, GA4, TikTok, and other adapters receive platform-native payloads.