Overview
Introduction
PixelFly is a server-side event tracking platform that helps you send conversion events from your website to marketing platforms (Facebook, Google) without being blocked by ad-blockers or browser restrictions.
Choose Your Integration Method
Installation
Choose your preferred integration method to start tracking events with PixelFly. We recommend using our WordPress plugin or GTM integration for the best experience.
WordPress / WooCommerce
Install our plugin for automatic e-commerce tracking with no code required.
View setup guide →Domain Setup
For first-party tracking (recommended), add a CNAME record pointing to our infrastructure:
| Type | Name | Value |
|---|---|---|
| CNAME | t | track.pixelfly.io |
Benefits of Custom Domain
- • Bypass ad blockers that block third-party tracking
- • Cookie Life Extension: Extend _fbp, _fbc, _ga cookies from 7 days to 2 years
- • Better attribution accuracy on Safari and Firefox
Platform Config
Configure your destination platforms in the PixelFly dashboard. We support:
Meta Conversions API
Facebook & Instagram
Enter your Pixel ID and Access Token from Meta Events Manager.
GA4 Measurement Protocol
Google Analytics 4
Enter your Measurement ID and API Secret from GA4 Admin.
TikTok Events API
TikTok Ads
Enter your Pixel Code and Access Token from TikTok Business Center.
LinkedIn Conversions API
LinkedIn Ads
Enter your Access Token and Conversion Rule ID from LinkedIn Campaign Manager.
Snapchat Conversions API
Snapchat Ads
Enter your Pixel ID and Access Token from Snapchat Ads Manager.
Integrations
WordPress / WooCommerce Plugin
Easiest setup • No coding required • Full e-commerce tracking
Select Container Type:
Proxy Mode: PixelFly routes events directly to ad platforms. No sGTM server needed.
sGTM Mode: Use your PixelFly-hosted Server-Side GTM container for full GTM control.
Install the Plugin
Download the PixelFly for WooCommerce plugin and upload it to your WordPress site.
Download WooCommerce PluginGo to WordPress Admin → Plugins → Add New → Upload Plugin
Configure Plugin Settings
Navigate to WooCommerce → PixelFly and enter your API key from your PixelFly dashboard.
- Enter your PixelFly API Key
- Enable DataLayer for GTM (recommended)
- Enable delayed events for COD orders (optional)
Import GTM Container
Download the pre-configured GTM container and import it to Google Tag Manager.
Download GTM Container (WordPress)In GTM: Admin → Import Container → Choose file
This includes pre-configured tags for all e-commerce events with proper triggers.
Publish & Test
Publish your GTM container and test the tracking using GTM Preview mode and PixelFly Event Debugger.
Automatically Tracked Events
Prerequisites: You need an sGTM container created in PixelFly dashboard with your custom domain configured.
Install the Plugin
Download the PixelFly for WooCommerce plugin and upload it to your WordPress site.
Download WooCommerce PluginGo to WordPress Admin → Plugins → Add New → Upload Plugin
Configure Plugin for sGTM
Navigate to WooCommerce → PixelFly and configure for sGTM mode.
- Enable DataLayer for GTM
- Leave API Key empty (not needed for sGTM)
- Enable delayed events for COD orders (optional)
Configure GTM Web Container
In your GTM Web Container, set the Server Container URL to your PixelFly sGTM domain.
Set Server Container URL: https://server.yourstore.com
This is your custom domain from PixelFly sGTM container settings.
Import GTM Container Templates
Download our pre-configured container templates for both Web and Server GTM.
Import each container in GTM: Admin → Import Container → Choose file
Server Container includes:
- Facebook Conversions API tag
- GA4 tag (with your Measurement ID)
- Google Ads Conversion Tracking (optional)
Publish & Test
Publish both your Web and Server GTM containers. Use GTM Preview mode to debug.
sGTM Benefits
GTM with DataLayer
For Laravel, PHP, or any site using Google Tag Manager
Setup DataLayer Events
Push e-commerce events to the dataLayer from your application code. Use GA4 standard event format.
// Example: Add to Cart event
dataLayer.push({
event: 'add_to_cart',
ecommerce: {
currency: 'BDT',
value: 1500,
items: [{
item_id: 'SKU123',
item_name: 'Product Name',
price: 1500,
quantity: 1
}]
},
user_data: {
email: 'customer@example.com',
phone: '+8801712345678'
}
});
Import PixelFly GTM Container
Download the pre-configured GTM container and import it to Google Tag Manager.
Download GTM Container (Laravel/Custom)The container includes:
- PixelFly Server-side Tag (sends to Meta CAPI + GA4)
- Pre-configured triggers for all e-commerce events
- DataLayer variables for ecommerce data extraction
Configure Your API Key
In GTM, update the PixelFly tag with your API key from the dashboard.
DataLayer Event Reference
// Page View
dataLayer.push({ event: 'page_view' });
// Purchase
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-123',
currency: 'BDT',
value: 5000,
tax: 0,
shipping: 100,
items: [{ item_id: 'SKU123', item_name: 'Product', price: 2500, quantity: 2 }]
},
user_data: {
email: 'customer@example.com',
phone: '+8801712345678'
}
});
Server-side API
Direct HTTP API • Any programming language • Full control
API Endpoint
POST https://track.pixelfly.io/e
Or use your custom domain: POST https://t.yourdomain.com/e
Required Headers
Content-Type: application/json
X-PF-Key: YOUR_API_KEY
Request Body
{
"event": "Purchase",
"event_id": "unique-event-id-123",
"value": 5000,
"currency": "BDT",
"order_id": "ORDER-123",
"content_ids": ["SKU123"],
"user_data": {
"email": "customer@example.com",
"phone": "+8801712345678"
}
}
PHP / Laravel Example
$response = Http::withHeaders([
'X-PF-Key' => env('PIXELFLY_API_KEY'),
])->post('https://track.pixelfly.io/e', [
'event' => 'Purchase',
'event_id' => Str::uuid()->toString(),
'value' => $order->total,
'currency' => 'BDT',
'order_id' => $order->id,
'user_data' => [
'email' => $order->email,
'phone' => $order->phone,
],
]);
Response
{
"success": true,
"event_id": "unique-event-id-123"
}
Delayed Purchase Events API
Fire purchase events after order confirmation for COD orders
When to use: For Cash on Delivery (COD) or manual payment orders where you want to fire the purchase event only after the order is confirmed/paid, not at checkout time.
How It Works
Complete Payload Structure
{
"event": "purchase",
"event_id": "purchase_12345_1699012345",
"event_time": 1699012345,
"action_source": "website",
"event_source_url": "https://yoursite.com/thank-you/12345",
"transaction_id": "12345",
"value": 1500.00,
"currency": "BDT",
"tax": 0,
"shipping": 60.00,
"coupon": "SAVE10",
"items": [
{
"item_id": "SKU-001",
"item_name": "Product Name",
"price": 750.00,
"quantity": 2,
"item_category": "Category",
"item_variant": "Red / Large"
}
],
"content_ids": ["SKU-001"],
"user_data": {
"em": "customer@example.com",
"ph": "01712345678",
"fn": "john",
"ln": "doe",
"ct": "dhaka",
"st": "Dhaka",
"zp": "1205",
"country": "BD",
"external_id": "01712345678",
"fbp": "fb.1.1234567890.987654321",
"fbc": "fb.1.1234567890.AbCdEfGh",
"ga_client_id": "1234567890.0987654321"
},
// Root level for easy access
"fbp": "fb.1.1234567890.987654321",
"fbc": "fb.1.1234567890.AbCdEfGh",
"ga_client_id": "1234567890.0987654321",
"gclid": "CjwKCAjw...",
"fbclid": "IwAR3abc123xyz",
"ttclid": "E.CP...",
"msclkid": "abc123",
"context": {
"ip": "103.123.45.67",
"user_agent": "Mozilla/5.0...",
"is_delayed": true,
"utm": {
"utm_source": "facebook",
"utm_medium": "cpc",
"utm_campaign": "spring_sale"
}
}
}
Required Fields
| Field | Type | Description |
|---|---|---|
| event | string | "purchase" |
| event_id | string | Unique ID for deduplication |
| event_time | integer | Unix timestamp (seconds) |
| transaction_id | string | Order ID |
| value | float | Order subtotal |
| currency | string | ISO 4217 code (BDT, USD) |
| items | array | Product items array |
| user_data | object | Customer information |
Tracking Cookies & Click IDs
Capture these at checkout time and store with the order:
| Field | Source | Platform |
|---|---|---|
| fbp | _fbp cookie | Facebook CAPI |
| fbc | _fbc cookie or fbclid URL param | Facebook CAPI |
| ga_client_id | _ga cookie (last 2 parts) | GA4 |
| gclid | URL param or _gcl_aw cookie | Google Ads |
| fbclid | URL param | |
| ttclid | URL param or _ttp cookie | TikTok |
| msclkid | URL param | Microsoft Ads |
JavaScript: Capture Tracking Data
function getTrackingData() {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
return null;
}
function getUrlParam(param) {
return new URLSearchParams(window.location.search).get(param);
}
// Facebook IDs
let fbp = getCookie('_fbp');
let fbc = getCookie('_fbc');
const fbclid = getUrlParam('fbclid');
if (!fbc && fbclid) {
fbc = 'fb.1.' + Date.now() + '.' + fbclid;
}
// GA Client ID (last 2 parts of _ga cookie)
let gaClientId = null;
const gaCookie = getCookie('_ga');
if (gaCookie) {
const parts = gaCookie.split('.');
if (parts.length >= 4) {
gaClientId = parts[2] + '.' + parts[3];
}
}
return {
fbp: fbp,
fbc: fbc,
fbclid: fbclid,
gclid: getUrlParam('gclid') || getCookie('_gcl_aw'),
ga_client_id: gaClientId,
ttclid: getUrlParam('ttclid') || getCookie('_ttp'),
msclkid: getUrlParam('msclkid'),
utm_source: getUrlParam('utm_source'),
utm_medium: getUrlParam('utm_medium'),
utm_campaign: getUrlParam('utm_campaign')
};
}
PHP: Capture Tracking Data
function getTrackingCookies($request) {
$data = [];
// Facebook Browser ID
$data['fbp'] = $request->cookie('_fbp') ?? $_COOKIE['_fbp'] ?? null;
// Facebook Click ID
$fbc = $request->cookie('_fbc') ?? $_COOKIE['_fbc'] ?? null;
if (!$fbc && $request->has('fbclid')) {
$fbc = 'fb.1.' . time() . '.' . $request->input('fbclid');
}
$data['fbc'] = $fbc;
$data['fbclid'] = $request->input('fbclid');
// GA Client ID (last 2 parts of _ga cookie)
$gaCookie = $request->cookie('_ga') ?? $_COOKIE['_ga'] ?? null;
if ($gaCookie) {
$parts = explode('.', $gaCookie);
if (count($parts) >= 4) {
$data['ga_client_id'] = $parts[2] . '.' . $parts[3];
}
}
// Click IDs
$data['gclid'] = $request->input('gclid');
$data['ttclid'] = $request->input('ttclid') ?? $request->cookie('_ttp');
$data['msclkid'] = $request->input('msclkid');
return array_filter($data);
}
Best Practices
- - Always include
event_idfor deduplication - - Fire delayed events within 7 days for best matching rates
- - Include IP and user_agent from original checkout
- - Format:
event_id = "purchase_{order_id}_{timestamp}"
sGTM Variables Setup
Event Data variables to read delayed purchase events in sGTM
For sGTM Container: Create these Event Data variables to read delayed purchase event parameters. Variable Type: Event Data
Essential Variables (Must Create)
| Variable Name | Key Path | Used For |
|---|---|---|
| ED - event_id | event_id | FB CAPI deduplication |
| ED - transaction_id | transaction_id | GA4, FB CAPI, Google Ads |
| ED - value | value | GA4, FB CAPI, Google Ads |
| ED - currency | currency | GA4, FB CAPI, Google Ads |
| ED - content_ids | content_ids | FB CAPI (JSON array) |
| ED - fbp | fbp | FB CAPI |
| ED - fbc | fbc | FB CAPI |
| ED - gclid | gclid | Google Ads |
Facebook CAPI Variables
| Variable Name | Key Path | Description |
|---|---|---|
| ED - content_type | content_type | Always "product" |
| ED - content_name | content_name | Product names combined |
| ED - content_category | content_category | First item category |
| ED - num_items | num_items | Total quantity |
| ED - external_id | external_id | Customer identifier |
| ED - action_source | action_source | "website" |
| ED - event_source_url | event_source_url | Thank you page URL |
| ED - ip_override | ip_override | Customer IP |
| ED - user_agent | user_agent | Customer browser |
| ED - fbclid | fbclid | Facebook Click ID |
GA4 & Google Ads Variables
| Variable Name | Key Path | Description |
|---|---|---|
| ED - ga_client_id | ga_client_id | GA4 Client ID |
| ED - shipping | shipping | Shipping cost |
| ED - tax | tax | Tax amount |
| ED - coupon | coupon | Coupon code |
Other Platform Variables
| Variable Name | Key Path | Platform |
|---|---|---|
| ED - ttclid | ttclid | TikTok Events API |
| ED - msclkid | msclkid | Microsoft Ads |
| ED - is_delayed | is_delayed | Debug flag |
User Data Variables (Enhanced Conversions)
| Variable Name | Key Path | Description |
|---|---|---|
| UP - email | user_data.email | Customer email |
| UP - phone | user_data.phone | Customer phone |
| UP - first_name | user_data.first_name | First name |
| UP - last_name | user_data.last_name | Last name |
| UP - city | user_data.city | City |
| UP - region | user_data.region | State/region |
| UP - postal_code | user_data.postal_code | ZIP code |
| UP - country | user_data.country | Country code |
How to Create Variables in sGTM
- 1. In sGTM, go to Variables → New
- 2. Select Variable Type: Event Data
- 3. Enter the Key Path from the table above
- 4. Name it (e.g., ED - content_ids)
- 5. Save
Full Control
sGTM Hosting
Managed Server-Side Google Tag Manager on PixelFly Cloud
What is sGTM Hosting? PixelFly provisions and manages a full Google Tag Manager Server Container on PixelFly Cloud. You get all GTM server-side features (Google Ads Enhanced Conversions, any GTM template, preview/debug mode) without needing to manage GCP infrastructure.
Create sGTM Container
In your PixelFly dashboard, go to Containers → Create Container and select sGTM as the container type.
Enter GTM Container Config
Paste your GTM Server Container Config string. You can find this in Google Tag Manager under Admin → Container Settings of your server container.
Requirements:
- A GTM Server Container (created in tagmanager.google.com)
- The Container Config string from GTM server container settings
Wait for Provisioning
PixelFly automatically provisions two PixelFly Cloud services: a tagging server and a preview server. The status will update in your dashboard once ready.
Add Custom Domain
Add a CNAME record for your sGTM domain:
| Type | Name | Value |
|---|---|---|
| CNAME | server | track.pixelfly.io |
Configure GTM Web Container
In your GTM Web Container, set the Server Container URL to your custom domain (e.g., https://server.yourstore.com). All server-side tags will now route through PixelFly's infrastructure.
What's Included
Downloads
Get our pre-configured templates to quickly set up your sGTM container.
The WooCommerce plugin pushes dataLayer events that work with any sGTM setup.
Downloads
Plugins & GTM Templates
Download our official plugins and pre-configured GTM container templates to quickly set up PixelFly on your website.
PixelFly for WooCommerce
WordPress plugin for automatic e-commerce tracking. Pushes all WooCommerce events to the dataLayer for GTM integration.
Download Plugin (.zip)GTM Container - WordPress / WooCommerce
ProxyWeb Container for Proxy mode. Sends events directly to PixelFly API - no server container needed.
GTM Container - Laravel / Custom Sites
ProxyWeb Container for Proxy mode. For Laravel, PHP, or any custom website - no server container needed.
sGTM Web Container Template
Client-SideGTM Web Container configured to send events to your sGTM server. Use this on your website to forward dataLayer events to Server-Side GTM.
sGTM Server Container Template
Server-SidePre-configured GTM Server Container with Meta CAPI, GA4, and Google Ads tags. Import into your GTM Server Container for PixelFly sGTM hosting.
For PixelFly sGTM containers with managed Server-Side GTM hosting
Web Container for sGTM
Client-Side NEWGTM Web Container configured to send all events to your PixelFly sGTM server. Install on your website to forward dataLayer events to Server-Side GTM.
Server Container for sGTM
Server-Side NEWGTM Server Container pre-configured with Meta CAPI, GA4, and all conversion tags. Import into your GTM Server Container linked to PixelFly sGTM hosting.
How to Import GTM Container
- 1 Open Google Tag Manager and select your container
-
2
Go to
Admin(gear icon) in the top navigation -
3
Click
Import Container - 4 Choose the downloaded JSON file and select Merge or Overwrite
- 5 Update the PixelFly tag with your API key and publish the container
Tools & Support
Debugging
Use these tools to verify your integration is working correctly.
GTM Preview Mode
In Google Tag Manager, click "Preview" to see real-time events firing on your site.
Meta Events Manager
Check "Test Events" in Meta Events Manager to see server-side events arriving.
PixelFly Event Logs
View real-time event logs in your PixelFly dashboard to see all tracked events.