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 →

GTM with DataLayer

Use Google Tag Manager to send events via the dataLayer.

View setup guide →

Server-side API

Send events directly from your backend using HTTP requests.

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.

1

Install the Plugin

Download the PixelFly for WooCommerce plugin and upload it to your WordPress site.

Download WooCommerce Plugin

Go to WordPress Admin → Plugins → Add New → Upload Plugin

2

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)
3

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.

4

Publish & Test

Publish your GTM container and test the tracking using GTM Preview mode and PixelFly Event Debugger.

That's it! Your WooCommerce store is now tracking all e-commerce events to Meta CAPI and GA4.

Automatically Tracked Events

page_view view_item add_to_cart view_cart begin_checkout add_payment_info add_shipping_info purchase

Prerequisites: You need an sGTM container created in PixelFly dashboard with your custom domain configured.

1

Install the Plugin

Download the PixelFly for WooCommerce plugin and upload it to your WordPress site.

Download WooCommerce Plugin

Go to WordPress Admin → Plugins → Add New → Upload Plugin

2

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)
3

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.

4

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)
5

Publish & Test

Publish both your Web and Server GTM containers. Use GTM Preview mode to debug.

Done! Your WooCommerce store now sends events through your sGTM server with full GTM control.

sGTM Benefits

Full GTM Server-Side features
Google Ads Enhanced Conversions
Preview & Debug mode
Any GTM template support

GTM with DataLayer

For Laravel, PHP, or any site using Google Tag Manager

1

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'
  }
});
2

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
3

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"
}
COD / Manual Payment

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

1
At checkout, capture all tracking cookies (fbp, fbc, ga_client_id, click IDs) and store with the order
2
When order is confirmed (status changes or admin fires manually), send the stored data to PixelFly
3
PixelFly routes to Proxy Container (direct API) or sGTM Container (/g/collect)

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
eventstring"purchase"
event_idstringUnique ID for deduplication
event_timeintegerUnix timestamp (seconds)
transaction_idstringOrder ID
valuefloatOrder subtotal
currencystringISO 4217 code (BDT, USD)
itemsarrayProduct items array
user_dataobjectCustomer information

Tracking Cookies & Click IDs

Capture these at checkout time and store with the order:

Field Source Platform
fbp_fbp cookieFacebook CAPI
fbc_fbc cookie or fbclid URL paramFacebook CAPI
ga_client_id_ga cookie (last 2 parts)GA4
gclidURL param or _gcl_aw cookieGoogle Ads
fbclidURL paramFacebook
ttclidURL param or _ttp cookieTikTok
msclkidURL paramMicrosoft 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_id for 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_idevent_idFB CAPI deduplication
ED - transaction_idtransaction_idGA4, FB CAPI, Google Ads
ED - valuevalueGA4, FB CAPI, Google Ads
ED - currencycurrencyGA4, FB CAPI, Google Ads
ED - content_idscontent_idsFB CAPI (JSON array)
ED - fbpfbpFB CAPI
ED - fbcfbcFB CAPI
ED - gclidgclidGoogle Ads

Facebook CAPI Variables

Variable Name Key Path Description
ED - content_typecontent_typeAlways "product"
ED - content_namecontent_nameProduct names combined
ED - content_categorycontent_categoryFirst item category
ED - num_itemsnum_itemsTotal quantity
ED - external_idexternal_idCustomer identifier
ED - action_sourceaction_source"website"
ED - event_source_urlevent_source_urlThank you page URL
ED - ip_overrideip_overrideCustomer IP
ED - user_agentuser_agentCustomer browser
ED - fbclidfbclidFacebook Click ID

GA4 & Google Ads Variables

Variable Name Key Path Description
ED - ga_client_idga_client_idGA4 Client ID
ED - shippingshippingShipping cost
ED - taxtaxTax amount
ED - couponcouponCoupon code

Other Platform Variables

Variable Name Key Path Platform
ED - ttclidttclidTikTok Events API
ED - msclkidmsclkidMicrosoft Ads
ED - is_delayedis_delayedDebug flag

User Data Variables (Enhanced Conversions)

Variable Name Key Path Description
UP - emailuser_data.emailCustomer email
UP - phoneuser_data.phoneCustomer phone
UP - first_nameuser_data.first_nameFirst name
UP - last_nameuser_data.last_nameLast name
UP - cityuser_data.cityCity
UP - regionuser_data.regionState/region
UP - postal_codeuser_data.postal_codeZIP code
UP - countryuser_data.countryCountry code

How to Create Variables in sGTM

  1. 1. In sGTM, go to Variables → New
  2. 2. Select Variable Type: Event Data
  3. 3. Enter the Key Path from the table above
  4. 4. Name it (e.g., ED - content_ids)
  5. 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.

1

Create sGTM Container

In your PixelFly dashboard, go to Containers → Create Container and select sGTM as the container type.

2

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
3

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.

4

Add Custom Domain

Add a CNAME record for your sGTM domain:

Type Name Value
CNAME server track.pixelfly.io
5

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.

Done! Your sGTM container is now live with Cloudflare edge proxy, bot detection, and auto-scaling Cloud. Use GTM Preview mode to debug your server-side tags.

What's Included

Full GTM Server-Side features
Google Ads Enhanced Conversions
Preview & Debug mode
Bot protection at edge
Auto-scaling Cloud
First-party custom domain

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

Proxy

Web Container for Proxy mode. Sends events directly to PixelFly API - no server container needed.

Facebook Pixel GA4 Events PixelFly CAPI
Download Web Container (.json)

GTM Container - Laravel / Custom Sites

Proxy

Web Container for Proxy mode. For Laravel, PHP, or any custom website - no server container needed.

Facebook Pixel GA4 Events PixelFly CAPI
Download Web Container (.json)

sGTM Web Container Template

Client-Side

GTM Web Container configured to send events to your sGTM server. Use this on your website to forward dataLayer events to Server-Side GTM.

GA4 Config Server Container URL E-commerce Events
Download Web Container (.json)

sGTM Server Container Template

Server-Side

Pre-configured GTM Server Container with Meta CAPI, GA4, and Google Ads tags. Import into your GTM Server Container for PixelFly sGTM hosting.

Meta CAPI GA4 Google Ads
Download Server Container (.json)
sGTM Container Type

For PixelFly sGTM containers with managed Server-Side GTM hosting

Web Container for sGTM

Client-Side NEW

GTM Web Container configured to send all events to your PixelFly sGTM server. Install on your website to forward dataLayer events to Server-Side GTM.

GA4 Config Server Container URL E-commerce Events
Download Web Container (.json)

Server Container for sGTM

Server-Side NEW

GTM Server Container pre-configured with Meta CAPI, GA4, and all conversion tags. Import into your GTM Server Container linked to PixelFly sGTM hosting.

Meta CAPI GA4 Google Ads TikTok
Download Server Container (.json)

How to Import GTM Container

  1. 1 Open Google Tag Manager and select your container
  2. 2 Go to Admin (gear icon) in the top navigation
  3. 3 Click Import Container
  4. 4 Choose the downloaded JSON file and select Merge or Overwrite
  5. 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.

Need Help?

Our support team is here to help you get set up quickly.

Contact Support
Documentation Menu

We use cookies to enhance your experience, analyze site traffic, and for marketing purposes. By continuing to use our site, you consent to our use of cookies. Learn more