Facebook Business Conversions API integration

Hi! Wasn’t certain if this post belonged in features or support.

I have a client who needs their site to be integrated with Meta’s Conversion API. Their frontend integration is easy enough with their pixel script.

But they also require server side integration. From my understanding i cannot run code uppon a htttp request on Netlify since everything is delivered via a CDN.

At the moment the only solution i can think of is to create Netlify functions that can integrate with the conversions API and forward query strings sent via facebook ads to that API.

Is there another way to integrate Netlify with Facebooks Conversions API?

Any input would be appreciated. Thank you.

  • Please make sure that, before you post a feature request, you looked around to see if it already exists. We may already be working on it.
  • If it does, please post in that thread instead of starting a new one.
  • If it doesn’t, please provide as much information as you can on why we should consider your feature request: How does it benefit you & others? (how does it make our services better, save people money, is safer, more stable, or is otherwise a fantastic idea?)

Pitch it to us!

Sounds about right.

Not that I can think of.

That’s an excellent question, and your understanding is spot-on - Netlify Functions are indeed the most direct and common path for a server-side integration like the Meta Conversions API (CAPI) on a platform primarily delivering content via a CDN.

The answer from @hrishikesh is correct: there isn’t a simpler, native Netlify-only way to run code upon an HTTP request outside of a Function.

While Netlify Functions are a great approach, the alternative solution you’re asking about - involving Google Tag Manager (GTM) and a dedicated server-side endpoint provider - offers a lot of benefits for a client, especially for robust, scalable, and manageable tracking.

A combination like Netlify, Google Tag Manager, and a service like Stape or even a custom Google Cloud Platform (GCP) or Amazon Web Services (AWS) endpoint is a powerful way to implement the Conversions API.

Here’s why this setup is a good idea: your Netlify frontend would use the standard Meta Pixel client-side script to send data, but instead of sending it directly to Meta’s servers for the server-side part, you’d send it to a server-side Google Tag Manager container hosted on an external server, like one managed by Stape or a custom-built environment on GCP.

This is often called “server-side tagging.”

Within this server-side GTM container, you can then use a tag to forward the event data to the Facebook Conversions API endpoint.

The key advantage is that this setup centralizes your server-side tracking logic outside of Netlify’s Function environment, which can make it easier to manage, scale, and update, particularly when dealing with multiple tracking vendors beyond just Meta.

The server-side GTM container acts as a single endpoint for all your analytics data, whether it’s for PageView, Purchase, or other Standard Events.

It also facilitates the crucial step of event deduplication, as you can send an event ID from the client-side pixel to Meta, and send the same event ID from your server-side GTM setup, allowing Meta to disregard the duplicate to maintain data integrity.

Finally, by using a custom domain for your GTM server (e.g., data.yourclientdomain.com), you can send data from a first-party context, which is more reliable and less likely to be blocked by ad blockers or browser privacy features than a third-party request directly to Meta.

While it introduces another service (Stape or Google Cloud Platform), it creates a future-proof tracking infrastructure.