Server-side events and first-party matching

You will be able to explain what server-side events do and why platforms ask for them.

Farah runs an online shop that uses a Meta pixel. One Monday she checks her numbers for the past week and finds 40 orders in her shop against 31 purchases in Events Manager, the Meta report that lists the events received from her site. She cannot explain the gap (the figures are examples).

The difference is 40 - 31 = 9 orders that happened but that Meta never heard about. Her pixel was installed and working, but it could not see every visitor. A gap like this between the orders a shop records and the purchases an ad platform reports is normal, and it can appear even when the pixel is set up correctly.

Why a pixel misses some purchases

A pixel is code that runs in the visitor's web browser. When a purchase is completed, code on the page sends a message from the browser to the ad platform, and that message gets through only if the browser allows it. Several things can stop it:

Some browsers limit tracking by default. Ad blockers and privacy extensions stop many tracking messages entirely. On iPhones, apps must ask permission before tracking people across other companies' apps and websites. Many people say no, which limits what an app like Instagram can link up. When a visitor declines a cookie banner, tracking code such as the pixel may not run. Someone who clicks an ad on their phone and buys later on a laptop is hard to connect from the browser alone.

Each cause removes a few events. Together they can leave a platform seeing noticeably fewer conversions (the purchases, sign-ups and other results you track) than really happened. This affects your reports, and it matters more for the auction. As Lesson 3.1, "What a pixel does and why the auction needs it", explains, the platform learns from the conversions it can see, so fewer visible conversions give it less to learn from.

Sending events from your server

The platforms' answer is to have you send events a second way, from your own systems instead of the visitor's browser. Your website or shop platform already knows when an order is completed, because it has to record the order on its server, the computer that runs the site and stores its records. A server-side connection sends that same event to the ad platform directly from your website's server, or from the platform that hosts your shop. Events sent this way are called server-side events. Browser settings and ad blockers do not block them, because the visitor's browser has no part in the message.

Meta's version is called the Conversions API and TikTok's is called the Events API. API is short for application programming interface, a set of rules that lets one computer system send data to another. Both accept events such as purchases and completed enquiry forms from your server, along with details that help match each event to a person on their platform.

Google works a little differently. It improves conversion measurement when you send hashed first-party customer details with the conversion, meaning details a customer typed into your own checkout or form, such as an email address or phone number. Google renames products often, so look up the feature's current name in Google Ads help.

Hashing turns these details into a scrambled code, using a standard method, before they are sent. The platform can match the code against its own signed-in users without ever receiving the plain email address. Meta and TikTok use hashed customer details in the same way when you send server events. When matching improves, more conversions are credited to the right ad.

Using an event ID so one sale counts once

Most advertisers send each important event both ways, from the browser through the pixel and from the server through the API. This gives the best coverage, since each route catches events the other misses. If the platform treats the two messages as separate, though, one sale is counted as two.

Deduplication prevents that. You give the browser event and the server event the same identifier, often called an event ID, and the same event name. When the platform receives two events with matching details, it keeps only one. Meta and TikTok both describe the setup in their help pages, and most built-in integrations handle it for you. If you build a custom connection, test deduplication carefully. Double-counted conversions make a campaign look twice as good as it really is, and the platform then learns from false data.

What Shopify, WordPress and similar platforms offer

For most of this you do not need to write server code. Many shop builders and website platforms offer ready-made connections to Meta's Conversions API, TikTok's Events API and Google's first-party matching, usually as an app, plugin or setting. Shopify and WordPress both connect these through apps or plugins, and the names and features of those apps and plugins change over time.

Farah's shop platform has a Meta app with a data sharing setting, which she turned on. She then checked in Events Manager that purchases were arriving from both the browser and the server and that deduplication was working. Her gap narrowed enough to give the platform more to learn from, although it did not close completely, and no setup will close it completely.

Priya's site runs on WordPress and has a simple booking form. She uses a plugin that connects the form to Meta's Conversions API, and she also uses the Google option for sending hashed form details with each booking.

To set this up on your own site, start by finding out what your website or shop platform offers for Meta's Conversions API, TikTok's Events API and Google's first-party matching. Turn on the relevant connection or data sharing setting. Send important events both ways, through the pixel and through the API, and make sure the browser event and the server event share the same event ID and event name; built-in integrations usually do this for you. Then check in the platform, for example Meta's Events Manager, that events arrive from both the browser and the server and that deduplication is working. If you built a custom connection, test deduplication carefully.

Server-side connections send customer details, so they come with privacy duties. Lesson 3.3, "Consent, privacy and the PDPA", covers these next.

First, find out what your own platform already offers. In the activity below you will check your website platform's integrations for these server-side options.

Write three sentences explaining what server-side events do, why platforms ask for them and whether your website platform, such as Shopify or WordPress, has a built-in integration for Meta's Conversions API or Google's first-party matching.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).