Skip to main content

Server-Side Tracking & CAPI

Server-side tracking (also known as Conversions API or CAPI) sends conversion events directly from your server to ad platforms, bypassing browser limitations introduced by iOS 14+, ad blockers, and cookie deprecation. OmniSocial's tracking system gives you a single pixel that fans out events to every destination you configure.


Why Server-Side Tracking Matters​

Browser-based pixels are increasingly unreliable:

ChallengeImpactServer-Side Solution
iOS 14+ ATTUp to 40% of users opt out of trackingEvents fire from your server, not the browser
Ad blockers30%+ of desktop users block scriptsServer requests are not interceptable by browser extensions
Cookie deprecationThird-party cookies phased outFirst-party data hashed and sent directly to platforms
ITP / ETPSafari and Firefox limit cookie lifetimeServer-side events are not affected by browser storage policies
tip

Combining browser pixels with server-side CAPI gives you deduplicated, high-fidelity conversion data. Ad platforms merge the two signals when both carry the same event ID. The UniPulse SDK gives every event an ID and returns it from omni('track', ...). If you also fire the Meta Pixel yourself, pass that ID as its eventID. For purchases, the ID is purchase: followed by your store's order ID on both the website and the server, so a Purchase reported by both is counted once.


How It Works: Setup Flow​

Getting started takes four steps:

  1. Create a Tracking Pixel -- Go to Analytics > Tracking and click New Pixel. Each pixel gets a unique pixelId and API key.
  2. Link Destinations -- Add one or more platforms (Meta, Google, TikTok, GA4, or a custom webhook) and provide the required credentials.
  3. Install the SDK -- Add the OmniSocial tracking snippet to your website or install the npm package.
  4. Verify Events -- Use the Real-Time Event Stream to confirm events are flowing.

Tracking Pixels​

A tracking pixel is a container that groups destinations and events together under a single API key.

Creating a Pixel​

Navigate to Analytics > Tracking > New Pixel and provide:

FieldDescription
NameA descriptive label (e.g., "Main Website")
DomainThe domain where the pixel will be installed

After creation you will receive a pixelId and an API key. The API key authenticates all incoming events.

Managing Pixels​

  • Regenerate API Key -- If your key is compromised, regenerate it from the pixel settings. The old key is immediately invalidated.
  • Delete Pixel -- Removes the pixel, all linked destinations, and historical event data.
warning

Regenerating an API key requires updating the key in your SDK installation. Events sent with the old key will be rejected.


Destinations​

Each pixel can fan out events to multiple destinations simultaneously.

Supported Destinations​

DestinationRequired CredentialsEvents Supported
Meta CAPIPixel ID, Access TokenPurchase, AddToCart, InitiateCheckout, ViewContent, Lead, PageView
Google AdsCustomer ID, Conversion Action ID, Developer Tokenpurchase, add_to_cart, begin_checkout, page_view
TikTok Events APIPixel Code, Access TokenCompletePayment, AddToCart, InitiateCheckout, ViewContent
GA4 (Measurement Protocol)Measurement ID, API SecretAll standard GA4 events
Custom WebhookEndpoint URL, optional secret headerAll events forwarded as JSON

Adding a Destination​

  1. Open your pixel and click Add Destination.
  2. Select the platform type.
  3. Enter the required credentials.
  4. Enable or disable specific event types to forward.
  5. Click Save & Test to send a test event.
Event Name Mapping

OmniSocial automatically maps your event names to each platform's expected format. For example, a purchase event becomes Purchase for Meta, purchase for GA4, and CompletePayment for TikTok.


Customer Scoring​

The tracking system automatically builds customer profiles and assigns quality scores based on behavior.

How Scores Work​

Every tracked customer accumulates a score from 0 to 100 based on weighted signals:

SignalWeightDescription
Purchase count30%Number of completed purchases
Total revenue25%Lifetime spend
Visit frequency20%Number of sessions in the scoring window
Recency15%Days since last activity (lower is better)
Cart behavior10%Add-to-cart to purchase conversion rate

Segment Definitions​

Customers are automatically placed into segments based on their score and behavior:

SegmentCriteriaTypical Use
high_valueScore > 80Lookalike audiences, VIP campaigns
repeatScore 60--80, 2+ purchasesUpsell and cross-sell campaigns
promisingScore 40--60, recent activityNurture sequences
at_riskScore 20--40, declining activityWin-back campaigns
newFirst seen < 30 days agoWelcome sequences
churnedNo activity in 90+ daysRe-engagement campaigns

Using Segments for Ad Optimization​

