Introduction
ServerTrack is a direct data pipeline that helps you send conversion events from your website to marketing platforms (Facebook, TikTok, Google) without being blocked by ad-blockers or browser restrictions.
Official GitHub
Follow us for updates & SDKs
Laravel Implementation
Ready-to-use Blade & Route examples
React Implementation
A demo application built with React and Vite
Vue.JS Implementation
A demo application built with Vue.js 3 and Vite
Angular Implementation
A demo application built with Angular 17
Express.js Implementation
A demo application built with Express.js and NodeJS
Step-by-Step Setup Tutorials
Watch our video guides to set up each part of ServerTrack.
Connect Facebook CAPI
Video coming soon
Connect TikTok Events API
Video coming soon
Connect Google Analytics 4
Video coming soon
Custom Domain Setup
Video coming soon
Install Tracking Code
Video coming soon
Setup Complete — What's Next?
Video coming soon
Installation
To start tracking, simply add the following code snippet to the <head> of your website.
<!-- ServerTrack Init Code -->
<script>
(function(w, d, u, k) {
w.ServerTrack = w.ServerTrack || {};
w.serverTrackQueue = [];
w.st = function() { w.serverTrackQueue.push(arguments); };
var s = d.createElement('script');
s.async = 1;
var randomPath = Math.random().toString(36).substring(2, 15);
s.src = u + '/lib/' + randomPath + '?key=' + k;
var h = d.getElementsByTagName('script')[0];
h.parentNode.insertBefore(s, h);
})(window, document, 'some.website.com', 'AUTHENTICATION_KEYS');
</script>
Domain Configuration
Create a CNAME Record pointing to the ServerTrack CNAME.
| Type | Name | Value |
|---|---|---|
| CNAME Record | data | example.servertrack.io |
Note: This is a example cname. The actual cname records will be in our dashboard - Server configuration page
Platform Configuration
Navigate to Server-Side Connection Settings in your dashboard to input your Pixel IDs and Access Tokens.
Security Tip: Treat your Access Tokens like passwords.
ViewContent
Trigger this when a user views a specific product page.
var userData = {
em: "[email protected]",
// Add fn (First name), ph (phone) if available
};
document.addEventListener('DOMContentLoaded', () => {
st('track', 'ViewContent',
{
content_ids: ['622'],
content_type: 'product',
content_name: 'Spain Wallet',
content_category: 'Wallet',
value: 390,
currency: 'BDT',
price: 650,
discount: 260,
content_list: 'Related Products'
},
userData
);
});
AddToCart
Trigger this when a user adds an item to their shopping cart.
function addToCart() {
var userData = {
em: "[email protected]",
// Add fn (First name), ph (phone) if available
};
st('track', 'AddToCart',
{
content_ids: ['622'],
content_type: 'product',
content_name: 'Spain Wallet',
value: 390,
currency: 'BDT',
content_list: 'Shopping Cart',
num_items: 1,
price: 390,
discount: 0
},
userData
);
}
InitiateCheckout
Trigger this when a user starts the checkout process.
var userData = {
em: "[email protected]",
// Add fn (First name), ph (phone) if available
};
document.addEventListener('DOMContentLoaded', () => {
st('track', 'InitiateCheckout',
{
value: 390,
currency: 'BDT',
content_type: 'product',
num_items: 1,
content_list: 'Related Products',
content_ids: ['622'],
contents: [
{ id: '622', quantity: 1, item_price: 650 }
]
},
userData
);
});
Purchase
Trigger this upon successful payment. Populating userData is critical here.
var userData = {
em: "[email protected]",
ph: "01701301233",
fn: "Alif",
ln: "Mahmud",
ct: "Dhaka",
country: "bd"
};
document.addEventListener('DOMContentLoaded', () => {
st('track', 'Purchase', {
currency: "BDT",
value: 1260,
transaction_id: "TXN_12345",
order_id: "ORD_12345",
shipping: 60,
content_type: 'product',
content_ids: ["95"],
contents: [{ id: "95", quantity: 2, item_price: 600 }],
},
userData
);
});
Custom Events
ServerTrack allows you to send any custom event name as the second argument.
st('track', 'AnyCustomName', { key: 'value' }, userData);
Example: Shop Page (Product Loop)
If you need to send a list of products currently visible on a Shop or Category page, you can loop through your data and push it to the contents array.
<script>
var userData = {
country: "bd",
em: "[email protected]",
ph: "+8801600052966",
fn: "Onecode",
ls: "Soft",
};
document.addEventListener('DOMContentLoaded', () => {
var productContents = [];
var contentIds = [];
// Simulate Loop: Item 1
productContents.push({ id: "30", item_price: 5000, quantity: 1 });
contentIds.push("30");
// Simulate Loop: Item 2
productContents.push({ id: "31", item_price: 499, quantity: 1 });
contentIds.push("31");
st('track', 'ShopPage',
{
content_name: "Shop Page",
content_category: "Ecommerce Website",
content_type: "product",
value: 1, // Usually 0 for a view event
currency: "BDT",
contents: productContents,
content_ids: contentIds
},
userData
);
});
</script>
Debugger & Logs
Use the Live Event Debugger in your dashboard to see events in real-time.
Use the Log Table for historical data.
WordPress Plugin
For WordPress users, we offer a dedicated plugin that makes integration seamless. Simply install the plugin, enter your ServerTrack credentials, and you're ready to go.
Get the WordPress Plugin
Get the official ServerTrack WordPress plugin directly from the WordPress.org plugin directory. It automatically handles event tracking for WooCommerce, Easy Digital Downloads, and custom events.
View on WordPress.orgInstallation Steps
- Log in to your WordPress admin dashboard
- Navigate to Plugins → Add New Plugin
-
Search for
Server Trackin the search bar - Click Install Now next to the official plugin, then click Activate
-
Go to Settings → ServerTrack and enter your:
- ServerTrack Domain (e.g., data.yoursite.com)
- Authentication Key (from your Server Deck)
- Save settings and the plugin will automatically start tracking events
Note: The plugin automatically tracks WooCommerce events (ViewContent, AddToCart, InitiateCheckout, Purchase) and Easy Digital Downloads events. For custom events, you can use the plugin's helper functions in your theme or custom plugins.
Plugin Features
- Automatic WooCommerce event tracking (ViewContent, AddToCart, InitiateCheckout, Purchase)
- Easy Digital Downloads integration
- Custom event tracking support via PHP functions
- User data collection (email, phone, name) for enhanced matching
- GDPR compliant - respects user privacy settings
Support
If you encounter issues, please use the Ticket Support System from your dashboard.
Create a Ticket
- Log in to Dashboard
- Go to Support tab
- Describe issue and attach screenshots