← All resources Guide

Meta Conversions API through your server container

Meta counts best when it hears about a conversion twice: once from the pixel in the browser, once from the Conversions API on your server, both with the same event ID. The browser copy carries the _fbp and _fbc cookies and the page context; the server copy survives ad blockers and Safari and carries hashed customer data. This guide sets up both from your Measurebase server container.

What you need

Step 1 · Add it to your measurement setup

Open the domain in your dashboard, go to its Settings page and find Measurement setup. Tick the destination card and fill in the IDs below. Tokens and API keys are stored encrypted, outside the setup itself. The setup sends nothing on its own: it is the reference the tracking audit and the template builder work from, so what you fill in here is what the audit expects to find in your containers.

Step 2 · Generate and import the containers

Go to Resources → GTM templates in the dashboard. Under Destinations, tick the platform (Google Analytics 4 and the e-commerce events are on by default; pick the Shopify, WordPress or Shopware data layer if your site runs one of our plugins). Fill in the same IDs on the next step, choose Web + server under Containers and download the two JSON files.

In Google Tag Manager, open each container, go to Admin → Import Container, choose the matching file, pick a new workspace and Merge. The import only adds: new tags, triggers and variables with their own names, plus the gallery templates they need. Check the result in Preview, then publish.

Step 3 · What the import contains

Web container: the Facebook Pixel template from the gallery with the tags FB - PageView, FB - ViewContent, FB - AddToCart, FB - InitiateCheckout and FB - Purchase, a constant with your pixel ID and the Unique Event ID variable. Because the pixel needs a page view with an event ID, the GA4 page view becomes an event tag too.

Server container: the Facebook Conversion API template (Stape, from the gallery) with the same five events as server tags, firing on the GA4 events your web container already sends. They take value, currency, items and the user data on the event, hash email and phone, and forward the visitor's IP address, user agent and the _fbp and _fbc cookies.

Step 4 · One event ID for browser and server

A platform that receives the same event from a browser pixel and from a server tag counts it twice unless both carry the same event ID. The import takes care of that: the Unique Event ID variable creates one ID per event in the web container, the GA4 event settings send it to your server container as event_id, and both the pixel tag and the server tag send that same value in their deduplication field. The platform keeps one copy and discards the other.

With the Shopify app, the WordPress plugin or the Shopware plugin, a purchase that is also forwarded server-side carries the order number as mb_event_id, so the two purchase copies can be paired as well.

Meta deduplicates on event name plus event ID within 48 hours. Events Manager shows the share of events that were deduplicated under the pixel's overview.

The imported tags carry the consent settings of the reference containers they were copied from. Check them against your own consent setup before you publish: a browser pixel should require ad_storage under Additional consent checks or fire on your consent tool's event, and the server tags should only send when the hit carries ad consent. The audit's consent checks and the guide on tags that fire before consent show how to verify both.

Step 6 · Test it

In Events Manager, open Test events, browse your site in the same browser and watch both the browser and the server copy arrive; the server tag has a field for the test event code while you test. Check that each event pair shows as deduplicated and that the server copy lists the matched parameters.

On the Measurebase side, open the domain's Request logs: a browse through your site should show GA4 events arriving at your server container with a green 200. Open the server container's Preview mode to see the server tag fire on those events, with the event ID and the user data it picked up.

Event Match Quality

Meta scores every server event on how many identifiers it could match: _fbp, _fbc, hashed email and phone, IP address, user agent and external ID. Three Measurebase power-ups push that score up without extra work: Cookie Keeper keeps _fbp and _fbc alive past Safari's 7-day cap, Click ID Restorer captures the fbclid in a first-party cookie the moment the visitor lands, and the hashed customer fields come from the data layer our Shopify app, WordPress plugin and Shopware plugin push on purchases and leads.

What the tracking audit checks

Every night the tracking audit compares your measurement setup with your live containers and your site. For every destination it checks that the tags exist in the container your setup expects, that the ID in the container matches the one in your setup, that a browser pixel and its server tag share an event ID, and which of the platform's cookies are still set after a visitor rejects. Findings open an alert the first time they appear; what the audit can fix, it proposes as a change in a separate Measurebase workspace in your container.

For Meta it also checks that every pixel tag sends an event ID and that your GA4 event tags carry one for the server copies. Accounts with the Meta connection switched on can link the pixel under Connections: the audit then reads Event Match Quality per event, the share of events whose IDs never match on the other side, and events that still carry raw personal data, and it can propose the Conversions API tags, the event-ID chain and _fbp generation as fixes.

Frequently asked questions

Do I still need the browser pixel?

Yes. The server copy alone matches worse, and Meta's website custom audiences and some optimisation signals still come from the pixel. Run both, deduplicated.

My shop already sends events through the Facebook & Instagram channel.

Then a second pixel outside Tag Manager sends the same events without your event IDs, and Meta counts them twice. Either switch that channel's data sharing off or leave the pixel out of the import. The site crawl in the audit lists every pixel that loads outside your container.

Which events does the import cover?

Page view, view item, add to cart, begin checkout and purchase, plus lead when your site pushes generate_lead. Add other standard events by copying one of the imported tags.

Continue reading

Ready to move your tagging to Europe?

Start free, no credit card required. Live in about 15 minutes.

Start free