Segments are sent alongside conversion events to ad platforms as custom parameters. This allows you to:

  • Build lookalike audiences from your high_value segment in Meta Ads Manager.
  • Set value-based bidding in Google Ads using score-weighted conversion values.
  • Exclude churned customers from prospecting campaigns to reduce wasted spend.

Attribution​

The tracking system captures attribution data to connect conversions back to their traffic source.

UTM Parameters​

The SDK automatically captures UTM parameters from the landing URL:

ParameterExample
utm_sourcefacebook
utm_mediumcpc
utm_campaignsummer_sale_2026
utm_termrunning+shoes
utm_contentvideo_ad_v2

Post Attribution​

When a user arrives via a link from one of your social posts, the system matches the click to the originating publication to attribute the conversion to specific content.

Ad Attribution​

For paid traffic, the SDK captures platform-specific click identifiers (fbclid, gclid, ttclid) and includes them in server-side events for accurate ad-level attribution.

Conversion Funnel​

The attribution engine tracks the full funnel:

PageView --> ViewContent --> AddToCart --> InitiateCheckout --> Purchase

Each step is timestamped and attributed, giving you a clear view of where users drop off.


Real-Time Event Stream​

The Event Stream tab shows events as they arrive, in real time. Use it to:

  • Verify SDK installation -- Confirm that page views and custom events appear within seconds of triggering them.
  • Debug destination delivery -- See which destinations received each event and whether they returned a success or error response.
  • Monitor throughput -- Watch event volume during campaign launches or sales events.
tip

Open the Event Stream in a second browser tab while browsing your site to verify tracking end-to-end.


E-Commerce Bridge​

If you have connected a store (Shopify, WooCommerce, or EasyOrders), the tracking system automatically generates events from order data:

Store EventTracking EventData Included
Order createdpurchaseOrder ID, total, currency, items
Cart updatedadd_to_cartProduct ID, name, price, quantity
Checkout startedinitiate_checkoutCart total, item count

This means you get server-side conversion tracking even if the customer never visits a page with your SDK installed -- the commerce bridge handles it.

Each order is counted once
  • Prepaid orders are reported as a Purchase when the order is placed.
  • Cash-on-delivery orders are reported as a Purchase only when the order is delivered, so orders refused at the door never inflate your ad results. Deliveries are picked up automatically when your store syncs, or as soon as you mark an order as delivered.
  • Open carts, cancelled and refunded orders are never reported as purchases.

SDK Installation​

Option 1: Script Tag​

Add this snippet before the closing </body> tag on every page:

Copy the exact snippet from Settings > Tracking > SDK. It already contains your pixel ID and the correct endpoint:

<script src="https://cdn.unipulse.tech/sdk/v1/unipulse-tracking.umd.js"></script>
<script>
omni('init', {
pixelId: 'YOUR_PIXEL_ID',
apiKey: 'YOUR_API_KEY',
endpoint: 'https://api.unipulse.tech/api/v1/tracking/ingest',
autoPageView: true,
consent: 'optional'
});
</script>

Option 2: npm Package​

npm install @omnisocial/tracking
import { omni } from '@omnisocial/tracking';

omni('init', 'YOUR_PIXEL_ID', { apiKey: 'YOUR_API_KEY' });
omni('track', 'PageView');

Common Commands​

CommandDescriptionExample
omni('init', options)Initialize the SDKomni('init', { pixelId: 'tp_…', apiKey: '…' })
omni('track', event, data)Track an event. Send the order's real currency and order_id for purchases.omni('track', 'Purchase', { value: 1500, currency: 'EGP', order_id: '1001' })
omni('identify', traits)Identify a customeromni('identify', { email: 'user@example.com' })
omni('consent', granted)Set GDPR consentomni('consent', true)

GDPR Compliance​

How consent reaches the server

When Block events before consent is on, UniPulse drops a visitor's events until that visitor grants consent. Calling omni('consent', 'grant') both stores consent in the browser and records it with UniPulse, so events start flowing immediately. omni('consent', 'revoke') records the withdrawal the same way.

The tracking system includes built-in GDPR tooling:

  • Consent Mode -- The SDK only fires events after omni('consent', true) is called. Before consent, the SDK queues events but does not transmit them.
  • Data Export -- Request a full export of a customer's tracked data via Settings > Privacy > Data Export.
  • Data Erasure -- Request deletion of a customer's data. This removes all events, profile data, and scores, and sends deletion requests to connected platforms that support it (Meta, Google).
info

Data export and erasure requests are processed within 72 hours. You will receive a confirmation email when complete.