Documentation
Everything you need to go from zero to accurate server-side tracking โ no matter which platform your store runs on.
Introduction
TrackRight is a server-side event tracking platform. Your website sends conversion events to your TrackRight container, and we deliver them to your marketing platforms (Meta, Google, TikTok, LinkedIn, Snapchat) over server-to-server connections that ad blockers and browser privacy restrictions cannot interfere with. Personal data is SHA-256 hashed, bots are filtered, and duplicates are removed automatically.
๐
WordPress / WooCommerce
Install our plugin โ events flow automatically.
View setup guide โ
๐ท๏ธ
GTM with DataLayer
For Laravel, PHP and custom-built sites using Google Tag Manager.
View setup guide โ
๐ฅ๏ธ
Server-side API
Direct HTTP integration from any backend or app.
View setup guide โ
โ๏ธ
sGTM Hosting
Run Google's official server-side GTM, managed by us.
View setup guide โ
Installation
Pick the integration that matches your stack โ every option feeds the same container and receivers.
-
1
Create a container
App โ Tracking โ Containers โ New container. Choose Proxy (Event Forwarding) unless you specifically need a full GTM server โ you get an endpoint like /t/tr_abc123.
-
2
Add receivers
App โ Tracking โ Receivers โ New receiver. One receiver per destination platform, each with its own credentials (see Platform Config below).
-
3
Connect your website
WordPress plugin, GTM DataLayer template, or direct API calls โ guides for each are in the Integrations section.
-
4
Verify events arrive
Watch App โ Event Logs in real time, and use the free Event Tracking Tester before going live.
Domain Setup
Point a subdomain of your own website at TrackRight so tracking requests are first-party. Add this record at your DNS provider (e.g. Cloudflare):
| Type | Name | Value |
|---|---|---|
| CNAME | t | track.trackright.example |
- โ Survives ad blockers better โ requests go to
t.yourstore.com, not a known tracking domain. - โ First-party cookies โ attribution cookies can live up to 2 years instead of 7 days.
- โ Your brand everywhere โ no third-party domains in your page requests.
Custom domains are activated per account after deployment โ contact support to enable yours.
Platform Config
Each receiver needs credentials from its platform. Here's exactly where to find them:
Meta Conversions API +
You need: Pixel ID + Access Token
Where: Events Manager โ your pixel โ Settings โ Conversions API โ "Generate access token". Add a Test Event Code while testing.
GA4 Measurement Protocol +
You need: Measurement ID + API Secret
Where: GA4 Admin โ Data Streams โ your stream: the Measurement ID (G-XXXX) is at the top; create the secret under "Measurement Protocol API secrets".
TikTok Events API +
You need: Pixel Code + Access Token
Where: TikTok Ads Manager โ Assets โ Events โ Web Events โ your pixel โ Settings โ "Generate Access Token".
LinkedIn Conversions API +
You need: Conversion Rule ID + Access Token
Where: Campaign Manager โ Analyze โ Conversion tracking. Requires a LinkedIn developer app with the Conversions API product enabled.
Snapchat Conversions API +
You need: Pixel ID + Access Token
Where: Snapchat Ads Manager โ Events Manager โ your pixel โ Settings โ "Generate Token".
WordPress / WooCommerce Plugin
The plugin tracks the full WooCommerce funnel automatically:
PageView
AddToCart
InitiateCheckout
Purchase
โ with billing email and phone attached for match quality (hashed on arrival) and click IDs
stored in 30-day cookies so delayed purchases keep their attribution.
-
1
Install the plugin
Download below, then WordPress admin โ Plugins โ Add New โ Upload Plugin โ Activate.
-
2
Configure settings
Settings โ TrackRight โ paste your container endpoint URL (from Containers โ Install code).
-
3
Choose purchase timing
COD store? Keep "Delay Purchase until order completed" ON (default) โ Purchase fires when you mark the order Completed, so cancellations never pollute your ads data. Card-only store? Turn it off to fire at checkout.
-
4
Publish & test
Place a test order, then watch it arrive in App โ Event Logs with per-platform delivery status.
GTM with DataLayer
For Laravel, PHP, or any custom site already using Google Tag Manager: push standard GA4 e-commerce events to the dataLayer and forward them to your container with a Custom HTML tag.
1 โ Push events to the dataLayer
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'T-1001',
value: 2450,
currency: 'BDT',
items: [{ item_id: 'SKU-1', item_name: 'Blue T-Shirt', price: 1200, quantity: 2 }]
},
user_data: { email: 'customer@example.com', phone: '+8801712345678' }
});
Tip: generate any event's snippet with the free DataLayer Generator.
2 โ Forward to TrackRight from GTM
Add a Custom HTML tag that fires on your e-commerce events:
<script>
var dl = {{Data Layer - ecommerce}} || {};
fetch('https://your-domain.com/t/YOUR_CONTAINER_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
event_name: {{Event}} === 'purchase' ? 'Purchase' : {{Event}},
event_id: dl.transaction_id || String(Date.now()),
source_url: location.href,
revenue: dl.value, currency: dl.currency,
custom_data: { items: dl.items }
})
});
</script>
A ready-to-import GTM container template is coming to the Downloads section.
3 โ Publish and verify in Event Logs
Server-side API
Send events directly from any backend โ the most reliable integration of all.
Endpoint
POST https://your-domain.com/t/{container-key}
Headers
| Content-Type | application/json |
Request body
{
"event_name": "Purchase",
"event_id": "order-1001",
"event_time": 1767139200,
"source_url": "https://shop.com/checkout?fbclid=ABC",
"revenue": 49.99,
"currency": "USD",
"user_data": {
"email": "customer@example.com",
"phone": "+8801712345678",
"first_name": "Rahim",
"city": "Dhaka",
"country": "BD"
},
"click_ids": { "fbclid": "ABC" },
"custom_data": { "items": [] }
}
PHP / Laravel example
Http::post('https://your-domain.com/t/'.$containerKey, [
'event_name' => 'Purchase',
'event_id' => 'order-'.$order->id,
'revenue' => $order->total,
'currency' => $order->currency,
'user_data' => ['email' => $order->email, 'phone' => $order->phone],
'click_ids' => ['fbclid' => $order->fbclid],
]);
Response
{ "success": true, "event_id": "order-1001", "receivers": 2, "bot_filtered": false }
200 โ accepted (duplicate: true if event_id seen before)
422 โ event_name missing
429 โ monthly quota exceeded
404 โ unknown or paused container
Delayed Purchase API COD
For cash-on-delivery and manual-payment stores: don't send Purchase at checkout โ send it when the money is real. Attribution still works because click IDs were captured on the first visit.
1. Capture at checkout
Store the visitor's click IDs and contact details with the order. Fire InitiateCheckout now.
2. Confirm the order
Verify by phone, ship it, collect payment โ your normal workflow.
3. Send Purchase
When payment is confirmed, POST the Purchase with the same order ID and the stored click IDs.
Capturing click IDs on the first visit (JavaScript)
function getParam(name) { return new URLSearchParams(location.search).get(name); }
['fbclid', 'gclid', 'ttclid'].forEach(function (key) {
var v = getParam(key);
if (v) document.cookie = 'trk_' + key + '=' + v + ';max-age=2592000;path=/';
});
// Save these cookie values with the order at checkout.
Sending the delayed Purchase (server-side)
POST /t/{container-key}
{
"event_name": "Purchase",
"event_id": "order-1001", // same ID = safe to retry, never double-counted
"event_time": 1767139200, // when payment was confirmed
"revenue": 2450, "currency": "BDT",
"user_data": { "email": "...", "phone": "..." },
"click_ids": { "fbclid": "stored-value", "gclid": "stored-value" }
}
Best practices
- Always reuse the order ID as
event_idโ retries become harmless. - Send
event_timeas the confirmation time, within 7 days of the click for Meta attribution. - Include email and phone โ phone matching is strong in Bangladesh where shared emails are common.
- WooCommerce users get all of this automatically from our plugin's delayed-purchase mode.
sGTM Variables Setup
Running an sGTM container? Create these Event Data variables so your server tags can read incoming event fields. In your server container: Variables โ New โ Event Data โ enter the key path โ name it โ save.
Essential variables
| Key path | Purpose |
|---|---|
| event_id | Deduplication ID |
| transaction_id | Order reference |
| value | Order value |
| currency | Currency code |
| page_location | Page URL |
Meta CAPI variables
| Key path | Purpose |
|---|---|
| user_data.em | Hashed email |
| user_data.ph | Hashed phone |
| user_data.fbc | Click cookie |
| user_data.fbp | Browser cookie |
GA4 & Google Ads variables
| Key path | Purpose |
|---|---|
| client_id | GA client ID |
| shipping | Shipping cost |
| tax | Tax amount |
| items | Product array |
Other platforms variables
| Key path | Purpose |
|---|---|
| click_ids.ttclid | TikTok click ID |
| click_ids.gclid | Google click ID |
| click_ids.li_fat_id | LinkedIn click ID |
sGTM Hosting
We run Google's official Server-Side Tag Manager for you โ no cloud accounts, servers, or updates to manage. Full GTM server features including Google Ads Enhanced Conversions and Preview/Debug mode.
-
1
Create an sGTM container
App โ Containers โ New container โ type "sGTM (Server-Side GTM)".
-
2
Paste your Container Config
From tagmanager.google.com: Admin โ Container Settings โ "Manually provision tagging server" โ copy the config string.
-
3
Pick a server location
Bangladesh BDIX on all plans; USA and UK on premium plans.
-
4
Wait for provisioning
Your tagging server spins up automatically โ status turns Active on the Containers page.
-
5
Point your web container
In your GTM web container, set the server_container_url to your TrackRight endpoint and publish.
Downloads โ Plugins & Templates
TrackRight for WooCommerce
WordPress plugin โ automatic funnel events, delayed COD purchase, click-ID capture. v1.0.0
โฌ Download .zip
GTM Web Container โ WooCommerce
Proxy-mode web container preconfigured with e-commerce triggers.
Coming soon
GTM Web Container โ Custom Sites
Proxy-mode container for Laravel / custom builds.
Coming soon
sGTM Server Container Template
Server container with Meta CAPI, GA4 and Google Ads tags prewired.
Coming soon
How to import a GTM container
- Open tagmanager.google.com and select your container.
- Admin โ Import Container.
- Choose the downloaded .json file.
- Pick a workspace and choose Merge (keeps your existing tags).
- Review the changes, confirm, then Preview and Publish.
Debugging
๐
TrackRight Event Logs
App โ Event Logs shows every event live with per-receiver delivery status, response codes and errors.
๐งช
Meta Events Manager
Use Test Events with a test code on your Meta receiver to watch server events arrive and check match quality.
๐
GTM Preview Mode
For sGTM setups: preview the server container to inspect incoming requests and tag firing.
Stuck? We'll set it up with you.
Email support on every plan โ live chat and screen-share calls on paid plans, with free migration from other platforms.
Contact Support